Skip to content

Commit

Permalink
release lightnet accounts upon completion
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Aug 2, 2024
1 parent 6a00445 commit aab8760
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/examples/zkapps/reducer/run-live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Mina.setActiveInstance(network);

let { keys, addresses } = randomAccounts('contract', 'user1', 'user2');

let tx, pendingTx: Mina.PendingTransaction, balances, oldBalances;
let pendingTx: Mina.PendingTransaction;

// compile contracts & wait for fee payer to be funded
const senderKey = useCustomLocalNetwork
Expand Down Expand Up @@ -61,7 +61,6 @@ pendingTx = await deployTx.sign([senderKey, keys.contract]).send();

await pendingTx.wait();
toc();
console.log('working so far');
// push some actions

tic('dispatch transactions');
Expand Down Expand Up @@ -141,3 +140,16 @@ toc();

// ----
toc();

console.log('Success!');

// Tear down
const keyPairReleaseMessage = await Lightnet.releaseKeyPair({
publicKey: sender.toBase58(),
});
if (keyPairReleaseMessage) console.info(keyPairReleaseMessage);

const keyPairReleaseMessage2 = await Lightnet.releaseKeyPair({
publicKey: sender2.toBase58(),
});
if (keyPairReleaseMessage2) console.info(keyPairReleaseMessage2);

0 comments on commit aab8760

Please sign in to comment.