Skip to content

Commit

Permalink
feat(iota-json-rpc-tests): enable timelocked stake tests (#2053)
Browse files Browse the repository at this point in the history
* feat(iota-json-rpc-tests): enable timelocked stake tests

* Remove outdated comments

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
Thoralf-M and thibault-martinez authored Aug 28, 2024
1 parent 1b77bba commit a3ea275
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions crates/iota-json-rpc-tests/tests/rpc_server_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,6 @@ async fn test_staking_multiple_coins() -> Result<(), anyhow::Error> {
Ok(())
}

// Need to be enable when the Stardust package is integrated in the system
// packages list.
#[ignore]
#[sim_test]
async fn test_timelocked_staking() -> Result<(), anyhow::Error> {
// Create a cluster
Expand Down Expand Up @@ -1038,8 +1035,12 @@ async fn test_timelocked_staking() -> Result<(), anyhow::Error> {
.await?;
assert_eq!(2, objects.data.len());

let coin = objects.data[0].object()?.object_id;
let timelocked_balance = objects.data[1].object()?.object_id;
let (coin, timelock): (Vec<_>, Vec<_>) = objects
.data
.into_iter()
.partition(|o| o.data.as_ref().unwrap().is_gas_coin());
let coin = coin[0].object()?.object_id;
let timelocked_balance = timelock[0].object()?.object_id;

// Check TimelockedStakedIota object before test
let staked_iota: Vec<DelegatedTimelockedStake> =
Expand Down Expand Up @@ -1124,9 +1125,6 @@ async fn test_timelocked_staking() -> Result<(), anyhow::Error> {
Ok(())
}

// Ignored because there is a problem with the StakeStatus::Unstaked state.
// The same behavior reproduces in the original test_unstaking test.
#[ignore]
#[sim_test]
async fn test_timelocked_unstaking() -> Result<(), anyhow::Error> {
// Create a cluster
Expand Down Expand Up @@ -1190,8 +1188,12 @@ async fn test_timelocked_unstaking() -> Result<(), anyhow::Error> {
.await?;
assert_eq!(2, objects.data.len());

let coin = objects.data[0].object()?.object_id;
let timelocked_balance = objects.data[1].object()?.object_id;
let (coin, timelock): (Vec<_>, Vec<_>) = objects
.data
.into_iter()
.partition(|o| o.data.as_ref().unwrap().is_gas_coin());
let coin = coin[0].object()?.object_id;
let timelocked_balance = timelock[0].object()?.object_id;

// Check TimelockedStakedIota object before test
let staked_iota: Vec<DelegatedTimelockedStake> =
Expand Down

0 comments on commit a3ea275

Please sign in to comment.