various fixes

This commit is contained in:
Jared Wasinger 2025-07-08 20:25:07 +09:00
parent eab13853a5
commit 45bc372947
2 changed files with 8 additions and 2 deletions

View file

@ -75,6 +75,10 @@ func (mt *mockTransactor) SendTransaction(ctx context.Context, tx *types.Transac
return nil
}
func (mt *mockTransactor) TransactionByHash(ctx context.Context, txHash common.Hash) (tx *types.Transaction, isPending bool, err error) {
return nil, false, nil
}
type mockCaller struct {
codeAtBlockNumber *big.Int
callContractBlockNumber *big.Int

View file

@ -29,6 +29,8 @@ package bind
import (
"context"
"errors"
"time"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
@ -36,7 +38,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"time"
)
// ContractEvent is a type constraint for ABI event types.
@ -268,7 +269,8 @@ func DefaultDeployer(opts *TransactOpts, backend ContractBackend) DeployFn {
if err != nil {
return common.Address{}, nil, err
}
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := waitAccepted(ctx, backend, tx.Hash()); err != nil {
return common.Address{}, nil, err
}