@@ -151,11 +151,11 @@ func TestTransactionSend(t *testing.T) {
151151 }
152152 return nil
153153 }),
154- backendmock .WithEstimateGasFunc (func (ctx context.Context , call ethereum.CallMsg ) (gas uint64 , err error ) {
155- if ! bytes .Equal (call .To .Bytes (), recipient .Bytes ()) {
156- t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , call .To )
154+ backendmock .WithEstimateGasAtBlockFunc (func (ctx context.Context , msg ethereum.CallMsg , blockNumber * big. Int ) (gas uint64 , err error ) {
155+ if ! bytes .Equal (msg .To .Bytes (), recipient .Bytes ()) {
156+ t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , msg .To )
157157 }
158- if ! bytes .Equal (call .Data , txData ) {
158+ if ! bytes .Equal (msg .Data , txData ) {
159159 t .Fatal ("estimating with wrong data" )
160160 }
161161 return estimatedGasLimit , nil
@@ -234,7 +234,7 @@ func TestTransactionSend(t *testing.T) {
234234 }
235235 return nil
236236 }),
237- backendmock .WithEstimateGasFunc (func (ctx context.Context , call ethereum.CallMsg ) (gas uint64 , err error ) {
237+ backendmock .WithEstimateGasAtBlockFunc (func (ctx context.Context , msg ethereum.CallMsg , blockNumber * big. Int ) (gas uint64 , err error ) {
238238 return 0 , errors .New ("estimate failure" )
239239 }),
240240 backendmock .WithPendingNonceAtFunc (func (ctx context.Context , account common.Address ) (uint64 , error ) {
@@ -314,11 +314,11 @@ func TestTransactionSend(t *testing.T) {
314314 }
315315 return nil
316316 }),
317- backendmock .WithEstimateGasFunc (func (ctx context.Context , call ethereum.CallMsg ) (gas uint64 , err error ) {
318- if ! bytes .Equal (call .To .Bytes (), recipient .Bytes ()) {
319- t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , call .To )
317+ backendmock .WithEstimateGasAtBlockFunc (func (ctx context.Context , msg ethereum.CallMsg , blockNumber * big. Int ) (gas uint64 , err error ) {
318+ if ! bytes .Equal (msg .To .Bytes (), recipient .Bytes ()) {
319+ t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , msg .To )
320320 }
321- if ! bytes .Equal (call .Data , txData ) {
321+ if ! bytes .Equal (msg .Data , txData ) {
322322 t .Fatal ("estimating with wrong data" )
323323 }
324324 return estimatedGasLimit , nil
@@ -396,11 +396,11 @@ func TestTransactionSend(t *testing.T) {
396396 }
397397 return nil
398398 }),
399- backendmock .WithEstimateGasFunc (func (ctx context.Context , call ethereum.CallMsg ) (gas uint64 , err error ) {
400- if ! bytes .Equal (call .To .Bytes (), recipient .Bytes ()) {
401- t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , call .To )
399+ backendmock .WithEstimateGasAtBlockFunc (func (ctx context.Context , msg ethereum.CallMsg , blockNumber * big. Int ) (gas uint64 , err error ) {
400+ if ! bytes .Equal (msg .To .Bytes (), recipient .Bytes ()) {
401+ t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , msg .To )
402402 }
403- if ! bytes .Equal (call .Data , txData ) {
403+ if ! bytes .Equal (msg .Data , txData ) {
404404 t .Fatal ("estimating with wrong data" )
405405 }
406406 return estimatedGasLimit , nil
@@ -461,7 +461,7 @@ func TestTransactionSend(t *testing.T) {
461461 }
462462 return nil
463463 }),
464- backendmock .WithEstimateGasFunc (func (ctx context.Context , call ethereum.CallMsg ) (gas uint64 , err error ) {
464+ backendmock .WithEstimateGasAtBlockFunc (func (ctx context.Context , call ethereum.CallMsg , blockNumber * big. Int ) (gas uint64 , err error ) {
465465 if ! bytes .Equal (call .To .Bytes (), recipient .Bytes ()) {
466466 t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , call .To )
467467 }
@@ -527,7 +527,7 @@ func TestTransactionSend(t *testing.T) {
527527 }
528528 return nil
529529 }),
530- backendmock .WithEstimateGasFunc (func (ctx context.Context , call ethereum.CallMsg ) (gas uint64 , err error ) {
530+ backendmock .WithEstimateGasAtBlockFunc (func (ctx context.Context , call ethereum.CallMsg , blockNumber * big. Int ) (gas uint64 , err error ) {
531531 if ! bytes .Equal (call .To .Bytes (), recipient .Bytes ()) {
532532 t .Fatalf ("estimating with wrong recipient. wanted %x, got %x" , recipient , call .To )
533533 }
0 commit comments