diff --git a/quarkchain-ethereum-tx.js b/quarkchain-ethereum-tx.js index 6adc9d0..1eb449e 100644 --- a/quarkchain-ethereum-tx.js +++ b/quarkchain-ethereum-tx.js @@ -307,6 +307,15 @@ class Transaction { .imul(new BN(this.gasPrice)) .iadd(new BN(this.value)); } + + getSenderAddress() { + if (this._from) { + return this._from; + } + const pubkey = this.getSenderPublicKey(); + this._from = ethUtil.publicToAddress(pubkey); + return this._from; + } /** * validates the signature and checks to see if it has enough gas