Skip to content

Commit eb92522

Browse files
committed
mobile: use EIP155 signer for determining sender
1 parent 80f7c6c commit eb92522

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mobile/types.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,11 @@ func (tx *Transaction) GetHash() *Hash { return &Hash{tx.tx.Hash()} }
264264
func (tx *Transaction) GetSigHash() *Hash { return &Hash{tx.tx.SigHash(types.HomesteadSigner{})} }
265265
func (tx *Transaction) GetCost() *BigInt { return &BigInt{tx.tx.Cost()} }
266266

267-
func (tx *Transaction) GetFrom() (address *Address, _ error) {
268-
from, err := types.Sender(types.HomesteadSigner{}, tx.tx)
267+
func (tx *Transaction) GetFrom(chainID *BigInt) (address *Address, _ error) {
268+
if chainID == nil { // Null passed from mobile app
269+
chainID = new(BigInt)
270+
}
271+
from, err := types.Sender(types.NewEIP155Signer(chainID.bigint), tx.tx)
269272
return &Address{from}, err
270273
}
271274

0 commit comments

Comments
 (0)