allow `getAllowance` on child method
MODIFY
src/pos/erc20.ts
src/pos/erc20.ts
import { ITransactionOption } from "../interfaces";
-import { RootChainManager } from "./root_chain_manager";
import { Converter, Web3SideChainClient } from "../utils";
import { POSToken } from "./pos_token";
import { TYPE_AMOUNT } from "../types";
-import { ExitUtil } from "./exit_util";
import { Log_Event_Signature } from "../enums";
import { IPOSClientConfig, MAX_AMOUNT } from "..";
import { IPOSContracts } from "../interfaces/pos_contracts";
@@ -44,7 +42,6 @@ export class ERC20 extends POSToken {
* @memberof ERC20
*/
getAllowance(userAddress: string, option?: ITransactionOption) {
- this.checkForRoot("getAllowance");
return Promise.all([this.getPredicateAddress(), this.getContract()]).then(result => {
const [predicateAddress, contract] = result;

MODIFY
test/debug.js
test/debug.js
@@ -52,8 +52,8 @@ const execute = async () => {
// return console.log(await client.isDeposited('0x05b6d0d2280557c04de48d395f1f4ea9deb498fabb9bb09b9aec929db5ce62fa'));
- // var tx = await goerliERC1155Token.isApprovedAll(from);
- // return console.log('isapp', tx);
+ var tx = await mumbaiERC20Token.getAllowance(from);
+ return console.log('isapp', tx);
var tx = await goerliERC1155Token.deposit({
amount: 10,
tokenId: 123,

MODIFY
test/specs/erc1155.spec.ts
test/specs/erc1155.spec.ts
@@ -93,6 +93,13 @@ describe('ERC1155', () => {
expect(result['to'].toLowerCase()).equal(erc1155.child.toLowerCase());
})
+ it('withdrawStartMany return tx', async () => {
+ const result = await erc1155Child.withdrawStartMany([123], [10], {
+ returnTransaction: true
+ });
+ expect(result['to'].toLowerCase()).equal(erc1155.child.toLowerCase());
+ })
+
it('transfer write', async () => {
const targetToken = 123;

MODIFY
test/specs/erc20.spec.ts
test/specs/erc20.spec.ts
@@ -32,12 +32,18 @@ describe('ERC20', () => {
expect(Number(balance)).gte(0);
})
- it('get allowance', async () => {
+ it('get allowance parent', async () => {
const allowance = await erc20Parent.getAllowance(from);
expect(allowance).to.be.an('string');
expect(Number(allowance)).gte(0);
})
+ it('get allowance child', async () => {
+ const allowance = await erc20Child.getAllowance(from);
+ expect(allowance).to.be.an('string');
+ expect(Number(allowance)).gte(0);
+ })
+
it('is check pointed', async () => {
const isCheckPointed = await posClient.isCheckPointed('0xd6f7f4c6052611761946519076de28fbd091693af974e7d4abc1b17fd7926fd7');
expect(isCheckPointed).to.be.an('boolean').equal(true);

allow `getAllowance` on child method