@@ -173,7 +173,7 @@ func TestEventTupleUnpack(t *testing.T) {
173
173
type EventTransferWithTag struct {
174
174
// this is valid because `value` is not exportable,
175
175
// so value is only unmarshalled into `Value1`.
176
- value * big.Int
176
+ value * big.Int //lint:ignore U1000 unused field is part of test
177
177
Value1 * big.Int `abi:"value"`
178
178
}
179
179
@@ -354,40 +354,6 @@ func unpackTestEventData(dest interface{}, hexData string, jsonEvent []byte, ass
354
354
return a .Unpack (dest , "e" , data )
355
355
}
356
356
357
- /*
358
- Taken from
359
- https://github.com/ethereum/go-ethereum/pull/15568
360
- */
361
-
362
- type testResult struct {
363
- Values [2 ]* big.Int
364
- Value1 * big.Int
365
- Value2 * big.Int
366
- }
367
-
368
- type testCase struct {
369
- definition string
370
- want testResult
371
- }
372
-
373
- func (tc testCase ) encoded (intType , arrayType Type ) []byte {
374
- var b bytes.Buffer
375
- if tc .want .Value1 != nil {
376
- val , _ := intType .pack (reflect .ValueOf (tc .want .Value1 ))
377
- b .Write (val )
378
- }
379
-
380
- if ! reflect .DeepEqual (tc .want .Values , [2 ]* big.Int {nil , nil }) {
381
- val , _ := arrayType .pack (reflect .ValueOf (tc .want .Values ))
382
- b .Write (val )
383
- }
384
- if tc .want .Value2 != nil {
385
- val , _ := intType .pack (reflect .ValueOf (tc .want .Value2 ))
386
- b .Write (val )
387
- }
388
- return b .Bytes ()
389
- }
390
-
391
357
// TestEventUnpackIndexed verifies that indexed field will be skipped by event decoder.
392
358
func TestEventUnpackIndexed (t * testing.T ) {
393
359
definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8"},{"indexed": false, "name":"value2", "type":"uint8"}]}]`
0 commit comments