Skip to content

Commit

Permalink
sdk: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jan 3, 2024
1 parent ed3736f commit ee4c992
Show file tree
Hide file tree
Showing 24 changed files with 297 additions and 298 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ mod storage_key;

use borsh::{BorshDeserialize, BorshSerialize};
use namada_core::types::address::Address;
use namada_core::types::key::{common, AccountPublicKeysMap};
use namada_core::types::key::common;
pub use namada_core::types::key::AccountPublicKeysMap;
use serde::{Deserialize, Serialize};
pub use storage::*;
pub use storage_key::*;
Expand Down
61 changes: 34 additions & 27 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,17 @@ default = ["tendermint-rpc", "download-params"]

multicore = ["masp_proofs/multicore"]

namada-sdk = [
"tendermint-rpc",
"masp_primitives/transparent-inputs"
]
namada-sdk = ["tendermint-rpc", "masp_primitives/transparent-inputs"]

std = ["fd-lock"]

# tendermint-rpc support
tendermint-rpc = [
"async-client",
"dep:tendermint-rpc",
]
tendermint-rpc = ["async-client", "dep:tendermint-rpc"]

wasm-runtime = [
"namada_core/wasm-runtime",
]
wasm-runtime = ["namada_core/wasm-runtime"]

# Enable queries support for an async client
async-client = [
"async-trait",
]
async-client = ["async-trait"]

async-send = []

