Skip to content

Commit

Permalink
chore: use same amount value
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongsu-hong committed May 5, 2023
1 parent e193eae commit 2f8264b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ts/deployer/src/testnet/5_mint-burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,27 @@ async function main() {

const { index_denom } = await client.core.getConfig({});

const amount = 100 * 1e6;

const { units } = await client.core.getPortfolio({});
const funds = units
.map(([denom, unit]) => ({
denom,
amount: `${Math.ceil(Number(unit) * 1e6)}`,
amount: `${Math.ceil(Number(unit) * amount)}`,
}))
.sort((a, b) => (a.denom < b.denom ? -1 : 1));

const mintResp = await client.core.mint(
{ amount: `${1e6}` },
{ amount: `${amount}` },
"auto",
undefined,
funds
);
console.log({ action: "mint", txHash: mintResp.transactionHash });

await checkBalance(client.q, sender, index_denom, `${1e6}`, "mint");
await checkBalance(client.q, sender, index_denom, `${amount}`, "mint");

const burnAmount = [{ denom: index_denom, amount: `${1e6}` }];
const burnAmount = [{ denom: index_denom, amount: `${amount}` }];
const burnResp = await client.core.burn({}, "auto", undefined, burnAmount);
console.log({ action: "burn", txHash: burnResp.transactionHash });

Expand Down

0 comments on commit 2f8264b

Please sign in to comment.