Skip to content

Commit cb76ed5

Browse files
committed
chore: fix account address iterators.
1 parent b439bfa commit cb76ed5

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

checks/migrator/citeria/accounts-equal/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@ impl Criterionish for AccountsEqual {
3030
.await
3131
.map_err(|e| CriterionError::Internal(e.into()))?;
3232

33-
for account_address in movement_migrator
34-
.iter_accounts()
33+
let movement_node =
34+
movement_migrator.node().await.map_err(|e| CriterionError::Internal(e.into()))?;
35+
36+
for account_address in movement_node
37+
.iter_account_addresses(0)
3538
.map_err(|e| CriterionError::Internal(e.into()))?
3639
{
40+
let account_address =
41+
account_address.map_err(|e| CriterionError::Internal(e.into()))?;
42+
3743
let movement_resource = movement_rest_client
3844
.get_account_bcs(account_address)
3945
.await

migration/util/migrator-types/src/migrator/movement_migrator.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub use maptos_opt_executor::aptos_types::{chain_id::ChainId, state_store::TStat
55
use movement_client::rest_client::Client as MovementRestClient;
66
use movement_core::Movement;
77
use mtma_node_types::executor::MovementNode;
8-
use mtma_node_types::executor::movement_executor::maptos_opt_executor::aptos_types::account_address::AccountAddress;
98

109
/// An enum supporting different types of runners.
1110
///
@@ -85,9 +84,4 @@ impl MovementMigrator {
8584
}
8685
}
8786
}
88-
89-
/// Iterates over all accounts in the movement node.
90-
pub fn iter_accounts(&self) -> Result<impl Iterator<Item = AccountAddress>, anyhow::Error> {
91-
Ok(vec![].into_iter())
92-
}
9387
}

migration/util/node-types/src/executor/movement_executor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ impl MovementNode {
117117

118118
/// Iterates over all account keys
119119
/// NOTE: does this by checking all transactions and getting the [AccountAddress] signers from them
120-
pub fn iter_account_keys(
120+
pub fn iter_account_addresses(
121121
&self,
122122
start_version: u64,
123-
) -> Result<AccountKeyIterator<'_>, anyhow::Error> {
124-
Ok(AccountKeyIterator::new(self, start_version))
123+
) -> Result<AccountAddressIterator<'_>, anyhow::Error> {
124+
Ok(AccountAddressIterator::new(self, start_version))
125125
}
126126
}
127127

@@ -258,14 +258,14 @@ impl<'a> Iterator for TransactionIterator<'a> {
258258
}
259259
}
260260

261-
pub struct AccountKeyIterator<'a> {
261+
pub struct AccountAddressIterator<'a> {
262262
executor: &'a MovementNode,
263263
version: u64,
264264
latest_version: u64,
265265
current_tx_iter: Option<Box<dyn Iterator<Item = Result<AccountAddress, anyhow::Error>> + 'a>>,
266266
}
267267

268-
impl<'a> AccountKeyIterator<'a> {
268+
impl<'a> AccountAddressIterator<'a> {
269269
fn new(executor: &'a MovementNode, start_version: u64) -> Self {
270270
Self {
271271
executor,
@@ -323,7 +323,7 @@ impl<'a> AccountKeyIterator<'a> {
323323
}
324324
}
325325

326-
impl<'a> Iterator for AccountKeyIterator<'a> {
326+
impl<'a> Iterator for AccountAddressIterator<'a> {
327327
type Item = Result<AccountAddress, anyhow::Error>;
328328

329329
fn next(&mut self) -> Option<Self::Item> {

0 commit comments

Comments
 (0)