mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-08-25 14:51:14 +00:00
fix: fixes and retrieval methods
This commit is contained in:
@@ -103,7 +103,14 @@ impl NodeCore {
|
||||
|
||||
let genesis_block = client.get_block(genesis_id.genesis_id).await?.block;
|
||||
|
||||
let initial_accounts_ser = client.get_initial_testnet_accounts().await?;
|
||||
let initial_accounts: Vec<Account> =
|
||||
initial_accounts_ser.into_iter().map(Into::into).collect();
|
||||
|
||||
let (mut storage, mut chain_height) = NodeChainStore::new(config.clone(), genesis_block)?;
|
||||
for acc in initial_accounts {
|
||||
storage.acc_map.insert(acc.address, acc);
|
||||
}
|
||||
|
||||
pre_start::setup_empty_sc_states(&storage).await?;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use accounts::account_core::Account;
|
||||
use accounts::account_core::{Account, AccountForSerialization};
|
||||
use anyhow::Result;
|
||||
use common::rpc_primitives::requests::{
|
||||
GetBlockDataRequest, GetBlockDataResponse, GetGenesisIdRequest, GetGenesisIdResponse,
|
||||
RegisterAccountRequest, RegisterAccountResponse,
|
||||
GetInitialTestnetAccountsRequest, RegisterAccountRequest, RegisterAccountResponse,
|
||||
};
|
||||
use common::transaction::Transaction;
|
||||
use common::{SequencerClientError, SequencerRpcError};
|
||||
@@ -121,4 +121,21 @@ impl SequencerClient {
|
||||
|
||||
Ok(resp_deser)
|
||||
}
|
||||
|
||||
pub async fn get_initial_testnet_accounts(
|
||||
&self,
|
||||
) -> Result<Vec<AccountForSerialization>, SequencerClientError> {
|
||||
let acc_req = GetInitialTestnetAccountsRequest {};
|
||||
|
||||
let req = serde_json::to_value(acc_req).unwrap();
|
||||
|
||||
let resp = self
|
||||
.call_method_with_payload("get_initial_testnet_accounts", req)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let resp_deser = serde_json::from_value(resp).unwrap();
|
||||
|
||||
Ok(resp_deser)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user