Skip to content

Commit

Permalink
chore: update namada to v0.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk committed Jul 25, 2023
1 parent a8881ca commit 70fe484
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 37 deletions.
20 changes: 10 additions & 10 deletions packages/shared/lib/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 packages/shared/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gloo-utils = { version = "0.1.5", features = ["serde"] }
js-sys = "0.3.60"
masp_primitives = { git = "https://github.com/anoma/masp", rev = "252a6059565b125c1444e9e7d0b7c8da0fba8f8f" }
masp_proofs = { git = "https://github.com/anoma/masp", rev = "252a6059565b125c1444e9e7d0b7c8da0fba8f8f", default-features = false, features = ["local-prover"] }
namada = { git = "https://github.com/anoma/namada", version = "0.19.0", default-features = false, features = ["abciplus", "namada-sdk"] }
namada = { git = "https://github.com/anoma/namada", version = "0.20.0", default-features = false, features = ["abciplus", "namada-sdk"] }
prost = "0.9.0"
prost-types = "0.9.0"
rand = "0.8.5"
Expand Down
10 changes: 4 additions & 6 deletions packages/shared/lib/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use namada::ledger::rpc::{get_public_key, get_token_balance};
use namada::types::{
address::Address,
masp::ExtendedViewingKey,
token::{self, TokenAddress},
token::{self},
uint::I256,
};
use std::collections::{HashMap, HashSet};
Expand Down Expand Up @@ -124,7 +124,7 @@ impl Query {
}

fn get_decoded_balance(
decoded_balance: HashMap<TokenAddress, I256>,
decoded_balance: HashMap<Address, I256>,
) -> Vec<(Address, token::Amount)> {
let mut result = Vec::new();

Expand All @@ -133,7 +133,7 @@ impl Query {
.into_iter()
.for_each(|(token_address, change)| {
let amount = token::Amount::from_change(*change);
result.push((token_address.address.clone(), amount));
result.push((token_address.clone(), amount));
});

result
Expand All @@ -159,9 +159,7 @@ impl Query {

let mut result = vec![];
for token in tokens {
let balances = get_token_balance(&self.client, &token, &owner)
.await
.unwrap_or(token::Amount::zero());
let balances = get_token_balance(&self.client, &token, &owner).await;
result.push((token, balances));
}
result
Expand Down
7 changes: 1 addition & 6 deletions packages/shared/lib/src/sdk/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use masp_proofs::prover::LocalTxProver;
use namada::ledger::masp::{ShieldedContext, ShieldedUtils};
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};

use crate::{
rpc_client::HttpClient,
utils::{to_bytes, to_io_error},
};
use crate::utils::{to_bytes, to_io_error};

const SHIELDED_CONTEXT: &str = "shielded-context";

Expand Down Expand Up @@ -38,8 +35,6 @@ impl WebShieldedUtils {

#[async_trait(?Send)]
impl ShieldedUtils for WebShieldedUtils {
type C = HttpClient;

fn local_tx_prover(&self) -> LocalTxProver {
LocalTxProver::from_bytes(
&self.spend_param_bytes,
Expand Down
6 changes: 0 additions & 6 deletions packages/shared/lib/src/sdk/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ pub struct SubmitTransferMsg {
source: String,
target: String,
token: String,
sub_prefix: Option<String>,
amount: String,
native_token: String,
}
Expand All @@ -183,7 +182,6 @@ pub fn transfer_tx_args(
source,
target,
token,
sub_prefix,
amount,
native_token,
} = tx_msg;
Expand Down Expand Up @@ -223,7 +221,6 @@ pub fn transfer_tx_args(
source,
target,
token,
sub_prefix,
amount,
native_token,
tx_code_path: PathBuf::from("tx_transfer.wasm"),
Expand All @@ -237,7 +234,6 @@ pub struct SubmitIbcTransferMsg {
source: String,
receiver: String,
token: String,
sub_prefix: Option<String>,
amount: String,
port_id: String,
channel_id: String,
Expand Down Expand Up @@ -266,7 +262,6 @@ pub fn ibc_transfer_tx_args(
source,
receiver,
token,
sub_prefix,
amount,
port_id,
channel_id,
Expand All @@ -287,7 +282,6 @@ pub fn ibc_transfer_tx_args(
source,
receiver,
token,
sub_prefix,
amount,
port_id,
channel_id,
Expand Down
3 changes: 0 additions & 3 deletions packages/types/src/tx/schema/ibcTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export class IbcTransferMsgValue {
@field({ type: "string" })
token!: string;

@field({ type: option("string") })
subPrefix?: string;

@field(BigNumberSerializer)
amount!: BigNumber;

Expand Down
3 changes: 0 additions & 3 deletions packages/types/src/tx/schema/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export class TransferMsgValue {
@field({ type: "string" })
token!: string;

@field({ type: option("string") })
subPrefix?: string;

@field(BigNumberSerializer)
amount!: BigNumber;

Expand Down
2 changes: 0 additions & 2 deletions packages/types/src/tx/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export type TransferProps = {
source: string;
target: string;
token: string;
subPrefix?: string;
amount: BigNumber;
nativeToken: string;
};
Expand All @@ -43,7 +42,6 @@ export type IbcTransferProps = {
source: string;
receiver: string;
token: string;
subPrefix?: string;
amount: BigNumber;
portId: string;
channelId: string;
Expand Down

0 comments on commit 70fe484

Please sign in to comment.