Skip to content

Commit 11983c7

Browse files
committed
refactor(transactional-test-runner): use new system-state summary type
1 parent 7687dec commit 11983c7

File tree

1 file changed

+10
-3
lines changed
  • crates/iota-transactional-test-runner/src

1 file changed

+10
-3
lines changed

crates/iota-transactional-test-runner/src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use iota_types::{
2929
executable_transaction::{ExecutableTransaction, VerifiedExecutableTransaction},
3030
iota_system_state::{
3131
IotaSystemStateTrait, epoch_start_iota_system_state::EpochStartSystemStateTrait,
32+
iota_system_state_summary::IotaSystemStateSummary,
3233
},
3334
messages_checkpoint::{CheckpointContentsDigest, VerifiedCheckpoint},
3435
object::Object,
@@ -228,7 +229,7 @@ impl TransactionalAdapter for ValidatorWithFullnode {
228229
}
229230

230231
async fn get_active_validator_addresses(&self) -> IotaResult<Vec<IotaAddress>> {
231-
Ok(self
232+
let system_state_summary = self
232233
.fullnode
233234
.get_system_state()
234235
.map_err(|e| {
@@ -237,8 +238,14 @@ impl TransactionalAdapter for ValidatorWithFullnode {
237238
e
238239
))
239240
})?
240-
.into_iota_system_state_summary()
241-
.active_validators
241+
.into_iota_system_state_summary();
242+
let active_validators = match system_state_summary {
243+
IotaSystemStateSummary::V1(inner) => inner.active_validators,
244+
IotaSystemStateSummary::V2(inner) => inner.active_validators,
245+
_ => unimplemented!(),
246+
};
247+
248+
Ok(active_validators
242249
.iter()
243250
.map(|x| x.iota_address)
244251
.collect::<Vec<_>>())

0 commit comments

Comments
 (0)