Skip to content

Commit

Permalink
Do not use sudoSigner.address in tests to avoid confusion
Browse files Browse the repository at this point in the history
for burn()/burnAll() the last parameter, `collector`, is who can collect
on the Creditcoin3 side whose value doesn't really matter as part of the
integration test suite on the Creditcoin 2 side.

Replace with the address of the wallet signing the transactions to avoid
confusion over the use of variable called `sudoSigner`. In this scenario
we're assuming the same address exists both on CC2 and CC3!
  • Loading branch information
atodorov committed Dec 11, 2023
1 parent 0486492 commit 4141072
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions integration-tests/src/test/burn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describeIf((global as any).CREDITCOIN_EXECUTE_SETUP_AUTHORITY, 'burn', () => {

expect(starting.freeBalance.isZero()).toBe(false);

await api.tx.creditcoin.burnAll(sudoSigner.address).signAndSend(wallet);
await api.tx.creditcoin.burnAll(wallet.address).signAndSend(wallet);
await forElapsedBlocks(api);

const ending = await api.derive.balances.all(wallet.address);
Expand All @@ -59,7 +59,7 @@ describeIf((global as any).CREDITCOIN_EXECUTE_SETUP_AUTHORITY, 'burn', () => {
const starting = await api.derive.balances.all(burner.address);
expect(starting.freeBalance.isZero()).toBe(false);

await api.tx.creditcoin.burn(BURN_AMOUNT, sudoSigner.address).signAndSend(burner);
await api.tx.creditcoin.burn(BURN_AMOUNT, burner.address).signAndSend(burner);
await forElapsedBlocks(api);

const ending = await api.derive.balances.all(burner.address);
Expand All @@ -78,7 +78,7 @@ describeIf((global as any).CREDITCOIN_EXECUTE_SETUP_AUTHORITY, 'burn', () => {

return new Promise((resolve, reject): void => {
const unsubscribe = api.tx.creditcoin
.burnAll(sudoSigner.address)
.burnAll(burner.address)
.signAndSend(burner, { nonce: -1 }, async ({ dispatchError, events, status }) => {
await extractFee(resolve, reject, unsubscribe, api, dispatchError, events, status);
})
Expand Down

0 comments on commit 4141072

Please sign in to comment.