Skip to content

Commit 2764883

Browse files
committed
contract(bank): added logs, and fixed denom usage
1 parent 8fc22f0 commit 2764883

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/hyperweb/src/bank/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default class Contract {
55
constructor() { }
66

77
balance({ address, denom }: { address: string; denom: string }): string {
8+
console.log("checking balance for address:", address, "denom:", denom);
89
return getBalance(address, denom).amount.toString();
910
}
1011

@@ -14,7 +15,8 @@ export default class Contract {
1415
amount: number;
1516
denom: string
1617
}): string {
17-
sendCoins(from, to, { [denom]: amount });
18+
console.log("transferring", amount, "of", denom, "from", from, "to", to);
19+
sendCoins(from, to, `${amount}${denom}`);
1820
return "Transfer successful";
1921
}
2022
}

0 commit comments

Comments
 (0)