use ethers for testing
MODIFY
test/config.js
test/config.js
@@ -11,12 +11,13 @@ module.exports = {
pos: {
parent: {
erc20: '0x655f2166b0709cd575202630952d71e2bb0d61af',
- erc721: '0x5a08d01e07714146747950CE07BB0f741445D1b8',
+ erc721: '0x16f7ef3774c59264c46e5063b1111bcfd6e7a72f',
+ // erc721: '0x5a08d01e07714146747950CE07BB0f741445D1b8',
erc1155: '0x2e3Ef7931F2d0e4a7da3dea950FF3F19269d9063',
chainManagerAddress: '0xBbD7cBFA79faee899Eaf900F13C9065bF03B1A74', // Address of RootChainManager proxy for POS Portal
},
child: {
- erc721: '0xEC8CB8bBb069470bC358ffB0e3710c64830da383',
+ erc721: '0xbD88C3A7c0e242156a46Fbdf87141Aa6D0c0c649',
erc20: '0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1',
weth: '0x714550C2C1Ea08688607D86ed8EeF4f5E4F22323',
erc1155: '0xA07e45A987F19E25176c877d98388878622623FA',

MODIFY
test/debug.js
test/debug.js
@@ -40,7 +40,7 @@ const execute = async () => {
- // return console.log(await client.isDeposited('0xc67599f5c967f2040786d5924ec55d37bf943c009bdd23f3b50e5ae66efde258'));
+ // return console.log(await client.isDeposited('0x05b6d0d2280557c04de48d395f1f4ea9deb498fabb9bb09b9aec929db5ce62fa'));
// const balance = await mumbaiERC20Token.getBalance(
@@ -54,24 +54,31 @@ const execute = async () => {
// return console.log("tokens", tokens);
// const tx = await goerliERC721Token.approveAll({
- // maxPriorityFeePerGas: 2000000000,
- // returnTransaction: true
+ // // maxPriorityFeePerGas: 2000000000,
+ // // returnTransaction: true
// });
- // const tx = await goerliERC721Token.depositMany(['70362948865848051982628883253610138761681237831617060123833093242173388773544'], from, {
+ var tx = await goerliERC20Token.getAllowance(from, {
// returnTransaction: true
- // });
- setProofApi("https://apis.matic.network")
- const tx = await goerliERC20Token.withdrawExitFaster(
- '0x1c20c41b9d97d1026aa456a21f13725df63edec1b1f43aacb180ebcc6340a2d3', {
- returnTransaction: true
});
+ return console.log('tx', tx);
+
+
+ var tx = await goerliERC20Token.approveMax({
+ // returnTransaction: true
+ });
+ // setProofApi("https://apis.matic.network")
+ // const tx = await goerliERC20Token.withdrawExitFaster(
+ // '0x1c20c41b9d97d1026aa456a21f13725df63edec1b1f43aacb180ebcc6340a2d3', {
+ // returnTransaction: true
+ // });
+
console.log('tx', tx);
// // setProofApi("https://apis.matic.network")
// // const tx = await goerliERC20Token.withdrawExit('0xd6f7f4c6052611761946519076de28fbd091693af974e7d4abc1b17fd7926fd7');
- // console.log("txHash", await tx.getTransactionHash());
- // console.log("txReceipt", await tx.getReceipt());
+ console.log("txHash", await tx.getTransactionHash());
+ console.log("txReceipt", await tx.getReceipt());
//txhash to plasma exit - 0x63aa095e0d6ee8698399b871daa202eb5522933e2d94c5929cf0fb86b6b0c628
const tokenId = '60399350241383852757821046101235634991156913804166740995010931519407953501076'

MODIFY
test/karma.conf.js
test/karma.conf.js
@@ -40,6 +40,6 @@ module.exports = function (config) {
autoWatch: false,
singleRun: true,
concurrency: Infinity,
- browserNoActivityTimeout: 40000,
+ browserNoActivityTimeout: 60000,
})
}

MODIFY
test/package-lock.json
test/package-lock.json
"@ethersproject/bytes": "^5.5.0"
}
},
+ "@ethersproject/basex": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.5.0.tgz",
+ "integrity": "sha512-ZIodwhHpVJ0Y3hUCfUucmxKsWQA5TMnavp5j/UOuDdzZWzJlRmuOjcTMIGgHCYuZmHt36BfiSyQPSRskPxbfaQ==",
+ "requires": {
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0"
+ }
+ },
"@ethersproject/bignumber": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz",
"@ethersproject/bignumber": "^5.5.0"
}
},
+ "@ethersproject/contracts": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.5.0.tgz",
+ "integrity": "sha512-2viY7NzyvJkh+Ug17v7g3/IJC8HqZBDcOjYARZLdzRxrfGlRgmYgl6xPRKVbEzy1dWKw/iv7chDcS83pg6cLxg==",
+ "requires": {
+ "@ethersproject/abi": "^5.5.0",
+ "@ethersproject/abstract-provider": "^5.5.0",
+ "@ethersproject/abstract-signer": "^5.5.0",
+ "@ethersproject/address": "^5.5.0",
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/constants": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/transactions": "^5.5.0"
+ },
+ "dependencies": {
+ "@ethersproject/abi": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz",
+ "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==",
+ "requires": {
+ "@ethersproject/address": "^5.5.0",
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/constants": "^5.5.0",
+ "@ethersproject/hash": "^5.5.0",
+ "@ethersproject/keccak256": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0"
+ }
+ }
+ }
+ },
"@ethersproject/hash": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz",
"@ethersproject/strings": "^5.5.0"
}
},
+ "@ethersproject/hdnode": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.5.0.tgz",
+ "integrity": "sha512-mcSOo9zeUg1L0CoJH7zmxwUG5ggQHU1UrRf8jyTYy6HxdZV+r0PBoL1bxr+JHIPXRzS6u/UW4mEn43y0tmyF8Q==",
+ "requires": {
+ "@ethersproject/abstract-signer": "^5.5.0",
+ "@ethersproject/basex": "^5.5.0",
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/pbkdf2": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/sha2": "^5.5.0",
+ "@ethersproject/signing-key": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0",
+ "@ethersproject/transactions": "^5.5.0",
+ "@ethersproject/wordlists": "^5.5.0"
+ }
+ },
+ "@ethersproject/json-wallets": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz",
+ "integrity": "sha512-9lA21XQnCdcS72xlBn1jfQdj2A1VUxZzOzi9UkNdnokNKke/9Ya2xA9aIK1SC3PQyBDLt4C+dfps7ULpkvKikQ==",
+ "requires": {
+ "@ethersproject/abstract-signer": "^5.5.0",
+ "@ethersproject/address": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/hdnode": "^5.5.0",
+ "@ethersproject/keccak256": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/pbkdf2": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/random": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0",
+ "@ethersproject/transactions": "^5.5.0",
+ "aes-js": "3.0.0",
+ "scrypt-js": "3.0.1"
+ },
+ "dependencies": {
+ "aes-js": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz",
+ "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0="
+ }
+ }
+ },
"@ethersproject/keccak256": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz",
"@ethersproject/logger": "^5.5.0"
}
},
+ "@ethersproject/pbkdf2": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz",
+ "integrity": "sha512-SaDvQFvXPnz1QGpzr6/HToLifftSXGoXrbpZ6BvoZhmx4bNLHrxDe8MZisuecyOziP1aVEwzC2Hasj+86TgWVg==",
+ "requires": {
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/sha2": "^5.5.0"
+ }
+ },
"@ethersproject/properties": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz",
"@ethersproject/logger": "^5.5.0"
}
},
+ "@ethersproject/providers": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.5.0.tgz",
+ "integrity": "sha512-xqMbDnS/FPy+J/9mBLKddzyLLAQFjrVff5g00efqxPzcAwXiR+SiCGVy6eJ5iAIirBOATjx7QLhDNPGV+AEQsw==",
+ "requires": {
+ "@ethersproject/abstract-provider": "^5.5.0",
+ "@ethersproject/abstract-signer": "^5.5.0",
+ "@ethersproject/address": "^5.5.0",
+ "@ethersproject/basex": "^5.5.0",
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/constants": "^5.5.0",
+ "@ethersproject/hash": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/networks": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/random": "^5.5.0",
+ "@ethersproject/rlp": "^5.5.0",
+ "@ethersproject/sha2": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0",
+ "@ethersproject/transactions": "^5.5.0",
+ "@ethersproject/web": "^5.5.0",
+ "bech32": "1.1.4",
+ "ws": "7.4.6"
+ }
+ },
+ "@ethersproject/random": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.5.0.tgz",
+ "integrity": "sha512-egGYZwZ/YIFKMHcoBUo8t3a8Hb/TKYX8BCBoLjudVCZh892welR3jOxgOmb48xznc9bTcMm7Tpwc1gHC1PFNFQ==",
+ "requires": {
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0"
+ }
+ },
"@ethersproject/rlp": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz",
"@ethersproject/logger": "^5.5.0"
}
},
+ "@ethersproject/sha2": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz",
+ "integrity": "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==",
+ "requires": {
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "hash.js": "1.1.7"
+ }
+ },
"@ethersproject/signing-key": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz",
"hash.js": "1.1.7"
}
},
+ "@ethersproject/solidity": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.5.0.tgz",
+ "integrity": "sha512-9NgZs9LhGMj6aCtHXhtmFQ4AN4sth5HuFXVvAQtzmm0jpSCNOTGtrHZJAeYTh7MBjRR8brylWZxBZR9zDStXbw==",
+ "requires": {
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/keccak256": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/sha2": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0"
+ }
+ },
"@ethersproject/strings": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz",
"@ethersproject/signing-key": "^5.5.0"
}
},
+ "@ethersproject/units": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.5.0.tgz",
+ "integrity": "sha512-7+DpjiZk4v6wrikj+TCyWWa9dXLNU73tSTa7n0TSJDxkYbV3Yf1eRh9ToMLlZtuctNYu9RDNNy2USq3AdqSbag==",
+ "requires": {
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/constants": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0"
+ }
+ },
+ "@ethersproject/wallet": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.5.0.tgz",
+ "integrity": "sha512-Mlu13hIctSYaZmUOo7r2PhNSd8eaMPVXe1wxrz4w4FCE4tDYBywDH+bAR1Xz2ADyXGwqYMwstzTrtUVIsKDO0Q==",
+ "requires": {
+ "@ethersproject/abstract-provider": "^5.5.0",
+ "@ethersproject/abstract-signer": "^5.5.0",
+ "@ethersproject/address": "^5.5.0",
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/hash": "^5.5.0",
+ "@ethersproject/hdnode": "^5.5.0",
+ "@ethersproject/json-wallets": "^5.5.0",
+ "@ethersproject/keccak256": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/random": "^5.5.0",
+ "@ethersproject/signing-key": "^5.5.0",
+ "@ethersproject/transactions": "^5.5.0",
+ "@ethersproject/wordlists": "^5.5.0"
+ }
+ },
"@ethersproject/web": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.0.tgz",
"@ethersproject/strings": "^5.5.0"
}
},
+ "@ethersproject/wordlists": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.5.0.tgz",
+ "integrity": "sha512-bL0UTReWDiaQJJYOC9sh/XcRu/9i2jMrzf8VLRmPKx58ckSlOJiohODkECCO50dtLZHcGU6MLXQ4OOrgBwP77Q==",
+ "requires": {
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/hash": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0"
+ }
+ },
+ "@maticnetwork/maticjs-ethers": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-ethers/-/maticjs-ethers-0.2.0.tgz",
+ "integrity": "sha512-V3Diz8UtVt0UlOkY2f5y72lDyVzM1QMZoyZEwL/Dtx7nX3RmL5e34LmiEdS0i97agyklZ1cWKSDJPGXoOau0/g==",
+ "requires": {
+ "ethers": "^5.5.1"
+ }
+ },
"@maticnetwork/maticjs-web3": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@maticnetwork/maticjs-web3/-/maticjs-web3-0.5.0.tgz",
"tweetnacl": "^0.14.3"
}
},
+ "bech32": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz",
+ "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="
+ },
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
}
}
},
+ "ethers": {
+ "version": "5.5.1",
+ "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.5.1.tgz",
+ "integrity": "sha512-RodEvUFZI+EmFcE6bwkuJqpCYHazdzeR1nMzg+YWQSmQEsNtfl1KHGfp/FWZYl48bI/g7cgBeP2IlPthjiVngw==",
+ "requires": {
+ "@ethersproject/abi": "5.5.0",
+ "@ethersproject/abstract-provider": "5.5.1",
+ "@ethersproject/abstract-signer": "5.5.0",
+ "@ethersproject/address": "5.5.0",
+ "@ethersproject/base64": "5.5.0",
+ "@ethersproject/basex": "5.5.0",
+ "@ethersproject/bignumber": "5.5.0",
+ "@ethersproject/bytes": "5.5.0",
+ "@ethersproject/constants": "5.5.0",
+ "@ethersproject/contracts": "5.5.0",
+ "@ethersproject/hash": "5.5.0",
+ "@ethersproject/hdnode": "5.5.0",
+ "@ethersproject/json-wallets": "5.5.0",
+ "@ethersproject/keccak256": "5.5.0",
+ "@ethersproject/logger": "5.5.0",
+ "@ethersproject/networks": "5.5.0",
+ "@ethersproject/pbkdf2": "5.5.0",
+ "@ethersproject/properties": "5.5.0",
+ "@ethersproject/providers": "5.5.0",
+ "@ethersproject/random": "5.5.0",
+ "@ethersproject/rlp": "5.5.0",
+ "@ethersproject/sha2": "5.5.0",
+ "@ethersproject/signing-key": "5.5.0",
+ "@ethersproject/solidity": "5.5.0",
+ "@ethersproject/strings": "5.5.0",
+ "@ethersproject/transactions": "5.5.0",
+ "@ethersproject/units": "5.5.0",
+ "@ethersproject/wallet": "5.5.0",
+ "@ethersproject/web": "5.5.0",
+ "@ethersproject/wordlists": "5.5.0"
+ },
+ "dependencies": {
+ "@ethersproject/abi": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz",
+ "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==",
+ "requires": {
+ "@ethersproject/address": "^5.5.0",
+ "@ethersproject/bignumber": "^5.5.0",
+ "@ethersproject/bytes": "^5.5.0",
+ "@ethersproject/constants": "^5.5.0",
+ "@ethersproject/hash": "^5.5.0",
+ "@ethersproject/keccak256": "^5.5.0",
+ "@ethersproject/logger": "^5.5.0",
+ "@ethersproject/properties": "^5.5.0",
+ "@ethersproject/strings": "^5.5.0"
+ }
+ }
+ }
+ },
"ethjs-unit": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz",
"ws": {
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
- "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
- "dev": true
+ "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A=="
},
"xhr": {
"version": "2.6.0",

MODIFY
test/package.json
test/package.json
"webpack-cli": "^4.2.0"
},
"dependencies": {
+ "@maticnetwork/maticjs-ethers": "^0.2.0",
"@maticnetwork/maticjs-web3": "^0.5.0",
"@truffle/hdwallet-provider": "^1.5.1-alpha.1",
"mochapack": "^2.1.2"

MODIFY
test/specs/client.ts
test/specs/client.ts
import { POSClient } from "@maticnetwork/maticjs";
import HDWalletProvider from "@truffle/hdwallet-provider";
import { user1, rpc, pos, user2 } from "../config";
+import { providers, Wallet } from "ethers";
export const privateKey = user1.privateKey;
export const from = user1.address;
@@ -18,18 +19,22 @@ export const erc721 = {
child: pos.child.erc721
}
+const parentPrivder = new providers.JsonRpcProvider(rpc.parent);
+const childProvider = new providers.JsonRpcProvider(rpc.child);
+
+
export const posClient = new POSClient({
// log: true,
network: 'testnet',
version: 'mumbai',
parent: {
- provider: new HDWalletProvider(privateKey, rpc.parent),
+ provider: new Wallet(privateKey, parentPrivder),
defaultConfig: {
from
}
},
child: {
- provider: new HDWalletProvider(privateKey, rpc.child),
+ provider: new Wallet(privateKey, childProvider),
defaultConfig: {
from
}
@@ -41,13 +46,13 @@ export const posClientForTo = new POSClient({
network: 'testnet',
version: 'mumbai',
parent: {
- provider: new HDWalletProvider(toPrivateKey, rpc.parent),
+ provider: new Wallet(toPrivateKey, parentPrivder),
defaultConfig: {
from: to
}
},
child: {
- provider: new HDWalletProvider(toPrivateKey, rpc.child),
+ provider: new Wallet(toPrivateKey, childProvider),
defaultConfig: {
from: to
}

MODIFY
test/specs/erc20.spec.ts
test/specs/erc20.spec.ts
@@ -144,6 +144,7 @@ describe('ERC20', () => {
expect(result.data).equal(
"0x3805550f00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000827f9082484235e69b0b9010031f7f7ef8848837caca0654cdd16c2c1af23e138d5ea431107325c6d99dfa567b8e395866f4fd177d79de4a8fec9d06ecea4223f55d1724e6c8455dc62148394266f9e732545254f25407139bd8cb3ecfbd9053933f23e1fca181659680cf4c1a5a6c6f723df2d7d35f3fc14929c8ccef3a9fff644db162a845ecf3a89f41b98436f15fada0f112ebea28f29e9e97f3635bd68ff97de3c0f5cdbd867bd8cb13af5930f55ca3b9ee8f345c3923965d2935a72bb4ddff77b6d5a8f427fbe79945d58189e2f58bec6c09e38c058bb80978eee60bcc260c883be329eb37a9c029e7d5733a173b53aeb0e92f925db4dc681d4bfa2f05c8c5fdd296230d1411b05264a84013c786a84617a6c24a0a317bf456e88f02bccaab4c7aa1a919485ee451901772eeff615a2ab305f3ca0a0984131328f0f9b4ffba09638e99ce4ec98b1aec6eb46eb3023078a03be9d51f8b902ebf902e801830743f9b9010000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000008000000800000000000000000000100000000000000000000020000000000000000000800000000000000000080000010000000000000000000010000000008000000000000000000000000000000000000000000200000000000000020000000000000010001000000000000000000000000004000000003000000000001000000000000000000000000000000100000400020000000000000000000000000000000000000000000000000000000000000100000f901ddf89b94fe4f5145f6e09952a5ba9e956ed0c25e3fa4c7f1f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000fd71dc9721d9ddcf0480a582927c3dcd42f3064ca00000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000af9013d940000000000000000000000000000000000001010f884a04dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63a00000000000000000000000000000000000000000000000000000000000001010a0000000000000000000000000fd71dc9721d9ddcf0480a582927c3dcd42f3064ca0000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8b8a000000000000000000000000000000000000000000000000000005d17d8a0120000000000000000000000000000000000000000000000006f680513d061bb0d020000000000000000000000000000000000000000000001c57a98b6c5d67d41f500000000000000000000000000000000000000000000006f6804b6b8891afb020000000000000000000000000000000000000000000001c57a9913ddaf1d53f5b903dbf903d8f851a051de183267eca4127869bd2deab74a212d98ec445ea022f108006a65d32011b780808080808080a0f3099598ea2f187f803b8d66b328edf300720bfb016f4d89b4a1eceebf969f508080808080808080f89180a0ee5f307c063eefc1f9ad442f3b9f8f2981f9385b41da5465de5ac5dec863d5c7a0d5a8f8f4ab278e0aea28f1044da97c7bd3a5e807b48cd01bf705b704aa5ddd14a032a40b81b5316142b455addcb7bdd194be8e38196408efefcc4291803a402eeea0188088651f1f064c8fa57051108a83c9d695f1a124dc3783ed2a2e6e7c8fd21a808080808080808080808080f902ef20b902ebf902e801830743f9b9010000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000008000000800000000000000000000100000000000000000000020000000000000000000800000000000000000080000010000000000000000000010000000008000000000000000000000000000000000000000000200000000000000020000000000000010001000000000000000000000000004000000003000000000001000000000000000000000000000000100000400020000000000000000000000000000000000000000000000000000000000000100000f901ddf89b94fe4f5145f6e09952a5ba9e956ed0c25e3fa4c7f1f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000fd71dc9721d9ddcf0480a582927c3dcd42f3064ca00000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000af9013d940000000000000000000000000000000000001010f884a04dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63a00000000000000000000000000000000000000000000000000000000000001010a0000000000000000000000000fd71dc9721d9ddcf0480a582927c3dcd42f3064ca0000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8b8a000000000000000000000000000000000000000000000000000005d17d8a0120000000000000000000000000000000000000000000000006f680513d061bb0d020000000000000000000000000000000000000000000001c57a98b6c5d67d41f500000000000000000000000000000000000000000000006f6804b6b8891afb020000000000000000000000000000000000000000000001c57a9913ddaf1d53f58200038000000000000000000000000000000000000000000000000000"
)
+ console.log("withdraw exit ended");
});
it('withdrawExitFaster return tx without setProofAPI', async () => {
@@ -185,9 +186,9 @@ describe('ERC20', () => {
expect(txReceipt.transactionHash).equal(txHash);
expect(txReceipt).to.be.an('object');
- expect(txReceipt.from).equal(from);
+ expect(txReceipt.from.toLowerCase()).equal(from.toLowerCase());
expect(txReceipt.to.toLowerCase()).equal(erc20.child.toLowerCase());
- expect(txReceipt.type).equal('0x0');
+ expect(txReceipt.type).equal(0);
expect(txReceipt.gasUsed).to.be.an('number').gt(0);
expect(txReceipt.cumulativeGasUsed).to.be.an('number').gt(0);
@@ -230,7 +231,7 @@ describe('ERC20', () => {
const txReceipt = await result.getReceipt();
console.log("txReceipt", txReceipt);
- expect(txReceipt.type).equal('0x0');
+ expect(txReceipt.type).equal(2);
});
it('deposit', async () => {

MODIFY
test/specs/erc721.spec.ts
test/specs/erc721.spec.ts
@@ -51,6 +51,9 @@ describe('ERC721', () => {
it('transfer return tx', async () => {
const allTokensFrom = await erc721Child.getAllTokens(from);
const targetToken = allTokensFrom[0];
+
+
+
const result = await erc721Child.transfer(targetToken, from, to, {
returnTransaction: true
});
@@ -118,7 +121,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('0x0');
+ expect(txReceipt.type).equal(0);
expect(txReceipt.gasUsed).to.be.an('number').gt(0);
expect(txReceipt.cumulativeGasUsed).to.be.an('number').gt(0);

MODIFY
test/specs/index.ts
test/specs/index.ts
import { use } from "@maticnetwork/maticjs";
-import { Web3ClientPlugin } from "@maticnetwork/maticjs-web3";
+import { Web3ClientPlugin } from "@maticnetwork/maticjs-ethers";
use(Web3ClientPlugin);

use ethers for testing