diff options
author | bas-vk <bas-vk@users.noreply.github.com> | 2017-03-16 19:24:22 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-03-16 19:24:22 +0800 |
commit | 6d038e762b2ff5785d6884f09f869c45964647aa (patch) | |
tree | b7e71d4270a55bbe8d9552a0b67b37c008980fea /accounts/abi/bind/base.go | |
parent | 4e4e5fca541ae2c2c0bf5cde0b556fedfafa8d54 (diff) | |
download | dexon-6d038e762b2ff5785d6884f09f869c45964647aa.tar dexon-6d038e762b2ff5785d6884f09f869c45964647aa.tar.gz dexon-6d038e762b2ff5785d6884f09f869c45964647aa.tar.bz2 dexon-6d038e762b2ff5785d6884f09f869c45964647aa.tar.lz dexon-6d038e762b2ff5785d6884f09f869c45964647aa.tar.xz dexon-6d038e762b2ff5785d6884f09f869c45964647aa.tar.zst dexon-6d038e762b2ff5785d6884f09f869c45964647aa.zip |
accounts/abi/bind: allow client to specify sender address for call (#3782)
Diffstat (limited to 'accounts/abi/bind/base.go')
-rw-r--r-- | accounts/abi/bind/base.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 1f11827dd..93362d9e9 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -35,7 +35,8 @@ type SignerFn func(types.Signer, common.Address, *types.Transaction) (*types.Tra // CallOpts is the collection of options to fine tune a contract call request. type CallOpts struct { - Pending bool // Whether to operate on the pending state or the last known one + Pending bool // Whether to operate on the pending state or the last known one + From common.Address // Optional the sender address, otherwise the first account is used Context context.Context // Network context to support cancellation and timeouts (nil = no timeout) } @@ -108,7 +109,7 @@ func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string, return err } var ( - msg = ethereum.CallMsg{To: &c.address, Data: input} + msg = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input} ctx = ensureContext(opts.Context) code []byte output []byte |