Skip to content

Commit

Permalink
rebased on v0.27 and some initial multisig fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
batconjurer committed Nov 21, 2023
1 parent b0f27e8 commit 62572be
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 170 deletions.
31 changes: 13 additions & 18 deletions apps/src/lib/client/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,29 +609,24 @@ pub fn derive_genesis_addresses(
.into_iter()
.flatten()
{
let address = {
let unsigned =
genesis::transactions::UnsignedEstablishedAccountTx::from(tx);
unsigned.derive_address()
};
let pk = if let Some(public_key) = tx.public_key.as_ref() {
&public_key.pk.raw
} else {
continue;
};
let address = tx.derive_address();

println!();
println!("{} {address}", "Address:".bold().bright_green());
println!("{} {pk}", "Public key:".bold().bright_green());

let maybe_alias =
maybe_pre_genesis_wallet.as_ref().and_then(|wallet| {
let implicit_address = pk.into();
wallet.find_alias(&implicit_address)
});
println!("{}", "Public key(s):".bold().bright_green());
for (ix, pk) in tx.public_keys.iter().enumerate() {
println!(" {}. {}", ix, pk);

if let Some(alias) = maybe_alias {
println!("{} {alias}", "Wallet alias:".bold().bright_green());
let maybe_alias =
maybe_pre_genesis_wallet.as_ref().and_then(|wallet| {
let implicit_address = (&pk.raw).into();
wallet.find_alias(&implicit_address)
});

if let Some(alias) = maybe_alias {
println!("{} {alias}", "Wallet alias:".bold().bright_green());
}
}
}
if genesis_txs
Expand Down
7 changes: 2 additions & 5 deletions apps/src/lib/config/genesis/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,7 @@ impl FinalizedTransactions {
let established_account = established_account.map(|txs| {
txs.into_iter()
.map(|tx| FinalizedEstablishedAccountTx {
address: transactions::UnsignedEstablishedAccountTx::from(
&tx,
)
.derive_address(),
address: tx.derive_address(),
tx,
})
.collect()
Expand Down Expand Up @@ -739,7 +736,7 @@ impl FinalizedParameters {
pub struct FinalizedEstablishedAccountTx {
pub address: Address,
#[serde(flatten)]
pub tx: transactions::SignedEstablishedAccountTx,
pub tx: transactions::EstablishedAccountTx,
}

#[derive(
Expand Down
5 changes: 1 addition & 4 deletions apps/src/lib/config/genesis/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ use namada::types::token::{
use serde::{Deserialize, Serialize};

use super::toml_utils::{read_toml, write_toml};
use super::transactions::{
self, Transactions, UnsignedEstablishedAccountTx,
UnsignedValidatorAccountTx,
};
use super::transactions::{self, Transactions, UnsignedValidatorAccountTx};
use crate::config::genesis::chain::DeriveEstablishedAddress;
use crate::config::genesis::transactions::{BondTx, SignedBondTx};
use crate::config::genesis::GenesisAddress;
Expand Down
Loading

0 comments on commit 62572be

Please sign in to comment.