diff --git a/packages/ethers/package.json b/packages/ethers/package.json index b9784273ce..890985338c 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -20,7 +20,7 @@ "@into-the-fathom/networks": "^1.1.0", "@into-the-fathom/pbkdf2": "^1.1.0", "@into-the-fathom/properties": "^1.1.0", - "@into-the-fathom/providers": "^1.1.0", + "@into-the-fathom/providers": "^1.1.1", "@into-the-fathom/random": "^1.1.0", "@into-the-fathom/rlp": "^1.1.0", "@into-the-fathom/sha2": "^1.1.0", @@ -54,5 +54,5 @@ "sideEffects": false, "tarballHash": "0x9ac4e262538b9d1283eb473881a925065c322d73e9299e306b5382de7ec04829", "types": "./lib/index.d.ts", - "version": "1.1.0" + "version": "1.1.1" } \ No newline at end of file diff --git a/packages/providers/package.json b/packages/providers/package.json index bbb9cacca0..e03aa16d11 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -59,5 +59,5 @@ "sideEffects": false, "tarballHash": "0xedcf6f4d62e2cbdf77766b1c41a9e0a31d1b2bf660c5b06715799748912b291a", "types": "./lib/index.d.ts", - "version": "1.1.0" + "version": "1.1.1" } \ No newline at end of file diff --git a/packages/providers/src.ts/formatter.ts b/packages/providers/src.ts/formatter.ts index 3671755a65..fa6091a6f3 100644 --- a/packages/providers/src.ts/formatter.ts +++ b/packages/providers/src.ts/formatter.ts @@ -325,7 +325,7 @@ export class Formatter { // Some clients (TestRPC) do strange things like return 0x0 for the // 0 address; correct this to be a real address - if (transaction.to && BigNumber.from(transaction.to).isZero()) { + if (transaction.to && BigNumber.from(this.formatXdcPrefix(transaction.to)).isZero()) { transaction.to = "0x0000000000000000000000000000000000000000"; } @@ -439,6 +439,10 @@ export class Formatter { return Formatter.check(this.formats.filter, value); } + formatXdcPrefix(str: string): string { + return str.startsWith('xdc') ? '0x' + str.substring(3) : str; + } + filterLog(value: any): any { return Formatter.check(this.formats.filterLog, value); }