Downcase addresses when checking for address equality in signTransactionAsync in the private key subprovider

This commit is contained in:
Brandon Chow
2019-07-15 18:34:32 -07:00
parent 43072ef80d
commit 6e0f982163
2 changed files with 3 additions and 3 deletions

View File

@@ -3,8 +3,8 @@
"version": "4.1.2",
"changes": [
{
"note": "Fix bug in Trezor subprovider causing Trezor response to not be hex encoded",
"pr": "WIP"
"note": "Fix bug in Private Key subprovider causing checksummed tx.origin addresses to be rejected.",
"pr": 1962
}
],
"timestamp": 1563240294

View File

@@ -47,7 +47,7 @@ export class PrivateKeyWalletSubprovider extends BaseWalletSubprovider {
*/
public async signTransactionAsync(txParams: PartialTxParams): Promise<string> {
PrivateKeyWalletSubprovider._validateTxParams(txParams);
if (txParams.from !== undefined && txParams.from !== this._address) {
if (txParams.from !== undefined && txParams.from.toLowerCase() !== this._address.toLowerCase()) {
throw new Error(
`Requested to sign transaction with address: ${txParams.from}, instantiated with address: ${
this._address