Skip to content

Commit

Permalink
(cleanup) cleaning old test code
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-valerio committed Nov 27, 2024
1 parent 6f59b74 commit 51236e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 32 deletions.
26 changes: 10 additions & 16 deletions src/contract/custom/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ use crate::{
Preferences,
},
runtime::{
AccountId,
BalancesConfig,
Contracts,
Runtime,
RuntimeGenesisConfig,
RuntimeOrigin,
},
},
EmptyResult,
Expand All @@ -25,24 +22,21 @@ use sp_core::{
storage::Storage,
};
use sp_runtime::BuildStorage;
use std::{
fs,
str::FromStr,
};
use std::fs;

/// This file is made to be customized. Feel free to remove, add, modify code
impl DevelopperPreferences for Preferences {
fn runtime_storage() -> Storage {
let specific_address =
AccountId32::from_str("5CJwK57RASwYZexBDvxoybV7BoRTbGtxckrWKbtpBug35yx2").unwrap();
let mut balances = (0..u8::MAX)
.map(|i| ([i; 32].into(), 10000000000000000000 * 2))
.collect::<Vec<_>>();

balances.push((specific_address.into(), 10000000000000000000 * 2));

let storage = RuntimeGenesisConfig {
balances: BalancesConfig { balances },
balances: BalancesConfig {
balances: (0..u8::MAX) // Lot of money for Alice, Bob ... Ferdie
.map(|i| [i; 32].into())
.collect::<Vec<_>>()
.iter()
.cloned()
.map(|k| (k, 10000000000000000000 * 2))
.collect(),
},
..Default::default()
}
.build_storage()
Expand Down
16 changes: 0 additions & 16 deletions tests/cli_instrument_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ mod tests {
};
use anyhow::ensure;
use assert_cmd::Command as CommandAssertCmd;
use contract_transcode::env_types::AccountId;
use phink_lib::{
cli::config::Configuration,
instrumenter::path::InstrumentedPath,
EmptyResult,
};
use predicates::prelude::predicate;
use sp_core::crypto::AccountId32;
use std::fs;
use tempfile::tempdir;
use walkdir::WalkDir;
Expand Down Expand Up @@ -68,20 +66,6 @@ mod tests {
assert!(test.is_ok(), "{}", test.err().unwrap().to_string());
Ok(())
}

#[test]
fn aaa() -> EmptyResult {
// let a = AccountId32::new([1; 32]);
// println!("{}", a);
let bcd = contract_transcode::AccountId32::try_from([
10, 218, 186, 223, 239, 138, 14, 204, 129, 51, 100, 132, 99, 100, 82, 52, 32, 4, 43,
116, 79, 198, 231, 242, 83, 147, 228, 45, 81, 6, 222, 125,
]);
println!("{:?}", bcd?.to_ss58check());

Ok(())
}

#[test]
fn test_instrumentation_multifile_contract() -> EmptyResult {
let path_instrumented_contract = InstrumentedPath::from(tempdir()?.into_path());
Expand Down

0 comments on commit 51236e1

Please sign in to comment.