diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2017-10-01 17:03:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-01 17:03:28 +0800 |
commit | d78ad226c26c84635c60fad233de9e6e438a5599 (patch) | |
tree | c78572046e8d95dfa50a48b0d980e2ee1727f18b /mobile/types.go | |
parent | a660685746db17a41cd67b05c614cdb29e49340c (diff) | |
download | dexon-d78ad226c26c84635c60fad233de9e6e438a5599.tar.gz dexon-d78ad226c26c84635c60fad233de9e6e438a5599.tar.zst dexon-d78ad226c26c84635c60fad233de9e6e438a5599.zip |
ethclient, mobile: add TransactionSender (#15127)
* core/types: make Signer derive address instead of public key
There are two reasons to do this now: The upcoming ethclient signer
doesn't know the public key, just the address. EIP 208 will introduce a
new signer which derives the 'entry point' address for transactions with
zero signature. The entry point has no public key.
Other changes to the interface ease the path make to moving signature
crypto out of core/types later.
* ethclient, mobile: add TransactionSender
The new method can get the right signer without any crypto, and without
knowledge of the signature scheme that was used when the transaction was
included.
Diffstat (limited to 'mobile/types.go')
-rw-r--r-- | mobile/types.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mobile/types.go b/mobile/types.go index 088c7c6b3..b7f8a3bc1 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -261,10 +261,13 @@ func (tx *Transaction) GetGasPrice() *BigInt { return &BigInt{tx.tx.GasPrice()} func (tx *Transaction) GetValue() *BigInt { return &BigInt{tx.tx.Value()} } func (tx *Transaction) GetNonce() int64 { return int64(tx.tx.Nonce()) } -func (tx *Transaction) GetHash() *Hash { return &Hash{tx.tx.Hash()} } -func (tx *Transaction) GetSigHash() *Hash { return &Hash{tx.tx.SigHash(types.HomesteadSigner{})} } -func (tx *Transaction) GetCost() *BigInt { return &BigInt{tx.tx.Cost()} } +func (tx *Transaction) GetHash() *Hash { return &Hash{tx.tx.Hash()} } +func (tx *Transaction) GetCost() *BigInt { return &BigInt{tx.tx.Cost()} } +// Deprecated: GetSigHash cannot know which signer to use. +func (tx *Transaction) GetSigHash() *Hash { return &Hash{types.HomesteadSigner{}.Hash(tx.tx)} } + +// Deprecated: use EthereumClient.TransactionSender func (tx *Transaction) GetFrom(chainID *BigInt) (address *Address, _ error) { var signer types.Signer = types.HomesteadSigner{} if chainID != nil { |