mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-10 15:59:32 +00:00
fix: solve merging conflicts with main
This commit is contained in:
parent
571f35b384
commit
ae0705995f
@ -9,7 +9,7 @@ use std::time::Duration;
|
|||||||
use anyhow::{Context as _, Result};
|
use anyhow::{Context as _, Result};
|
||||||
use integration_tests::{
|
use integration_tests::{
|
||||||
TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, account_balance, new_account, private_mention,
|
TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, account_balance, new_account, private_mention,
|
||||||
public_mention, sync_private, verify_commitment_is_in_state,
|
public_mention, sync_private, verify_commitment_is_in_state, wait_for_indexer_to_catch_up,
|
||||||
};
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
use tokio::test;
|
use tokio::test;
|
||||||
@ -115,6 +115,41 @@ async fn claim_pinata_to_existing_public_account() -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
async fn claim_pinata_indexer_keeps_up() -> Result<()> {
|
||||||
|
let mut ctx = TestContext::new().await?;
|
||||||
|
|
||||||
|
let command = Command::Pinata(PinataProgramAgnosticSubcommand::Claim {
|
||||||
|
to: public_mention(ctx.existing_public_accounts()[0]),
|
||||||
|
});
|
||||||
|
|
||||||
|
wallet::cli::execute_subcommand(ctx.wallet_mut(), command).await?;
|
||||||
|
|
||||||
|
info!("Waiting for next block creation");
|
||||||
|
tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await;
|
||||||
|
|
||||||
|
info!("Waiting for indexer to parse blocks");
|
||||||
|
wait_for_indexer_to_catch_up(&ctx).await?;
|
||||||
|
|
||||||
|
let winner_ind_state = indexer_service_rpc::RpcClient::get_account(
|
||||||
|
&**ctx.indexer_client(),
|
||||||
|
ctx.existing_public_accounts()[0].into(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
let winner_seq_state = sequencer_service_rpc::RpcClient::get_account(
|
||||||
|
ctx.sequencer_client(),
|
||||||
|
ctx.existing_public_accounts()[0],
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
assert_eq!(winner_ind_state, winner_seq_state.into());
|
||||||
|
|
||||||
|
info!("Indexer correctly indexed the pinata claim");
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
async fn claim_pinata_to_existing_private_account() -> Result<()> {
|
async fn claim_pinata_to_existing_private_account() -> Result<()> {
|
||||||
let mut ctx = TestContext::new().await?;
|
let mut ctx = TestContext::new().await?;
|
||||||
|
|||||||
@ -7,6 +7,10 @@ license = { workspace = true }
|
|||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
|
testnet = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
common.workspace = true
|
common.workspace = true
|
||||||
logos-blockchain-zone-sdk.workspace = true
|
logos-blockchain-zone-sdk.workspace = true
|
||||||
|
|||||||
@ -23,7 +23,12 @@ impl IndexerStore {
|
|||||||
/// Starting database at the start of new chain.
|
/// Starting database at the start of new chain.
|
||||||
/// Creates files if necessary.
|
/// Creates files if necessary.
|
||||||
pub fn open_db(location: &Path) -> Result<Self> {
|
pub fn open_db(location: &Path) -> Result<Self> {
|
||||||
|
#[cfg(not(feature = "testnet"))]
|
||||||
let initial_state = testnet_initial_state::initial_state();
|
let initial_state = testnet_initial_state::initial_state();
|
||||||
|
|
||||||
|
#[cfg(feature = "testnet")]
|
||||||
|
let initial_state = testnet_initial_state::initial_state_testnet();
|
||||||
|
|
||||||
let dbio = RocksDBIO::open_or_create(location, &initial_state)?;
|
let dbio = RocksDBIO::open_or_create(location, &initial_state)?;
|
||||||
|
|
||||||
let current_state = dbio.final_state()?;
|
let current_state = dbio.final_state()?;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lee.workspace = true
|
lee.workspace = true
|
||||||
indexer_core.workspace = true
|
indexer_core = { workspace = true, features = ["testnet"] }
|
||||||
indexer_service_protocol = { workspace = true, features = ["convert"] }
|
indexer_service_protocol = { workspace = true, features = ["convert"] }
|
||||||
|
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
|
|||||||
@ -10,7 +10,7 @@ workspace = true
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
indexer_service_protocol = { workspace = true, features = ["convert"] }
|
indexer_service_protocol = { workspace = true, features = ["convert"] }
|
||||||
indexer_service_rpc = { workspace = true, features = ["server"] }
|
indexer_service_rpc = { workspace = true, features = ["server"] }
|
||||||
indexer_core.workspace = true
|
indexer_core = { workspace = true, features = ["testnet"] }
|
||||||
|
|
||||||
clap = { workspace = true, features = ["derive"] }
|
clap = { workspace = true, features = ["derive"] }
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user