Skip to content

Commit

Permalink
fixup! Merge branch 'bat/generic-io' (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed Sep 25, 2023
1 parent 5f0d542 commit a02037e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions apps/src/lib/cli/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use borsh::BorshSerialize;
use color_eyre::eyre::Result;
use itertools::sorted;
use masp_primitives::zip32::ExtendedFullViewingKey;
use namada::ledger::masp::find_valid_diversifier;
use namada::ledger::wallet::{DecryptionError, FindKeyError};
use namada::sdk::masp::find_valid_diversifier;
use namada::sdk::wallet::{DecryptionError, FindKeyError};
use namada::types::io::Io;
use namada::types::key::*;
use namada::types::masp::{MaspValue, PaymentAddress};
Expand Down
14 changes: 7 additions & 7 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use namada::types::key::*;
use namada::types::masp::{BalanceOwner, ExtendedViewingKey, PaymentAddress};
use namada::types::storage::{BlockHeight, BlockResults, Epoch, Key, KeySeg};
use namada::types::token::{Change, MaspDenom};
use namada::types::{error, storage, token};
use namada::types::{ storage, token};
use namada::{display, display_line, edisplay_line};
use tokio::time::Instant;

Expand All @@ -74,7 +74,7 @@ pub async fn query_tx_status<
status: namada::sdk::rpc::TxEventQuery<'_>,
deadline: Instant,
) -> Event {
namada::ledger::rpc::query_tx_status::<_, IO>(client, status, deadline)
rpc::query_tx_status::<_, IO>(client, status, deadline)
.await
.proceed()
}
Expand All @@ -86,7 +86,7 @@ pub async fn query_and_print_epoch<
>(
client: &C,
) -> Epoch {
let epoch = namada::ledger::rpc::query_epoch(client).await.unwrap();
let epoch = rpc::query_epoch(client).await.unwrap();
display_line!(IO, "Last committed epoch: {}", epoch);
epoch
}
Expand Down Expand Up @@ -2045,7 +2045,7 @@ where
display_line!(
IO,
"Dry-run result: {}",
namada::ledger::rpc::dry_run_tx::<_, IO>(client, tx_bytes).await?
rpc::dry_run_tx::<_, IO>(client, tx_bytes).await?
);
Ok(())
}
Expand All @@ -2056,7 +2056,7 @@ pub async fn get_public_key<C: namada::ledger::queries::Client + Sync>(
address: &Address,
index: u8,
) -> Result<Option<common::PublicKey>, error::Error> {
namada::sdk::rpc::get_public_key_at(client, address, index).await
rpc::get_public_key_at(client, address, index).await
}

/// Check if the given address is a known validator.
Expand Down Expand Up @@ -2195,7 +2195,7 @@ pub async fn query_wasm_code_hash<
client: &C,
code_path: impl AsRef<str>,
) -> Result<Hash, error::Error> {
namada::ledger::rpc::query_wasm_code_hash::<_, IO>(client, code_path).await
rpc::query_wasm_code_hash::<_, IO>(client, code_path).await
}

/// Query a storage value and decode it with [`BorshDeserialize`].
Expand Down Expand Up @@ -2237,7 +2237,7 @@ pub async fn query_storage_prefix<
where
T: BorshDeserialize,
{
namada::ledger::rpc::query_storage_prefix::<_, IO, _>(client, key)
rpc::query_storage_prefix::<_, IO, _>(client, key)
.await
.unwrap()
}
Expand Down
1 change: 0 additions & 1 deletion apps/src/lib/client/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use namada::sdk::{error, masp, signing, tx};
use namada::tendermint_rpc::HttpClient;
use namada::types::address::{Address, ImplicitAddress};
use namada::types::dec::Dec;
use namada::types::error;
use namada::types::io::Io;
use namada::types::key::{self, *};
use namada::types::transaction::pos::InitValidator;
Expand Down
2 changes: 1 addition & 1 deletion shared/src/sdk/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use crate::types::hash::Hash;
use crate::types::io::Io;
use crate::types::key::common;
use crate::types::storage::{BlockHeight, BlockResults, Epoch, PrefixValue};
use crate::types::{error, storage, token};
use crate::types::{storage, token};
use crate::{display_line, edisplay_line};

/// Query the status of a given transaction.
Expand Down
8 changes: 3 additions & 5 deletions shared/src/sdk/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::ibc::applications::transfer::msgs::transfer::MsgTransfer;
use crate::ibc_proto::google::protobuf::Any;
use crate::ledger::parameters::storage as parameter_storage;
use crate::proto::{MaspBuilder, Section, Tx};
use crate::sdk::{args, rpc};
use crate::sdk::error::{EncodingError, Error, TxError};
use crate::sdk::masp::{
make_asset_type, ShieldedContext, ShieldedTransfer, ShieldedUtils,
Expand All @@ -40,11 +41,8 @@ use crate::sdk::tx::{
TX_UNBOND_WASM, TX_UPDATE_ACCOUNT_WASM, TX_VOTE_PROPOSAL, TX_WITHDRAW_WASM,
VP_USER_WASM,
};
pub use crate::ledger::wallet::store::AddressVpType;
use crate::ledger::wallet::{Wallet, WalletUtils};
use crate::ledger::{args, rpc};
use crate::proto::{MaspBuilder, Section, Tx};
use crate::types::error::{EncodingError, Error, TxError};
pub use crate::sdk::wallet::store::AddressVpType;
use crate::sdk::wallet::{Wallet, WalletUtils};
use crate::types::io::*;
use crate::types::key::*;
use crate::types::masp::{ExtendedViewingKey, PaymentAddress};
Expand Down
3 changes: 1 addition & 2 deletions shared/src/sdk/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ use crate::sdk::wallet::{Wallet, WalletUtils};
use crate::tendermint_rpc::endpoint::broadcast::tx_sync::Response;
use crate::tendermint_rpc::error::Error as RpcError;
use crate::types::control_flow::{time, ProceedOrElse};
use crate::types::error::{EncodingError, Error, QueryError, Result, TxError};
use crate::types::io::Io;
use crate::types::key::*;
use crate::types::masp::TransferTarget;
Expand Down Expand Up @@ -395,7 +394,7 @@ where

let parsed = {
let wrapper_query =
crate::ledger::rpc::TxEventQuery::Accepted(wrapper_hash.as_str());
rpc::TxEventQuery::Accepted(wrapper_hash.as_str());
let event =
rpc::query_tx_status::<_, IO>(client, wrapper_query, deadline)
.await
Expand Down

0 comments on commit a02037e

Please sign in to comment.