accounts/abi/bind: refactor transact method (#23719)

This commit is contained in:
Daniel Liu 2025-01-14 10:56:13 +08:00
parent 46a16f9149
commit 0c9babc95c

View file

@ -24,7 +24,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/XinFinOrg/XDPoSChain" ethereum "github.com/XinFinOrg/XDPoSChain"
"github.com/XinFinOrg/XDPoSChain/accounts/abi" "github.com/XinFinOrg/XDPoSChain/accounts/abi"
"github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/core/types" "github.com/XinFinOrg/XDPoSChain/core/types"
@ -164,7 +164,7 @@ func (c *BoundContract) Call(opts *CallOpts, results *[]interface{}, method stri
return err return err
} }
var ( var (
msg = XDPoSChain.CallMsg{From: opts.From, To: &c.address, Data: input, GasPrice: common.MinGasPrice50x, Gas: uint64(4200000)} msg = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input, GasPrice: common.MinGasPrice50x, Gas: uint64(4200000)}
ctx = ensureContext(opts.Context) ctx = ensureContext(opts.Context)
code []byte code []byte
output []byte output []byte
@ -339,7 +339,7 @@ func (c *BoundContract) estimateGasLimit(opts *TransactOpts, contract *common.Ad
return 0, ErrNoCode return 0, ErrNoCode
} }
} }
msg := XDPoSChain.CallMsg{ msg := ethereum.CallMsg{
From: opts.From, From: opts.From,
To: contract, To: contract,
GasPrice: gasPrice, GasPrice: gasPrice,
@ -420,7 +420,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
// Start the background filtering // Start the background filtering
logs := make(chan types.Log, 128) logs := make(chan types.Log, 128)
config := XDPoSChain.FilterQuery{ config := ethereum.FilterQuery{
Addresses: []common.Address{c.address}, Addresses: []common.Address{c.address},
Topics: topics, Topics: topics,
FromBlock: new(big.Int).SetUint64(opts.Start), FromBlock: new(big.Int).SetUint64(opts.Start),
@ -466,7 +466,7 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter
// Start the background filtering // Start the background filtering
logs := make(chan types.Log, 128) logs := make(chan types.Log, 128)
config := XDPoSChain.FilterQuery{ config := ethereum.FilterQuery{
Addresses: []common.Address{c.address}, Addresses: []common.Address{c.address},
Topics: topics, Topics: topics,
} }