convert receipt.type to hex in isTypedReceipt
MODIFY
src/utils/proof_util.ts
src/utils/proof_util.ts
@@ -185,8 +185,9 @@ export class ProofUtil {
});
}
- static isTypedReceipt(receipt) {
- return receipt.status !== undefined && receipt.status !== null && receipt.type !== "0x0" && receipt.type !== "0x";
+ static isTypedReceipt(receipt: ITransactionReceipt) {
+ const hexType = Converter.toHex(receipt.type);
+ return receipt.status != null && hexType !== "0x0" && hexType !== "0x";
}
// getStateSyncTxHash returns block's tx hash for state-sync receipt

MODIFY
test/specs/erc20.spec.ts
test/specs/erc20.spec.ts
@@ -207,7 +207,7 @@ describe('ERC20', () => {
expect(txReceipt).to.be.an('object');
expect(txReceipt.from.toLowerCase()).equal(from.toLowerCase());
expect(txReceipt.to.toLowerCase()).equal(erc20.child.toLowerCase());
- expect(txReceipt.type).equal(0);
+ expect(txReceipt.type).equal(2);
expect(txReceipt.gasUsed).to.be.an('number').gt(0);
expect(txReceipt.cumulativeGasUsed).to.be.an('number').gt(0);

MODIFY
test/specs/erc721.spec.ts
test/specs/erc721.spec.ts
@@ -120,7 +120,7 @@ describe('ERC721', () => {
expect(txReceipt).to.be.an('object');
expect(txReceipt.from).equal(from);
expect(txReceipt.to.toLowerCase()).equal(erc721.child.toLowerCase());
- expect(txReceipt.type).equal(0);
+ expect(txReceipt.type).equal(2);
expect(txReceipt.gasUsed).to.be.an('number').gt(0);
expect(txReceipt.cumulativeGasUsed).to.be.an('number').gt(0);

convert receipt.type to hex in isTypedReceipt