Skip to content

Commit 697fbd8

Browse files
committed
pending spaces tests
1 parent 6a7ff94 commit 697fbd8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

client/tests/integration_tests.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ async fn it_should_open_a_space_for_auction(rig: &TestRig) -> anyhow::Result<()>
4444
assert!(tx_res.error.is_none(), "expect no errors for simple open");
4545
}
4646
assert_eq!(response.result.len(), 2, "must be 2 transactions");
47+
let alices_spaces = rig.spaced.client.wallet_list_spaces(ALICE).await?;
48+
assert!(alices_spaces.pending.first().is_some_and(|s| s.to_string() == TEST_SPACE), "must be a pending space");
4749

4850
rig.mine_blocks(1, None).await?;
4951
rig.wait_until_synced().await?;
52+
let alices_spaces = rig.spaced.client.wallet_list_spaces(ALICE).await?;
53+
assert!(alices_spaces.pending.is_empty(), "must have no pending spaces");
5054

5155
let fullspaceout = rig.spaced.client.get_space(TEST_SPACE).await?;
5256
let fullspaceout = fullspaceout.expect("a fullspace out");
@@ -96,8 +100,11 @@ async fn it_should_allow_outbidding(rig: &TestRig) -> anyhow::Result<()> {
96100
.expect("send request");
97101

98102
println!("{}", serde_json::to_string_pretty(&result).unwrap());
99-
rig.mine_blocks(1, None).await?;
100103

104+
let bob_spaces_updated = rig.spaced.client.wallet_list_spaces(BOB).await?;
105+
assert!(bob_spaces_updated.pending.first().is_some_and(|s| s.to_string() == TEST_SPACE), "must be a pending space");
106+
107+
rig.mine_blocks(1, None).await?;
101108
rig.wait_until_synced().await?;
102109
rig.wait_until_wallet_synced(BOB).await?;
103110
rig.wait_until_wallet_synced(ALICE).await?;
@@ -125,6 +132,7 @@ async fn it_should_allow_outbidding(rig: &TestRig) -> anyhow::Result<()> {
125132
alices_balance.balance + Amount::from_sat(TEST_INITIAL_BID + 662),
126133
"alice must be refunded this exact amount"
127134
);
135+
assert!(bob_spaces_updated.pending.is_empty(), "must have no pending spaces");
128136

129137
let fullspaceout = rig.spaced.client.get_space(TEST_SPACE).await?;
130138
let fullspaceout = fullspaceout.expect("a fullspace out");

0 commit comments

Comments
 (0)