rename exit_manager to exit_util
MODIFY
package.json
package.json
{
"name": "@maticnetwork/maticjs",
- "version": "3.0.0-beta.2",
+ "version": "3.0.0-beta.3",
"description": "Javascript developer library for interacting with Matic Network",
"main": "dist/npm.export.js",
"types": "dist/ts/index.d.ts",

MODIFY
src/interfaces/plasma_helper_contract.ts
src/interfaces/plasma_helper_contract.ts
@@ -6,6 +6,6 @@ import { DepositManager } from "../plasma/deposit_manager";
export interface IPlasmaContracts {
depositManager: DepositManager;
registry: RegistryContract;
- exitManager: ExitUtil;
+ exitUtil: ExitUtil;
withdrawManager: WithdrawManager;
}
\ No newline at end of file

MODIFY
src/plasma/erc20.ts
src/plasma/erc20.ts
@@ -123,7 +123,7 @@ export class ERC20 extends PlasmaToken {
return Promise.all([
this.getPredicate(),
- this.contracts_.exitManager.buildPayloadForExit(
+ this.contracts_.exitUtil.buildPayloadForExit(
burnTxHash,
Log_Event_Signature.PlasmaErc20WithdrawEventSig,
isFast

MODIFY
src/plasma/erc721.ts
src/plasma/erc721.ts
@@ -107,7 +107,7 @@ export class ERC721 extends PlasmaToken {
return Promise.all([
this.getPredicate(),
- this.contracts_.exitManager.buildPayloadForExit(
+ this.contracts_.exitUtil.buildPayloadForExit(
burnTxHash,
Log_Event_Signature.PlasmaErc721WithdrawEventSig,
isFast

MODIFY
src/plasma/index.ts
src/plasma/index.ts
@@ -56,7 +56,7 @@ export class PlasmaClient extends BridgeClient {
client.config.depositManager
);
- this.exitManager = new ExitUtil(
+ this.exitUtil = new ExitUtil(
client.child,
this.rootChain,
config.requestConcurrency
@@ -74,7 +74,7 @@ export class PlasmaClient extends BridgeClient {
private getContracts__() {
return {
depositManager: this.depositManager,
- exitManager: this.exitManager,
+ exitUtil: this.exitUtil,
registry: this.registry,
withdrawManager: this.withdrawManager
} as IPlasmaContracts;

MODIFY
src/pos/erc20.ts
src/pos/erc20.ts
@@ -15,14 +15,14 @@ export class ERC20 extends POSToken {
isParent: boolean,
client: Web3SideChainClient,
rootChainManager: RootChainManager,
- exitManager: ExitUtil
+ exitUtil: ExitUtil
) {
super({
isParent,
address: tokenAddress,
name: 'ChildERC20',
bridgeType: 'pos'
- }, client, rootChainManager, exitManager);
+ }, client, rootChainManager, exitUtil);
}
getBalance(userAddress: string, option?: ITransactionOption) {
@@ -145,7 +145,7 @@ export class ERC20 extends POSToken {
withdrawExit(burnTransactionHash: string, option?: ITransactionOption) {
this.checkForRoot_("withdrawExit");
- return this.exitManager.buildPayloadForExit(
+ return this.exitUtil.buildPayloadForExit(
burnTransactionHash,
Log_Event_Signature.Erc20Transfer,
false
@@ -170,7 +170,7 @@ export class ERC20 extends POSToken {
this.checkForRoot_("withdrawExitFaster");
- return this.exitManager.buildPayloadForExit(
+ return this.exitUtil.buildPayloadForExit(
burnTransactionHash,
Log_Event_Signature.Erc20Transfer,
true
@@ -192,7 +192,7 @@ export class ERC20 extends POSToken {
if (!txHash) {
throw new Error(`txHash not provided`);
}
- return this.exitManager.getExitHash(
+ return this.exitUtil.getExitHash(
txHash, Log_Event_Signature.Erc20Transfer
).then(exitHash => {
return this.rootChainManager.isExitProcessed(

MODIFY
src/pos/erc721.ts
src/pos/erc721.ts
@@ -14,14 +14,14 @@ export class ERC721 extends POSToken {
isParent: boolean,
client: Web3SideChainClient,
rootChainManager: RootChainManager,
- exitManager: ExitUtil
+ exitUtil: ExitUtil
) {
super({
isParent,
address: tokenAddress,
name: 'ChildERC721',
bridgeType: 'pos'
- }, client, rootChainManager, exitManager);
+ }, client, rootChainManager, exitUtil);
}
private validateMany__(tokenIds) {
@@ -222,7 +222,7 @@ export class ERC721 extends POSToken {
this.checkForRoot_("withdrawExit");
- return this.exitManager.buildPayloadForExit(
+ return this.exitUtil.buildPayloadForExit(
burnTransactionHash,
Log_Event_Signature.Erc721Transfer,
false
@@ -237,7 +237,7 @@ export class ERC721 extends POSToken {
this.checkForRoot_("withdrawExitMany");
- return this.exitManager.buildPayloadForExit(
+ return this.exitUtil.buildPayloadForExit(
burnTransactionHash,
Log_Event_Signature.Erc721BatchTransfer,
false
@@ -252,7 +252,7 @@ export class ERC721 extends POSToken {
this.checkForRoot_("withdrawExitFaster");
- return this.exitManager.buildPayloadForExit(
+ return this.exitUtil.buildPayloadForExit(
burnTransactionHash,
Log_Event_Signature.Erc721Transfer,
true
@@ -267,7 +267,7 @@ export class ERC721 extends POSToken {
this.checkForRoot_("withdrawExitFasterMany");
- return this.exitManager.buildPayloadForExit(
+ return this.exitUtil.buildPayloadForExit(
burnTransactionHash,
Log_Event_Signature.Erc721BatchTransfer,
true
@@ -282,7 +282,7 @@ export class ERC721 extends POSToken {
if (!txHash) {
throw new Error(`txHash not provided`);
}
- return this.exitManager.getExitHash(
+ return this.exitUtil.getExitHash(
txHash, Log_Event_Signature.Erc721Transfer
).then(exitHash => {
return this.rootChainManager.isExitProcessed(
@@ -295,7 +295,7 @@ export class ERC721 extends POSToken {
if (!txHash) {
throw new Error(`txHash not provided`);
}
- return this.exitManager.getExitHash(
+ return this.exitUtil.getExitHash(
txHash, Log_Event_Signature.Erc721BatchTransfer
).then(exitHash => {
return this.rootChainManager.isExitProcessed(

MODIFY
src/pos/index.ts
src/pos/index.ts
@@ -49,7 +49,7 @@ export class POSClient extends BridgeClient {
config.rootChain,
);
- this.exitManager = new ExitUtil(
+ this.exitUtil = new ExitUtil(
this.client_.child,
this.rootChain,
config.requestConcurrency
@@ -65,7 +65,7 @@ export class POSClient extends BridgeClient {
isParent,
this.client_,
this.rootChainManager,
- this.exitManager
+ this.exitUtil
);
}
@@ -75,7 +75,7 @@ export class POSClient extends BridgeClient {
isParent,
this.client_,
this.rootChainManager,
- this.exitManager
+ this.exitUtil
);
}
@@ -83,7 +83,7 @@ export class POSClient extends BridgeClient {
return new ERC20(
'', true, this.client_,
this.rootChainManager,
- this.exitManager
+ this.exitUtil
)['depositEther__'](amount, option);
}
}
\ No newline at end of file

MODIFY
src/pos/pos_token.ts
src/pos/pos_token.ts
@@ -11,7 +11,7 @@ export class POSToken extends BaseToken {
contractParam: IContractInitParam,
client: Web3SideChainClient,
protected rootChainManager: RootChainManager,
- protected exitManager: ExitUtil
+ protected exitUtil: ExitUtil
) {
super(contractParam, client);
}

MODIFY
src/utils/bridge_client.ts
src/utils/bridge_client.ts
import { ExitUtil } from "../pos";
export class BridgeClient {
- exitManager: ExitUtil;
+ exitUtil: ExitUtil;
/**
* check whether a txHash is checkPointed
@@ -11,7 +11,7 @@ export class BridgeClient {
* @memberof BridgeClient
*/
isCheckPointed(txHash: string) {
- return this.exitManager.isCheckPointed(
+ return this.exitUtil.isCheckPointed(
txHash
);
}

MODIFY
test/debug.js
test/debug.js
@@ -36,10 +36,10 @@ const execute = async () => {
// const mumbaiERC720Token = client.erc721('0x33fc58f12a56280503b04ac7911d1eceebce179c');
const goerliERC20Token = client.erc20(plasma.parent.erc20, true);
- // const tx = await goerliERC20Token.approve(104);
- // console.log("txHash", await tx.getTransactionHash());
- // console.log("txReceipt", await tx.getReceipt());
- // return;
+ const tx = await goerliERC20Token.approve(104);
+ console.log("txHash", await tx.getTransactionHash());
+ console.log("txReceipt", await tx.getReceipt());
+ return;
const mumbaiERC721Token = client.erc721(plasma.child.erc721);
const goerliERC721Token = client.erc721(plasma.parent.erc721, true);
@@ -67,21 +67,21 @@ const execute = async () => {
// console.log("tx", tx);
// const result = await client.isCheckPointed('0x41162584974896bfc96d91e7ce72009373cd31acabe92024950831ee7b8067c0')
// console.log("result", result);
- const tx = await goerliERC721Token.withdrawChallenge(
- '0x41162584974896bfc96d91e7ce72009373cd31acabe92024950831ee7b8067c0',
- {
- // nonce: 11793,
- // gasPrice: '1000',
- // gas: 10000,
- // returnTransaction: true,
- // gasPrice: '4000000000',
- // returnTransaction: true,
- gasLimit: 1046107,
- }
- );
- console.log("tx", tx)
- console.log("txHash", await tx.getTransactionHash());
- console.log("txReceipt", await tx.getReceipt());
+ // const tx = await goerliERC721Token.withdrawChallenge(
+ // '0x41162584974896bfc96d91e7ce72009373cd31acabe92024950831ee7b8067c0',
+ // {
+ // // nonce: 11793,
+ // // gasPrice: '1000',
+ // // gas: 10000,
+ // // returnTransaction: true,
+ // // gasPrice: '4000000000',
+ // // returnTransaction: true,
+ // gasLimit: 1046107,
+ // }
+ // );
+ // console.log("tx", tx)
+ // console.log("txHash", await tx.getTransactionHash());
+ // console.log("txReceipt", await tx.getReceipt());
}
execute().then(_ => {

rename exit_manager to exit_util