Skip to content

Commit

Permalink
mobile: use EIP155 signer for determining sender
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-vk committed Jun 13, 2017
1 parent 80f7c6c commit eb92522
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mobile/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ 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) GetFrom() (address *Address, _ error) {
from, err := types.Sender(types.HomesteadSigner{}, tx.tx)
func (tx *Transaction) GetFrom(chainID *BigInt) (address *Address, _ error) {
if chainID == nil { // Null passed from mobile app
chainID = new(BigInt)
}
from, err := types.Sender(types.NewEIP155Signer(chainID.bigint), tx.tx)
return &Address{from}, err
}

Expand Down

0 comments on commit eb92522

Please sign in to comment.