Skip to content

Commit

Permalink
Second bond
Browse files Browse the repository at this point in the history
  • Loading branch information
faust403 committed Dec 11, 2024
1 parent 1ec26de commit 6a30bf6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions integration_tests/src/testcases/lazy-staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,31 @@ describe('Lazy Staking', () => {
const { amount } = await client.getBalance(account.address, ldntrnDenom);
expect(amount).toEqual('10000000');
});

it('Exchange rate now 10', async () => {
const { coreContractClient, account } = context;
await coreContractClient.updateExchangeRate(account.address, {
exchange_rate: '10',
});
expect(await coreContractClient.queryExchangeRate()).toEqual('10');
});

it("If we have 10 ldNTRN, they're now equal to 1 dNTRN (because 1 dNTRN equals 10 NTRN)", async () => {
const { lazyStakingClient } = context;
const rewards = await lazyStakingClient.queryRewards();
expect(rewards).toEqual('9000000');
});

it('Send 100 dNTRN more and get 1000 ldNTRN back (because 1000 ldNTRN = 100 (dNTRN) * 10 (core_exchange_rate))', async () => {
const { lazyStakingClient, client, account, dntrnDenom, ldntrnDenom } =
context;
await lazyStakingClient.bond(account.address, undefined, undefined, [
{
denom: dntrnDenom,
amount: '100000000',
},
]);
const { amount } = await client.getBalance(account.address, ldntrnDenom);
expect(amount).toEqual('1010000000');
});
});

0 comments on commit 6a30bf6

Please sign in to comment.