(t *testing.T)
| 68 | ) |
| 69 | |
| 70 | func TestValidateTrustOptions(t *testing.T) { |
| 71 | testCases := []struct { |
| 72 | err bool |
| 73 | to light.TrustOptions |
| 74 | }{ |
| 75 | { |
| 76 | false, |
| 77 | trustOptions, |
| 78 | }, |
| 79 | { |
| 80 | true, |
| 81 | light.TrustOptions{ |
| 82 | Period: -1 * time.Hour, |
| 83 | Height: 1, |
| 84 | Hash: h1.Hash(), |
| 85 | }, |
| 86 | }, |
| 87 | { |
| 88 | true, |
| 89 | light.TrustOptions{ |
| 90 | Period: 1 * time.Hour, |
| 91 | Height: 0, |
| 92 | Hash: h1.Hash(), |
| 93 | }, |
| 94 | }, |
| 95 | { |
| 96 | true, |
| 97 | light.TrustOptions{ |
| 98 | Period: 1 * time.Hour, |
| 99 | Height: 1, |
| 100 | Hash: []byte("incorrect hash"), |
| 101 | }, |
| 102 | }, |
| 103 | } |
| 104 | |
| 105 | for _, tc := range testCases { |
| 106 | err := tc.to.ValidateBasic() |
| 107 | if tc.err { |
| 108 | assert.Error(t, err) |
| 109 | } else { |
| 110 | assert.NoError(t, err) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | } |
| 115 | |
| 116 | func TestMock(t *testing.T) { |
| 117 | l, _ := fullNode.LightBlock(ctx, 3) |
nothing calls this directly
no test coverage detected