Skip to content

Commit 7f45a57

Browse files
committed
script fix
1 parent 2ae824a commit 7f45a57

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cli.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const chainId = env.WAVES_CHAINID;
3737

3838

3939
const dAppPk = env.DAPP;
40-
const dApp = address(dAppPk, chainId);
40+
const dApp = address({publicKey:dAppPk}, chainId);
4141

4242
const fee = 900000;
4343

@@ -180,6 +180,11 @@ async function transfer(in_utxo, out_utxo, db) {
180180

181181
}
182182

183+
async function messageNum() {
184+
const req = await nodeInteraction.accountDataByKey('MESSAGE_NUM', dApp, rpc);
185+
if (req) return req.value; else return 0;
186+
}
187+
183188
async function syncData() {
184189
const privkey = babyJubJub.privkey(seed);
185190
const pubkey = babyJubJub.pubkey(seed)[0];
@@ -190,7 +195,7 @@ async function syncData() {
190195
const push_asset = o => {db.assets[o.nullifier] = o };
191196

192197

193-
const message_num = (await nodeInteraction.accountDataByKey('MESSAGE_NUM', dApp, rpc)).value;
198+
const message_num = await messageNum();
194199

195200
if(message_num===db.MESSAGE_NUM)
196201
return db;

0 commit comments

Comments
 (0)