Expand All @@ -56,7 +46,20 @@ testing = [
download-params = ["masp_proofs/download-params"]

[dependencies]
async-trait = {version = "0.1.51", optional = true}
namada_account = { path = "../account" }
namada_core = { path = "../core" }
namada_ethereum_bridge = { path = "../ethereum_bridge", default-features = false }
namada_governance = { path = "../governance" }
namada_ibc = { path = "../ibc" }
namada_parameters = { path = "../parameters" }
namada_proof_of_stake = { path = "../proof_of_stake", default-features = false }
namada_state = { path = "../state" }
namada_storage = { path = "../storage" }
namada_token = { path = "../token" }
namada_tx = { path = "../tx" }
namada_vote_ext = { path = "../vote_ext" }

async-trait = { version = "0.1.51", optional = true }
bimap.workspace = true
borsh.workspace = true
borsh-ext.workspace = true
Expand All @@ -68,18 +71,15 @@ ethers.workspace = true
fd-lock = { workspace = true, optional = true }
futures.workspace = true
itertools.workspace = true
lazy_static.workspace= true
lazy_static.workspace = true
masp_primitives.workspace = true
masp_proofs.workspace = true
namada_core = {path = "../core", default-features = false, features = ["rand"]}
namada_ethereum_bridge = {path = "../ethereum_bridge", default-features = false}
namada_proof_of_stake = {path = "../proof_of_stake", default-features = false}
num256.workspace = true
orion.workspace = true
owo-colors = "3.5.0"
parse_duration = "2.1.1"
paste.workspace = true
proptest = {workspace = true, optional = true}
proptest = { workspace = true, optional = true }
prost.workspace = true
rand.workspace = true
rand_core.workspace = true
Expand All @@ -88,7 +88,7 @@ serde.workspace = true
serde_json.workspace = true
sha2.workspace = true
slip10_ed25519.workspace = true
tendermint-rpc = {workspace = true, optional = true}
tendermint-rpc = { workspace = true, optional = true }
thiserror.workspace = true
tiny-bip39.workspace = true
tiny-hderive.workspace = true
Expand All @@ -97,18 +97,25 @@ tracing.workspace = true
zeroize.workspace = true

[target.'cfg(not(target_family = "wasm"))'.dependencies]
tokio = {workspace = true, features = ["full"]}
tokio = { workspace = true, features = ["full"] }

[target.'cfg(target_family = "wasm")'.dependencies]
tokio = {workspace = true, default-features = false, features = ["sync"]}
tokio = { workspace = true, default-features = false, features = ["sync"] }
wasmtimer = "0.2.0"

[dev-dependencies]
assert_matches.workspace = true
base58.workspace = true
namada_core = {path = "../core", default-features = false, features = ["rand", "testing"]}
namada_ethereum_bridge = {path = "../ethereum_bridge", default-features = false, features = ["testing"]}
namada_proof_of_stake = {path = "../proof_of_stake", default-features = false, features = ["testing"]}
namada_test_utils = {path = "../test_utils"}
namada_core = { path = "../core", default-features = false, features = [
"rand",
"testing",
] }
namada_ethereum_bridge = { path = "../ethereum_bridge", default-features = false, features = [
"testing",
] }
namada_proof_of_stake = { path = "../proof_of_stake", default-features = false, features = [
"testing",
] }
namada_test_utils = { path = "../test_utils" }
proptest.workspace = true
tempfile.workspace = true
52 changes: 26 additions & 26 deletions sdk/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::time::Duration as StdDuration;

use namada_core::ledger::governance::cli::onchain::{
DefaultProposal, PgfFundingProposal, PgfStewardProposal,
};
use namada_core::types::address::Address;
use namada_core::types::chain::ChainId;
use namada_core::types::dec::Dec;
Expand All @@ -16,8 +13,11 @@ use namada_core::types::key::{common, SchemeType};
use namada_core::types::masp::PaymentAddress;
use namada_core::types::storage::Epoch;
use namada_core::types::time::DateTimeUtc;
use namada_core::types::transaction::GasLimit;
use namada_core::types::{storage, token};
use namada_governance::cli::onchain::{
DefaultProposal, PgfFundingProposal, PgfStewardProposal,
};
use namada_tx::data::GasLimit;
use serde::{Deserialize, Serialize};
use zeroize::Zeroizing;

Expand Down Expand Up @@ -178,7 +178,7 @@ impl TxCustom {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_custom(context, self).await
}
}
Expand Down Expand Up @@ -283,7 +283,7 @@ impl TxTransfer {
pub async fn build(
&mut self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData, Option<Epoch>)>
) -> crate::error::Result<(namada_tx::Tx, SigningTxData, Option<Epoch>)>
{
tx::build_transfer(context, self).await
}
Expand Down Expand Up @@ -397,7 +397,7 @@ impl TxIbcTransfer {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData, Option<Epoch>)>
) -> crate::error::Result<(namada_tx::Tx, SigningTxData, Option<Epoch>)>
{
tx::build_ibc_transfer(context, self).await
}
Expand Down Expand Up @@ -486,7 +486,7 @@ impl InitProposal {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
let current_epoch = rpc::query_epoch(context.client()).await?;
let governance_parameters =
rpc::query_governance_parameters(context.client()).await;
Expand Down Expand Up @@ -642,7 +642,7 @@ impl VoteProposal {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
let current_epoch = rpc::query_epoch(context.client()).await?;
tx::build_vote_proposal(context, self, current_epoch).await
}
Expand Down Expand Up @@ -714,7 +714,7 @@ impl TxInitAccount {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_init_account(context, self).await
}
}
Expand Down Expand Up @@ -868,7 +868,7 @@ impl TxUpdateAccount {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_update_account(context, self).await
}
}
Expand Down Expand Up @@ -945,7 +945,7 @@ impl Bond {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_bond(context, self).await
}
}
Expand All @@ -972,7 +972,7 @@ impl Unbond {
&self,
context: &impl Namada,
) -> crate::error::Result<(
crate::proto::Tx,
namada_tx::Tx,
SigningTxData,
Option<(Epoch, token::Amount)>,
)> {
Expand Down Expand Up @@ -1043,7 +1043,7 @@ impl Redelegate {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_redelegation(context, self).await
}
}
Expand Down Expand Up @@ -1124,7 +1124,7 @@ impl RevealPk {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_reveal_pk(context, &self.tx, &self.public_key).await
}
}
Expand Down Expand Up @@ -1207,7 +1207,7 @@ impl Withdraw {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_withdraw(context, self).await
}
}
Expand Down Expand Up @@ -1243,7 +1243,7 @@ impl ClaimRewards {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_claim_rewards(context, self).await
}
}
Expand Down Expand Up @@ -1375,7 +1375,7 @@ impl CommissionRateChange {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_validator_commission_change(context, self).await
}
}
Expand Down Expand Up @@ -1435,7 +1435,7 @@ pub struct ConsensusKeyChange<C: NamadaTypes = SdkTypes> {
// pub async fn build(
// &self,
// context: &impl Namada,
// ) -> crate::error::Result<(crate::proto::Tx, SigningTxData,
// ) -> crate::error::Result<(namada_tx::Tx, SigningTxData,
// Option<Epoch>)> {
// tx::build_change_consensus_key(context, self).await
// }
Expand Down Expand Up @@ -1494,7 +1494,7 @@ impl MetaDataChange {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_validator_metadata_change(context, self).await
}
}
Expand Down Expand Up @@ -1549,7 +1549,7 @@ impl UpdateStewardCommission {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_update_steward_commission(context, self).await
}
}
Expand Down Expand Up @@ -1597,7 +1597,7 @@ impl ResignSteward {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_resign_steward(context, self).await
}
}
Expand Down Expand Up @@ -1645,7 +1645,7 @@ impl TxUnjailValidator {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_unjail_validator(context, self).await
}
}
Expand Down Expand Up @@ -1693,7 +1693,7 @@ impl TxDeactivateValidator {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_deactivate_validator(context, self).await
}
}
Expand Down Expand Up @@ -1741,7 +1741,7 @@ impl TxReactivateValidator {
pub async fn build(
&self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
tx::build_reactivate_validator(context, self).await
}
}
Expand Down Expand Up @@ -2273,7 +2273,7 @@ impl EthereumBridgePool {
pub async fn build(
self,
context: &impl Namada,
) -> crate::error::Result<(crate::proto::Tx, SigningTxData)> {
) -> crate::error::Result<(namada_tx::Tx, SigningTxData)> {
bridge_pool::build_bridge_pool_tx(context, self).await
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! Generic Error Type for all of the Shared Crate

use namada_core::proto::Tx;
use namada_core::types::address::Address;
use namada_core::types::dec::Dec;
use namada_core::types::ethereum_events::EthAddress;
use namada_core::types::storage;
use namada_core::types::storage::Epoch;
use namada_tx::Tx;
use prost::EncodeError;
use tendermint_rpc::Error as RpcError;
use thiserror::Error;
Expand Down
Loading

0 comments on commit ee4c992

Please sign in to comment.