Skip to content

Commit

Permalink
Merge pull request #6 from 0xEigenLabs/bridge_service
Browse files Browse the repository at this point in the history
fix: fix update global exit root map func
  • Loading branch information
BC-A authored Jun 4, 2024
2 parents 5536dde + 46dbd71 commit 3388735
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions examples/zkevm/update_global_exit_root.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ const { getZkEvmClient, zkEvm, from } = require('../utils_zkevm');

const execute = async () => {
const client = await getZkEvmClient();
let lastMainnetExitRoot = "0x696ab68e8fc171a30b26f661191a258f72a7a8a4794bb7d87647c32733909170"
await client.updateGlobalExitRootMap(lastMainnetExitRoot);
let lastMainnetExitRoot = "0x2cba6a7fc479e4f6993e891d125788dcac7ac4db16fe48d5a7ed646222c96d82"
let res = await client.updateGlobalExitRootMap(lastMainnetExitRoot);

const txHash = await res.getTransactionHash();
console.log("txHash", txHash);
const receipt = await res.getReceipt();
console.log("receipt", receipt);
}
execute().then(() => {
}).catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const config = {
abiStoreUrl: 'http://localhost:8000/network/',
zkEvmBridgeService: 'http://localhost:8080',
zkEvmBridgeService: 'http://localhost:3000',
}
5 changes: 3 additions & 2 deletions src/zkevm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class ZkEvmClient extends ZkEvmBridgeClient {
if (urlConfig.zkEvmBridgeService[urlConfig.zkEvmBridgeService.length - 1] !== '/') {
urlConfig.zkEvmBridgeService += '/';
}
urlConfig.zkEvmBridgeService += 'api/zkevm/';
service.zkEvmNetwork = new NetworkService(urlConfig.zkEvmBridgeService);
}

Expand Down Expand Up @@ -115,6 +114,8 @@ export class ZkEvmClient extends ZkEvmBridgeClient {
}

updateGlobalExitRootMap(lastMainnetExitRoot: string){
return this.globalExitRootL2.updateGlobalExitRootMap(lastMainnetExitRoot);
return this.globalExitRootL2.updateGlobalExitRootMap(lastMainnetExitRoot).then(res => {
return res;
});
}
}

0 comments on commit 3388735

Please sign in to comment.