mirror of
https://github.com/zhigang1992/liquid-stacking.git
synced 2026-01-12 17:23:23 +08:00
chore: add tests for events
This commit is contained in:
@@ -30,9 +30,8 @@ are in the form `(err uint)` and they are unique across all contracts.
|
||||
### Error table
|
||||
|
||||
<!--errors-->
|
||||
|
||||
| Contract | Constant | Value | Description |
|
||||
| ----------------------------- | -------------------------------- | ----------- | ----------- |
|
||||
|-------------------------------|----------------------------------|-------------|-------------|
|
||||
| lisa-dao | err-unauthorised | (err u1000) | |
|
||||
| lqstx-mint-endpoint | err-unauthorised | (err u1000) | |
|
||||
| lqstx-mint-endpoint-v1-01 | err-unauthorised | (err u1000) | |
|
||||
@@ -132,7 +131,6 @@ are in the form `(err uint)` and they are unique across all contracts.
|
||||
| token-vesting | err-event-not-vested | (err u9002) | |
|
||||
| token-vesting | err-event-already-claimed | (err u9003) | |
|
||||
| token-vesting | err-recipient-exists | (err u9004) | |
|
||||
|
||||
<!--errors-->
|
||||
|
||||
## References
|
||||
|
||||
@@ -250,7 +250,6 @@ describe(contracts.endpoint, () => {
|
||||
]);
|
||||
expect(responses[0].result).toBeErr(Cl.uint(7006)); // request pending
|
||||
expect(responses[1].result).toBeErr(Cl.uint(3000)); // not authorized
|
||||
responses[2].events.map((e: any) => console.log(e));
|
||||
expect(responses[2].result).toBeOk(Cl.uint(mintAmount)); // mintAmount stx transferred, mintAmount - 1 stx locked
|
||||
|
||||
const stxAccountFastPoolMember1 = simnet.runSnippet(
|
||||
|
||||
@@ -254,10 +254,13 @@ describe(contracts.endpoint, () => {
|
||||
simnet.mineEmptyBlocks(mintDelay);
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'finalize-mint', [Cl.uint(1)], bot);
|
||||
expect(response.result).toBeOk(Cl.bool(true));
|
||||
expect(response.events[2].event).toBe('nft_burn_event');
|
||||
response = simnet.callPublicFn(contracts.rebase1, 'request-burn', [Cl.uint(100e6)], user);
|
||||
expect(response.result).toBeOk(
|
||||
Cl.tuple({ 'request-id': Cl.uint(1), status: Cl.buffer(new Uint8Array([1])) })
|
||||
);
|
||||
expect(response.events[7].event).toBe('nft_mint_event');
|
||||
expect(response.events[17].event).toBe('nft_burn_event');
|
||||
});
|
||||
|
||||
it('can interact with strategies', () => {
|
||||
@@ -395,7 +398,6 @@ describe(contracts.endpoint, () => {
|
||||
expect(getRequestCycle()).toBe(2n);
|
||||
|
||||
const response = requestMint();
|
||||
console.log(response.events[1].data);
|
||||
expect(response.result).toBeOk(Cl.uint(1));
|
||||
expect(response.events[0].event).toBe('stx_transfer_event');
|
||||
expect(response.events[1].event).toBe('nft_mint_event');
|
||||
|
||||
Reference in New Issue
Block a user