change depositDataByID to isDepositExistById
MODIFY
.gitignore
.gitignore
node_modules
lib
+dist/
.DS_Store
*.log
dump.rdb

MODIFY
examples/node/deposit-data.js
examples/node/deposit-data.js
@@ -23,7 +23,7 @@ async function execute() {
await matic.initialize()
matic.setWallet(config.PRIVATE_KEY)
return matic.depositDataByHash('0x8cff1ef2b198273fe7f9fb41918cd7e3e8d04c58650614af39b3086e1de1a7e6')
- // return matic.depositManager.depositDataByID(101230019, '0xa2EF03edfA084ac9e5Bf110e409Ed5483BAe4101')
+ // return matic.depositManager.isDepositExistById(101230019, '0xa2EF03edfA084ac9e5Bf110e409Ed5483BAe4101')
}
async function executeRaw() {

MODIFY
src/index.ts
src/index.ts
@@ -136,7 +136,7 @@ export default class Matic extends ContractsBase {
const data = newDepositEvent.data
const depositId = new BN(data.substring(data.length - 64), 16)
- const depositExists = await this.depositManager.depositDataByID(depositId, this.childChainAddress[0])
+ const depositExists = await this.depositManager.isDepositExistById(depositId, this.childChainAddress[0])
if (!depositExists) {
throw new Error('Deposit is not processed on Matic chain')
}

MODIFY
src/root/DepositManager.ts
src/root/DepositManager.ts
@@ -20,7 +20,7 @@ export default class DepositManager extends ContractsBase {
)
}
- async depositDataByID(depositId: BN, childChainAddress: address) {
+ async isDepositExistById(depositId: BN, childChainAddress: address) {
const childChainContract = new this.web3Client.web3.eth.Contract(ChildChainArtifact.abi, childChainAddress)
return childChainContract.methods.deposits(this.encode(depositId)).call()
}

change depositDataByID to isDepositExistById