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

testing-se #2370

Closed
wants to merge 8 commits into from
Closed
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ exclude = [
"wasm",
"wasm_for_tests",
"test_fixtures",
"scripts/address_filtering",
]

[workspace.package]
Expand Down
10 changes: 10 additions & 0 deletions apps/src/lib/node/ledger/shell/init_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ where
init: request::InitChain,
#[cfg(any(test, feature = "testing"))] _num_validators: u64,
) -> Result<response::InitChain> {
// Sleep for 30s
use std::str::FromStr;
std::env::var("NAMADA_INIT_CHAIN_SLEEP")
.ok()
.and_then(|s| u64::from_str(&s).ok())
.map(std::time::Duration::from_secs)
.map(std::thread::sleep)
.expect("Could not sleep before init_chain");


let mut response = response::InitChain::default();
let chain_id = self.wl_storage.storage.chain_id.as_str();
if chain_id != init.chain_id.as_str() {
Expand Down
8 changes: 1 addition & 7 deletions core/src/types/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,7 @@ pub const fn wnam() -> EthAddress {
/// informal currency codes and number of decimal places.
pub fn tokens() -> HashMap<&'static str, Denomination> {
vec![
("nam", 6.into()),
("btc", 8.into()),
("eth", 18.into()),
("dot", 10.into()),
("schnitzel", 6.into()),
("apfel", 6.into()),
("kartoffel", 6.into()),
("naan", 6.into())
]
.into_iter()
.collect()
Expand Down
6 changes: 3 additions & 3 deletions core/src/types/string_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub const COMMON_SIG_HRP: &str = "signam";
#[allow(missing_docs)]
#[derive(Error, Debug)]
pub enum DecodeError {
#[error("Error decoding from Bech32m: {0}")]
DecodeBech32(bech32::Error),
#[error("Error decoding {0} from Bech32m: {1}")]
DecodeBech32(String, bech32::Error),
#[error("Error decoding from base32: {0}")]
DecodeBase32(bech32::Error),
#[error("Unexpected Bech32m human-readable part {0}, expected {1}")]
Expand Down Expand Up @@ -81,7 +81,7 @@ pub trait Format: Sized {
/// Try to decode `Self` from a string
fn decode(string: impl AsRef<str>) -> Result<Self, DecodeError> {
let (hrp, hash_base32, variant) = bech32::decode(string.as_ref())
.map_err(DecodeError::DecodeBech32)?;
.map_err(| e | DecodeError::DecodeBech32(String::from(string.as_ref()), e))?;
if hrp != Self::HRP {
return Err(DecodeError::UnexpectedBech32Hrp(
hrp,
Expand Down
121 changes: 6 additions & 115 deletions genesis/localnet/balances.toml
Original file line number Diff line number Diff line change
@@ -1,117 +1,8 @@
# Genesis balances.
#
# This files contains the genesis balances of any tokens present at genesis
# associated with implicit addresses (in the form of public keys) or established
# addresses.
#
# For example:
# ```
# [token.NAM]
# some_pk_bech32m_encoding = 10 # genesis tokens, the amount can have up to 6 decimal places
# ```
#
# The public keys present in here are taken from `pre-genesis/wallet.toml`.
# As for the established addresses, these are derived from their respective
# genesis tx toml files.

[token.NAM]
# albert
[token.NAAN]
# Testing stuff
tpknam1qpg2tsrplvhu3fd7z7tq5ztc2ne3s7e2ahjl2a2cddufrzdyr752g666ytj = "100000000000.00"
tpknam1qqwfpuvn8x7yqtquejhppef4vddv9ghusec2rkaxav38amamxaxpgj9cs79 = "1000000000.00"
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "2000000"
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "2000000"
tpknam1qrnw8mxyqlj60mykgevnldcj5mg2fya7fs5a8xqdkd2gwtxhef0zy8a2wha = "2000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "2000000"
tpknam1qq52dx5e290wyh7ngdt6wudtyd502lg6ln49yvg3vz97e8j2ruux5e3yewq = "2000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "2000000"
tpknam1qqwfpuvn8x7yqtquejhppef4vddv9ghusec2rkaxav38amamxaxpgj9cs79 = "2000000"
# daewon
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "100000000"
# ester
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "200000"
tpknam1qpzrttnzfyt6xfu2vy092eruasll3z52rjfexwapdw0rdww5uktlk3j73dw = "200000"

[token.BTC]
# albert
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "1000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "1000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "1000000"
# daewon-key
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "1000000"
# ester-key
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "1000000"

[token.ETH]
# albert
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "1000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "1000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "1000000"
# daewon-key
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "1000000"
# ester-key
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "1000000"

[token.DOT]
# albert
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "1000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "1000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "1000000"
# daewon-key
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "1000000"
# ester-key
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "1000000"

[token.Schnitzel]
# albert
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "1000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "1000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "1000000"
# daewon-key
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "1000000"
# ester-key
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "1000000"

[token.Apfel]
# albert
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "1000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "1000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "1000000"
# daewon-key
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "1000000"
# ester-key
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "1000000"

[token.Kartoffel]
# albert
tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu = "1000000"
# bertha
tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn = "1000000"
# christel
tnam1q9sx4ekzqaq3xdxtruxkm764nhl00cvcsc7df5jf = "1000000"
# daewon-key
tpknam1qzz4x4fammhdcfa0g8xw4udkq8s4n6kjhzlxh00ul3da05wuu9wkykqqvjm = "1000000"
# ester-key
tpknam1qypvqpzu74nafjahlwyq272dj76qq9rz30dulyc94883tmj893mquqs74gxv4 = "1000000"
# validator-0
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "1000000"
tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx = "2000000000"
8 changes: 2 additions & 6 deletions genesis/localnet/parameters.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# General protocol parameters.
[parameters]
native_token = "NAM"
native_token = "naan"
# Minimum number of blocks in an epoch.
min_num_of_blocks = 4
# Maximum expected time per block (in seconds).
Expand Down Expand Up @@ -28,7 +28,7 @@ fee_unshielding_descriptions_limit = 15

# Map of the cost per gas unit for every token allowed for fee payment
[parameters.minimum_gas_price]
nam = "0.000001"
naan = "0.000001"

# Proof of stake parameters.
[pos_params]
Expand Down Expand Up @@ -92,10 +92,6 @@ min_proposal_grace_epochs = 6
[pgf_params]
# Initial set of stewards
stewards = [
# bertha
"tnam1q9rhgyv3ydq0zu3whnftvllqnvhvhm270qxay5tn",
# validator-0
"tnam1q9vhfdur7gadtwx4r223agpal0fvlqhywylf2mzx"
]
# The pgf funding inflation rate
pgf_inflation_rate = "0.1"
Expand Down
4 changes: 2 additions & 2 deletions genesis/localnet/tokens.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Token accounts with their validity predicates

[token.NAM]
[token.NAAN]
denom = 6

[token.NAM.parameters]
[token.NAAN.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
Expand Down
Loading
Loading