Skip to content

Commit eda81d2

Browse files
Merge pull request #1 from friedger/feat/tests
improves the test to reflect that any user can create a lobby, but only the contract owner can disable it
2 parents 36451f9 + 31c6411 commit eda81d2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/trustless-rewards_test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarine
22
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
33

44
Clarinet.test({
5-
name: 'Ensure that owner can create a lobby',
5+
name: 'Ensure that user can create a lobby',
66
async fn(chain: Chain, accounts: Map<string, Account>) {
77
const deployer = accounts.get('deployer')!;
88
const wallet_1 = accounts.get('wallet_1')!;
@@ -23,7 +23,7 @@ Clarinet.test({
2323
types.ascii(`straight`), // curves
2424
types.uint(24), // hours
2525
],
26-
deployer.address
26+
wallet_1.address
2727
),
2828
]);
2929
// console.log(`block `, block);
@@ -39,13 +39,13 @@ Clarinet.test({
3939
);
4040
assertEquals(
4141
tx.result,
42-
'(ok {active: true, balance: u5, commission: u5, curves: "straight", description: "lobby description", factor: u5, hours: u24, length: "long", mapy: "miamiBeach", owner: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM, price: u5, traffic: "intense"})'
42+
'(ok {active: true, balance: u5, commission: u5, curves: "straight", description: "lobby description", factor: u5, hours: u24, length: "long", mapy: "miamiBeach", owner: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5, price: u5, traffic: "intense"})'
4343
);
4444
},
4545
});
4646

4747
Clarinet.test({
48-
name: 'Ensure that owner can create a lobby and disable it, users can not join after disabled',
48+
name: 'Ensure that user can create a lobby and owner can disable it, users can not join after disabled',
4949
async fn(chain: Chain, accounts: Map<string, Account>) {
5050
const deployer = accounts.get('deployer')!;
5151
const wallet_1 = accounts.get('wallet_1')!;
@@ -66,7 +66,7 @@ Clarinet.test({
6666
types.ascii(`straight`), // curves
6767
types.uint(24), // hours
6868
],
69-
deployer.address
69+
wallet_1.address
7070
),
7171
]);
7272
// console.log(`block `, block);
@@ -82,7 +82,7 @@ Clarinet.test({
8282
);
8383
assertEquals(
8484
tx.result,
85-
'(ok {active: true, balance: u5, commission: u5, curves: "straight", description: "lobby description", factor: u5, hours: u24, length: "long", mapy: "miamiBeach", owner: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM, price: u5, traffic: "intense"})'
85+
'(ok {active: true, balance: u5, commission: u5, curves: "straight", description: "lobby description", factor: u5, hours: u24, length: "long", mapy: "miamiBeach", owner: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5, price: u5, traffic: "intense"})'
8686
);
8787

8888
let block2 = chain.mineBlock([

0 commit comments

Comments
 (0)