mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/types: add From() helper function for Transaction
This commit is contained in:
parent
37531b1884
commit
de8d73c083
1 changed files with 5 additions and 0 deletions
|
|
@ -189,6 +189,11 @@ func (tx *Transaction) To() *common.Address {
|
|||
return &to
|
||||
}
|
||||
|
||||
// From returns the sender address of the transaction
|
||||
func (tx *Transaction) From() (common.Address, error) {
|
||||
return NewEIP155Signer(tx.ChainId()).Sender(tx)
|
||||
}
|
||||
|
||||
// Hash hashes the RLP encoding of tx.
|
||||
// It uniquely identifies the transaction.
|
||||
func (tx *Transaction) Hash() common.Hash {
|
||||
|
|
|
|||
Loading…
Reference in a new issue