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

Replace PaymentAddress with MASP when transferring to a shielded address #3626

Merged
merged 4 commits into from
Aug 23, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Updated the gaia e2e tests to use the MASP internal address instead of
the payment address as the receiver of an IBC shielding transaction.
([\#3626](https://github.com/anoma/namada/pull/3626))
9 changes: 8 additions & 1 deletion crates/tests/src/e2e/ibc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use namada_apps_lib::facade::tendermint::block::Header as TmHeader;
use namada_apps_lib::facade::tendermint::merkle::proof::ProofOps as TmProof;
use namada_apps_lib::facade::tendermint_rpc::{Client, HttpClient, Url};
use namada_core::string_encoding::StringEncoded;
use namada_sdk::address::{Address, InternalAddress};
use namada_sdk::address::{Address, InternalAddress, MASP};
use namada_sdk::events::extend::ReadFromEventAttributes;
use namada_sdk::governance::cli::onchain::PgfFunding;
use namada_sdk::governance::pgf::ADDRESS as PGF_ADDRESS;
Expand Down Expand Up @@ -73,6 +73,7 @@ use namada_sdk::ibc::primitives::{Signer, ToProto};
use namada_sdk::ibc::storage::*;
use namada_sdk::key::PublicKey;
use namada_sdk::masp::fs::FsShieldedUtils;
use namada_sdk::masp::PaymentAddress;
use namada_sdk::parameters::{storage as param_storage, EpochDuration};
use namada_sdk::queries::RPC;
use namada_sdk::state::ics23_specs::ibc_proof_specs;
Expand Down Expand Up @@ -2234,6 +2235,12 @@ fn transfer_from_gaia(
let channel_id = channel_id.to_string();
let amount = format!("{}{}", amount, token.as_ref());
let rpc = format!("tcp:https://{GAIA_RPC}");
// If the receiver is a pyament address we want to mask it to the more
// general MASP internal address to improve on privacy
let receiver = match PaymentAddress::from_str(receiver.as_ref()) {
Ok(_) => MASP.to_string(),
Err(_) => receiver.as_ref().to_string(),
};
let mut args = vec![
"tx",
"ibc-transfer",
Expand Down