Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules: export all public types from query module in lib.rs. #847

Merged
merged 11 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/demo-nft-module/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod genesis;
#[cfg(feature = "native")]
mod query;
#[cfg(feature = "native")]
pub use query::{NonFungibleTokenRpcImpl, NonFungibleTokenRpcServer, OwnerResponse};
pub use query::*;
use sov_modules_api::{CallResponse, Context, Error, Module, ModuleInfo};
use sov_state::WorkingSet;

Expand Down
98 changes: 25 additions & 73 deletions examples/demo-prover/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions examples/demo-prover/methods/guest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/demo-rollup/tests/bank/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async fn send_test_create_token_tx(rpc_address: SocketAddr) -> Result<(), anyhow
// Wait until the rollup has processed the next slot
let _ = slot_processed_subscription.next().await;

let balance_response = sov_bank::query::BankRpcClient::<DefaultContext>::balance_of(
let balance_response = sov_bank::BankRpcClient::<DefaultContext>::balance_of(
client.http(),
user_address,
token_address,
Expand Down
17 changes: 4 additions & 13 deletions examples/demo-stf/src/runtime.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#[cfg(feature = "native")]
use sov_accounts::query::{AccountsRpcImpl, AccountsRpcServer};
use sov_accounts::{AccountsRpcImpl, AccountsRpcServer};
#[cfg(feature = "native")]
use sov_bank::query::{BankRpcImpl, BankRpcServer};
use sov_bank::{BankRpcImpl, BankRpcServer};
#[cfg(feature = "native")]
use sov_blob_storage::{BlobStorageRpcImpl, BlobStorageRpcServer};
#[cfg(feature = "native")]
use sov_chain_state::{ChainStateRpcImpl, ChainStateRpcServer};
#[cfg(feature = "native")]
#[cfg(feature = "experimental")]
use sov_evm::query::{EvmRpcImpl, EvmRpcServer};
use sov_evm::{EvmRpcImpl, EvmRpcServer};
use sov_modules_api::capabilities::{BlobRefOrOwned, BlobSelector};
#[cfg(feature = "native")]
pub use sov_modules_api::default_context::DefaultContext;
Expand All @@ -20,16 +20,7 @@ use sov_rollup_interface::da::DaSpec;
#[cfg(feature = "native")]
use sov_sequencer_registry::{SequencerRegistryRpcImpl, SequencerRegistryRpcServer};
#[cfg(feature = "native")]
use sov_value_setter::query::{ValueSetterRpcImpl, ValueSetterRpcServer};

#[cfg(feature = "native")]
pub mod query {
pub use sov_accounts::query as accounts;
pub use sov_bank::query as bank;
pub use sov_chain_state::query as chain_state;
pub use sov_sequencer_registry::query as sequencer_registry;
pub use sov_value_setter::query as value_setter;
}
use sov_value_setter::{ValueSetterRpcImpl, ValueSetterRpcServer};

/// The Rollup entrypoint.
///
Expand Down
21 changes: 6 additions & 15 deletions examples/demo-stf/src/tests/stf_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,11 @@ pub mod test {
.bank
.supply_of(get_default_token_address(), &mut working_set)
.unwrap();
assert_eq!(
resp,
sov_bank::query::TotalSupplyResponse { amount: Some(1000) }
);
assert_eq!(resp, sov_bank::TotalSupplyResponse { amount: Some(1000) });

let resp = runtime.value_setter.query_value(&mut working_set).unwrap();

assert_eq!(resp, sov_value_setter::query::Response { value: Some(33) });
assert_eq!(resp, sov_value_setter::Response { value: Some(33) });
}
}

Expand Down Expand Up @@ -119,14 +116,11 @@ pub mod test {
.bank
.supply_of(get_default_token_address(), &mut working_set)
.unwrap();
assert_eq!(
resp,
sov_bank::query::TotalSupplyResponse { amount: Some(1000) }
);
assert_eq!(resp, sov_bank::TotalSupplyResponse { amount: Some(1000) });

let resp = runtime.value_setter.query_value(&mut working_set).unwrap();

assert_eq!(resp, sov_value_setter::query::Response { value: Some(33) });
assert_eq!(resp, sov_value_setter::Response { value: Some(33) });
}

#[test]
Expand Down Expand Up @@ -174,14 +168,11 @@ pub mod test {
.bank
.supply_of(get_default_token_address(), &mut working_set)
.unwrap();
assert_eq!(
resp,
sov_bank::query::TotalSupplyResponse { amount: Some(1000) }
);
assert_eq!(resp, sov_bank::TotalSupplyResponse { amount: Some(1000) });

let resp = runtime.value_setter.query_value(&mut working_set).unwrap();

assert_eq!(resp, sov_value_setter::query::Response { value: None });
assert_eq!(resp, sov_value_setter::Response { value: None });
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/demo-stf/src/tests/tx_revert_tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use sov_accounts::query::Response;
use sov_accounts::Response;
use sov_data_generators::bank_data::{get_default_private_key, get_default_token_address};
use sov_data_generators::{has_tx_events, new_test_blob_from_batch};
use sov_modules_api::default_context::DefaultContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#![doc = include_str!("../README.md")]

#[cfg(feature = "native")]
pub mod query;
mod query;

#[cfg(feature = "native")]
pub use query::*;
use sov_modules_api::{CallResponse, Context, Error, Module, ModuleInfo};
use sov_state::{AccessoryStateValue, StateValue, WorkingSet};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ mod genesis;
mod tests;

#[cfg(feature = "native")]
pub mod query;
mod query;

pub use call::CallMessage;
#[cfg(feature = "native")]
pub use query::*;
use sov_modules_api::{Error, ModuleInfo};
use sov_state::WorkingSet;

Expand Down
Loading