@@ -573,14 +573,15 @@ func TestNewTxArgsGasMissing(t *testing.T) {
573
573
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
574
574
}]`
575
575
expected := new (NewTxArgs )
576
- expected .Gas = big . NewInt ( 0 )
576
+ expected .Gas = nil
577
577
578
578
args := new (NewTxArgs )
579
579
if err := json .Unmarshal ([]byte (input ), & args ); err != nil {
580
580
t .Error (err )
581
581
}
582
582
583
- if bytes .Compare (expected .Gas .Bytes (), args .Gas .Bytes ()) != 0 {
583
+ if args .Gas != expected .Gas {
584
+ // if bytes.Compare(expected.Gas.Bytes(), args.Gas.Bytes()) != 0 {
584
585
t .Errorf ("Gas shoud be %v but is %v" , expected .Gas , args .Gas )
585
586
}
586
587
}
@@ -594,14 +595,15 @@ func TestNewTxArgsBlockGaspriceMissing(t *testing.T) {
594
595
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
595
596
}]`
596
597
expected := new (NewTxArgs )
597
- expected .GasPrice = big . NewInt ( 0 )
598
+ expected .GasPrice = nil
598
599
599
600
args := new (NewTxArgs )
600
601
if err := json .Unmarshal ([]byte (input ), & args ); err != nil {
601
602
t .Error (err )
602
603
}
603
604
604
- if bytes .Compare (expected .GasPrice .Bytes (), args .GasPrice .Bytes ()) != 0 {
605
+ if args .GasPrice != expected .GasPrice {
606
+ // if bytes.Compare(expected.GasPrice.Bytes(), args.GasPrice.Bytes()) != 0 {
605
607
t .Errorf ("GasPrice shoud be %v but is %v" , expected .GasPrice , args .GasPrice )
606
608
}
607
609
@@ -829,9 +831,10 @@ func TestCallArgsGasMissing(t *testing.T) {
829
831
}
830
832
831
833
expected := new (CallArgs )
832
- expected .Gas = big . NewInt ( 0 )
834
+ expected .Gas = nil
833
835
834
- if bytes .Compare (expected .Gas .Bytes (), args .Gas .Bytes ()) != 0 {
836
+ if args .Gas != expected .Gas {
837
+ // if bytes.Compare(expected.Gas.Bytes(), args.Gas.Bytes()) != 0 {
835
838
t .Errorf ("Gas shoud be %v but is %v" , expected .Gas , args .Gas )
836
839
}
837
840
@@ -852,9 +855,10 @@ func TestCallArgsBlockGaspriceMissing(t *testing.T) {
852
855
}
853
856
854
857
expected := new (CallArgs )
855
- expected .GasPrice = big . NewInt ( 0 )
858
+ expected .GasPrice = nil
856
859
857
- if bytes .Compare (expected .GasPrice .Bytes (), args .GasPrice .Bytes ()) != 0 {
860
+ if args .GasPrice != expected .GasPrice {
861
+ // if bytes.Compare(expected.GasPrice.Bytes(), args.GasPrice.Bytes()) != 0 {
858
862
t .Errorf ("GasPrice shoud be %v but is %v" , expected .GasPrice , args .GasPrice )
859
863
}
860
864
}
0 commit comments