diff --git a/integration_tests/configs/debug/sequencer/sequencer_config.json b/integration_tests/configs/debug/sequencer/sequencer_config.json index 2a2037d..beb39cb 100644 --- a/integration_tests/configs/debug/sequencer/sequencer_config.json +++ b/integration_tests/configs/debug/sequencer/sequencer_config.json @@ -8,49 +8,49 @@ "port": 3040, "initial_accounts": [ { - "addr": "d07ad2e84b27fa00c262f0a1eea0ff35ca0973547e6a106f72f193c2dc838b44", + "addr": "BLgCRDXYdQPMMWVHYRFGQZbgeHx9frkipa8GtpG2Syqy", "balance": 10000 }, { - "addr": "e7ae77c5ef1a05999344af499fc78a1705398d62ed06cf2e1479f6def89a39bc", + "addr": "Gj1mJy5W7J5pfmLRujmQaLfLMWidNxQ6uwnhb666ZwHw", "balance": 20000 } ], "initial_commitments": [ { "npk": [ - 193, - 209, - 150, - 113, - 47, - 241, - 48, - 145, - 250, - 79, - 235, - 51, - 119, - 40, - 184, - 232, - 5, + 63, + 202, + 178, + 231, + 183, + 82, + 237, + 212, + 216, 221, - 36, - 21, - 201, - 106, - 90, - 210, - 129, - 106, - 71, - 99, - 208, + 215, + 255, 153, - 75, - 215 + 101, + 177, + 161, + 254, + 210, + 128, + 122, + 54, + 190, + 230, + 151, + 183, + 64, + 225, + 229, + 113, + 1, + 228, + 97 ], "account": { "program_owner": [ @@ -70,38 +70,38 @@ }, { "npk": [ - 27, - 250, + 192, + 251, + 166, + 243, + 167, + 236, + 84, + 249, + 35, 136, - 142, - 88, - 128, - 138, - 21, - 49, - 183, - 118, - 160, - 117, - 114, - 110, - 47, - 136, - 87, - 60, - 70, - 59, - 60, - 18, - 223, - 23, - 147, - 241, - 5, - 184, - 103, + 130, + 172, + 219, 225, - 105 + 161, + 139, + 229, + 89, + 243, + 125, + 194, + 213, + 209, + 30, + 23, + 174, + 100, + 244, + 124, + 74, + 140, + 47 ], "account": { "program_owner": [ @@ -154,4 +154,4 @@ 37, 37 ] -} +} \ No newline at end of file diff --git a/integration_tests/configs/debug/wallet/wallet_config.json b/integration_tests/configs/debug/wallet/wallet_config.json index 0081da6..95c95e9 100644 --- a/integration_tests/configs/debug/wallet/wallet_config.json +++ b/integration_tests/configs/debug/wallet/wallet_config.json @@ -9,85 +9,85 @@ "initial_accounts": [ { "Public": { - "address": "d07ad2e84b27fa00c262f0a1eea0ff35ca0973547e6a106f72f193c2dc838b44", + "address": "BLgCRDXYdQPMMWVHYRFGQZbgeHx9frkipa8GtpG2Syqy", "pub_sign_key": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 16, + 162, + 106, + 154, + 236, + 125, + 52, + 184, + 35, + 100, + 238, + 174, + 69, + 197, + 41, + 77, + 187, + 10, + 118, + 75, + 0, + 11, + 148, + 238, + 185, + 181, + 133, + 17, + 220, + 72, + 124, + 77 ] } }, { "Public": { - "address": "e7ae77c5ef1a05999344af499fc78a1705398d62ed06cf2e1479f6def89a39bc", + "address": "Gj1mJy5W7J5pfmLRujmQaLfLMWidNxQ6uwnhb666ZwHw", "pub_sign_key": [ - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2 + 113, + 121, + 64, + 177, + 204, + 85, + 229, + 214, + 178, + 6, + 109, + 191, + 29, + 154, + 63, + 38, + 242, + 18, + 244, + 219, + 8, + 208, + 35, + 136, + 23, + 127, + 207, + 237, + 216, + 169, + 190, + 27 ] } }, { "Private": { - "address": "d360d6b5763f71ac6af56253687fd7d556d5c6c64312e53c0b92ef039a4375df", + "address": "3oCG8gqdKLMegw4rRfyaMQvuPHpcASt7xwttsmnZLSkw", "account": { "program_owner": [ 0, @@ -105,218 +105,218 @@ }, "key_chain": { "secret_spending_key": [ - 10, - 125, - 171, - 38, - 201, - 35, - 164, - 43, - 7, - 80, - 7, - 215, - 97, - 42, - 48, - 229, - 101, - 216, - 140, - 21, - 170, - 214, + 251, 82, - 53, + 235, + 1, + 146, + 96, + 30, + 81, + 162, + 234, + 33, + 15, + 123, + 129, 116, - 22, - 62, - 79, - 61, - 76, - 71, - 79 + 0, + 84, + 136, + 176, + 70, + 190, + 224, + 161, + 54, + 134, + 142, + 154, + 1, + 18, + 251, + 242, + 189 ], "private_key_holder": { "nullifier_secret_key": [ - 228, - 136, - 4, + 29, + 250, + 10, + 187, + 35, + 123, + 180, + 250, + 246, + 97, + 216, + 153, + 44, 156, - 33, - 40, - 194, - 172, - 95, - 168, - 201, - 33, - 24, - 30, - 126, - 197, - 156, - 113, - 64, - 162, - 131, - 210, - 110, - 60, - 24, - 154, - 86, - 59, - 184, - 95, - 245, - 176 + 16, + 93, + 241, + 26, + 174, + 219, + 72, + 84, + 34, + 247, + 112, + 101, + 217, + 243, + 189, + 173, + 75, + 20 ], "incoming_viewing_secret_key": [ - 197, - 33, - 51, - 200, - 1, - 121, - 60, - 52, - 233, - 234, - 12, - 166, - 196, - 227, - 187, - 1, - 10, - 101, - 183, - 105, - 140, - 28, - 152, + 251, + 201, + 22, + 154, + 100, + 165, + 218, + 108, + 163, + 190, + 135, + 91, + 145, + 84, + 69, + 241, + 46, + 117, 217, - 109, - 220, - 112, - 103, - 253, 110, - 98, - 6 + 197, + 248, + 91, + 193, + 14, + 104, + 88, + 103, + 67, + 153, + 182, + 158 ], "outgoing_viewing_secret_key": [ - 147, - 34, - 193, - 29, - 39, - 173, - 222, + 25, + 67, + 121, + 76, + 175, + 100, 30, - 118, - 199, - 44, - 204, - 43, - 232, - 107, - 223, - 249, - 207, - 245, - 183, - 63, - 209, - 129, - 48, - 254, - 66, - 22, - 199, - 81, - 145, - 126, - 92 + 198, + 105, + 123, + 49, + 169, + 75, + 178, + 75, + 210, + 100, + 143, + 210, + 243, + 228, + 243, + 21, + 18, + 36, + 84, + 164, + 186, + 139, + 113, + 214, + 12 ] }, "nullifer_public_key": [ - 193, - 209, - 150, - 113, - 47, - 241, - 48, - 145, - 250, - 79, - 235, - 51, - 119, - 40, - 184, - 232, - 5, + 63, + 202, + 178, + 231, + 183, + 82, + 237, + 212, + 216, 221, - 36, - 21, - 201, - 106, - 90, - 210, - 129, - 106, - 71, - 99, - 208, + 215, + 255, 153, - 75, - 215 + 101, + 177, + 161, + 254, + 210, + 128, + 122, + 54, + 190, + 230, + 151, + 183, + 64, + 225, + 229, + 113, + 1, + 228, + 97 ], "incoming_viewing_public_key": [ 3, - 78, + 235, + 139, + 131, + 237, 177, - 87, - 193, - 219, - 230, - 160, - 222, - 38, - 182, - 100, - 101, - 223, - 204, - 223, - 198, - 140, - 253, - 94, - 16, - 98, - 77, - 79, - 114, - 30, - 158, - 104, - 34, - 152, + 122, 189, - 31, - 95 + 6, + 177, + 167, + 178, + 202, + 117, + 246, + 58, + 28, + 65, + 132, + 79, + 220, + 139, + 119, + 243, + 187, + 160, + 212, + 121, + 61, + 247, + 116, + 72, + 205 ] } } }, { "Private": { - "address": "f27087ffc29b99035303697dcf6c8e323b1847d4261e6afd49e0d71c6dfa31ea", + "address": "AKTcXgJ1xoynta1Ec7y6Jso1z1JQtHqd7aPQ1h9er6xX", "account": { "program_owner": [ 0, @@ -334,214 +334,214 @@ }, "key_chain": { "secret_spending_key": [ - 153, - 109, - 202, - 226, - 97, - 212, - 77, - 147, - 75, - 107, - 153, - 106, - 89, - 167, - 49, - 230, - 122, + 238, + 171, + 241, + 69, + 111, + 217, + 85, + 64, + 19, + 82, + 18, + 189, + 32, + 91, 78, - 167, - 146, - 14, - 180, - 206, + 175, 107, - 96, - 193, - 255, - 122, - 207, - 30, - 142, - 99 + 7, + 109, + 60, + 52, + 44, + 243, + 230, + 72, + 244, + 192, + 92, + 137, + 33, + 118, + 254 ], "private_key_holder": { "nullifier_secret_key": [ - 128, + 25, + 211, 215, - 147, - 175, 119, - 16, - 140, - 219, - 155, - 134, - 27, - 81, - 64, - 40, - 196, - 240, - 61, - 144, - 232, - 164, - 181, 57, - 139, - 96, - 137, - 121, - 140, + 223, + 247, + 37, + 245, + 144, + 122, 29, - 169, - 68, - 187, - 65 + 118, + 245, + 83, + 228, + 23, + 9, + 101, + 120, + 88, + 33, + 238, + 207, + 128, + 61, + 110, + 2, + 89, + 62, + 164, + 13 ], "incoming_viewing_secret_key": [ - 185, - 121, - 146, - 213, - 13, - 3, - 93, - 206, - 25, - 127, - 155, - 21, - 155, - 115, + 193, + 181, + 14, + 196, + 142, + 84, + 15, + 65, + 128, + 101, + 70, + 196, + 241, + 47, 130, - 27, - 57, - 5, - 116, - 80, - 62, - 214, - 67, - 228, - 147, - 189, - 28, - 200, - 62, - 152, - 178, - 103 + 221, + 23, + 146, + 161, + 237, + 221, + 40, + 19, + 126, + 59, + 15, + 169, + 236, + 25, + 105, + 104, + 231 ], "outgoing_viewing_secret_key": [ - 163, - 58, - 118, - 160, + 20, + 170, + 220, + 108, + 41, + 23, + 155, + 217, + 247, + 190, 175, - 86, - 72, + 168, + 247, + 34, + 105, + 134, + 114, + 74, + 104, 91, - 81, - 69, - 150, - 154, - 113, 211, - 118, - 110, - 25, - 156, - 250, - 67, - 212, - 198, - 147, - 231, - 213, - 136, - 212, - 198, - 192, - 255, + 62, 126, - 122 + 13, + 130, + 100, + 241, + 214, + 250, + 236, + 38, + 150 ] }, "nullifer_public_key": [ - 27, - 250, + 192, + 251, + 166, + 243, + 167, + 236, + 84, + 249, + 35, 136, - 142, - 88, - 128, - 138, - 21, - 49, - 183, - 118, - 160, - 117, - 114, - 110, - 47, - 136, - 87, - 60, - 70, - 59, - 60, - 18, - 223, - 23, - 147, - 241, - 5, - 184, - 103, + 130, + 172, + 219, 225, - 105 + 161, + 139, + 229, + 89, + 243, + 125, + 194, + 213, + 209, + 30, + 23, + 174, + 100, + 244, + 124, + 74, + 140, + 47 ], "incoming_viewing_public_key": [ 2, - 56, - 160, - 1, - 22, - 197, - 187, - 214, - 204, - 221, - 84, - 87, - 12, - 204, - 0, - 119, - 116, - 176, - 6, - 149, - 145, - 100, - 211, - 162, - 19, - 158, - 197, - 112, - 142, - 172, - 1, + 181, 98, - 226 + 93, + 216, + 241, + 241, + 110, + 58, + 198, + 119, + 174, + 250, + 184, + 1, + 204, + 200, + 173, + 44, + 238, + 37, + 247, + 170, + 156, + 100, + 254, + 116, + 242, + 28, + 183, + 187, + 77, + 255 ] } } } ] -} +} \ No newline at end of file diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs index bbd5066..5b21057 100644 --- a/integration_tests/src/lib.rs +++ b/integration_tests/src/lib.rs @@ -32,13 +32,11 @@ struct Args { test_name: String, } -pub const ACC_SENDER: &str = "d07ad2e84b27fa00c262f0a1eea0ff35ca0973547e6a106f72f193c2dc838b44"; -pub const ACC_RECEIVER: &str = "e7ae77c5ef1a05999344af499fc78a1705398d62ed06cf2e1479f6def89a39bc"; +pub const ACC_SENDER: &str = "BLgCRDXYdQPMMWVHYRFGQZbgeHx9frkipa8GtpG2Syqy"; +pub const ACC_RECEIVER: &str = "Gj1mJy5W7J5pfmLRujmQaLfLMWidNxQ6uwnhb666ZwHw"; -pub const ACC_SENDER_PRIVATE: &str = - "d360d6b5763f71ac6af56253687fd7d556d5c6c64312e53c0b92ef039a4375df"; -pub const ACC_RECEIVER_PRIVATE: &str = - "f27087ffc29b99035303697dcf6c8e323b1847d4261e6afd49e0d71c6dfa31ea"; +pub const ACC_SENDER_PRIVATE: &str = "3oCG8gqdKLMegw4rRfyaMQvuPHpcASt7xwttsmnZLSkw"; +pub const ACC_RECEIVER_PRIVATE: &str = "AKTcXgJ1xoynta1Ec7y6Jso1z1JQtHqd7aPQ1h9er6xX"; pub const TIME_TO_WAIT_FOR_BLOCK_SECONDS: u64 = 12; diff --git a/integration_tests/src/test_suite_map.rs b/integration_tests/src/test_suite_map.rs index 80bf894..67d78e8 100644 --- a/integration_tests/src/test_suite_map.rs +++ b/integration_tests/src/test_suite_map.rs @@ -25,6 +25,8 @@ use wallet::{ helperfunctions::{fetch_config, fetch_persistent_accounts}, }; +use sequencer_core::sequencer_store::PINATA_BASE58; + use crate::{ ACC_RECEIVER, ACC_RECEIVER_PRIVATE, ACC_SENDER, ACC_SENDER_PRIVATE, NSSA_PROGRAM_FOR_TEST_DATA_CHANGER, TIME_TO_WAIT_FOR_BLOCK_SECONDS, @@ -1315,12 +1317,12 @@ pub fn prepare_function_map() -> HashMap { #[test_suite_fn] pub async fn test_pinata() { info!("test_pinata"); - let pinata_addr = "cafe".repeat(16); + let pinata_addr = PINATA_BASE58; let pinata_prize = 150; let solution = 989106; let command = Command::Pinata(PinataProgramSubcommand::Public( PinataProgramSubcommandPublic::Claim { - pinata_addr: pinata_addr.clone(), + pinata_addr: pinata_addr.to_string(), winner_addr: ACC_SENDER.to_string(), solution, }, @@ -1331,7 +1333,7 @@ pub fn prepare_function_map() -> HashMap { let seq_client = SequencerClient::new(wallet_config.sequencer_addr.clone()).unwrap(); let pinata_balance_pre = seq_client - .get_account_balance(pinata_addr.clone()) + .get_account_balance(pinata_addr.to_string()) .await .unwrap() .balance; @@ -1343,7 +1345,7 @@ pub fn prepare_function_map() -> HashMap { info!("Checking correct balance move"); let pinata_balance_post = seq_client - .get_account_balance(pinata_addr.clone()) + .get_account_balance(pinata_addr.to_string()) .await .unwrap() .balance; @@ -1379,7 +1381,7 @@ pub fn prepare_function_map() -> HashMap { // We pass an uninitialized account and we expect after execution to be owned by the data // changer program (NSSA account claiming mechanism) with data equal to [0] (due to program logic) let data_changer = Program::new(bytecode).unwrap(); - let address: Address = "deadbeef".repeat(8).parse().unwrap(); + let address: Address = "11".repeat(16).parse().unwrap(); let message = nssa::public_transaction::Message::try_new( data_changer.id(), vec![address], @@ -1442,13 +1444,13 @@ pub fn prepare_function_map() -> HashMap { #[test_suite_fn] pub async fn test_pinata_private_receiver() { info!("test_pinata_private_receiver"); - let pinata_addr = "cafe".repeat(16); + let pinata_addr = PINATA_BASE58; let pinata_prize = 150; let solution = 989106; let command = Command::Pinata(PinataProgramSubcommand::Private( PinataProgramSubcommandPrivate::ClaimPrivateOwned { - pinata_addr: pinata_addr.clone(), + pinata_addr: pinata_addr.to_string(), winner_addr: ACC_SENDER_PRIVATE.to_string(), solution, }, @@ -1459,7 +1461,7 @@ pub fn prepare_function_map() -> HashMap { let seq_client = SequencerClient::new(wallet_config.sequencer_addr.clone()).unwrap(); let pinata_balance_pre = seq_client - .get_account_balance(pinata_addr.clone()) + .get_account_balance(pinata_addr.to_string()) .await .unwrap() .balance; @@ -1475,7 +1477,7 @@ pub fn prepare_function_map() -> HashMap { info!("Checking correct balance move"); let pinata_balance_post = seq_client - .get_account_balance(pinata_addr.clone()) + .get_account_balance(pinata_addr.to_string()) .await .unwrap() .balance; @@ -1506,7 +1508,7 @@ pub fn prepare_function_map() -> HashMap { #[test_suite_fn] pub async fn test_pinata_private_receiver_new_account() { info!("test_pinata_private_receiver"); - let pinata_addr = "cafe".repeat(16); + let pinata_addr = PINATA_BASE58; let pinata_prize = 150; let solution = 989106; @@ -1523,7 +1525,7 @@ pub fn prepare_function_map() -> HashMap { let command = Command::Pinata(PinataProgramSubcommand::Private( PinataProgramSubcommandPrivate::ClaimPrivateOwned { - pinata_addr: pinata_addr.clone(), + pinata_addr: pinata_addr.to_string(), winner_addr: winner_addr.to_string(), solution, }, @@ -1534,7 +1536,7 @@ pub fn prepare_function_map() -> HashMap { let seq_client = SequencerClient::new(wallet_config.sequencer_addr.clone()).unwrap(); let pinata_balance_pre = seq_client - .get_account_balance(pinata_addr.clone()) + .get_account_balance(pinata_addr.to_string()) .await .unwrap() .balance; @@ -1546,7 +1548,7 @@ pub fn prepare_function_map() -> HashMap { info!("Checking correct balance move"); let pinata_balance_post = seq_client - .get_account_balance(pinata_addr.clone()) + .get_account_balance(pinata_addr.to_string()) .await .unwrap() .balance; diff --git a/key_protocol/src/key_protocol_core/mod.rs b/key_protocol/src/key_protocol_core/mod.rs index df5502e..b1ebe71 100644 --- a/key_protocol/src/key_protocol_core/mod.rs +++ b/key_protocol/src/key_protocol_core/mod.rs @@ -142,5 +142,10 @@ mod tests { let is_key_chain_generated = user_data.get_private_account(&addr_private).is_some(); assert!(is_key_chain_generated); + + let addr_private_str = addr_private.to_string(); + println!("{addr_private_str:#?}"); + let key_chain = &user_data.get_private_account(&addr_private).unwrap().0; + println!("{key_chain:#?}"); } } diff --git a/nssa/core/src/address.rs b/nssa/core/src/address.rs index 774145e..6355351 100644 --- a/nssa/core/src/address.rs +++ b/nssa/core/src/address.rs @@ -70,29 +70,29 @@ mod tests { #[test] fn parse_valid_address() { - let hex_str = "00".repeat(32); // 64 hex chars = 32 bytes - let addr: Address = hex_str.parse().unwrap(); + let base58_str = "11111111111111111111111111111111"; + let addr: Address = base58_str.parse().unwrap(); assert_eq!(addr.value, [0u8; 32]); } #[test] - fn parse_invalid_hex() { - let hex_str = "zz".repeat(32); // invalid hex chars - let result = hex_str.parse::
().unwrap_err(); + fn parse_invalid_base58() { + let base58_str = "00".repeat(32); // invalid base58 chars + let result = base58_str.parse::
().unwrap_err(); assert!(matches!(result, AddressError::InvalidBase58(_))); } #[test] fn parse_wrong_length_short() { - let hex_str = "00".repeat(31); // 62 chars = 31 bytes - let result = hex_str.parse::
().unwrap_err(); + let base58_str = "11".repeat(31); // 62 chars = 31 bytes + let result = base58_str.parse::
().unwrap_err(); assert!(matches!(result, AddressError::InvalidLength(_))); } #[test] fn parse_wrong_length_long() { - let hex_str = "00".repeat(33); // 66 chars = 33 bytes - let result = hex_str.parse::
().unwrap_err(); + let base58_str = "11".repeat(33); // 66 chars = 33 bytes + let result = base58_str.parse::
().unwrap_err(); assert!(matches!(result, AddressError::InvalidLength(_))); } } diff --git a/sequencer_core/src/sequencer_store/mod.rs b/sequencer_core/src/sequencer_store/mod.rs index 4f18405..186b266 100644 --- a/sequencer_core/src/sequencer_store/mod.rs +++ b/sequencer_core/src/sequencer_store/mod.rs @@ -9,6 +9,8 @@ use crate::config::AccountInitialData; pub mod block_store; +pub const PINATA_BASE58: &str = "EfQhKQAkX2FJiwNii2WFQsGndjvF1Mzd7RuVe7QdPLw7"; + pub struct SequecerChainStore { pub state: nssa::V02State, pub block_store: SequecerBlockStore, @@ -35,7 +37,7 @@ impl SequecerChainStore { let state = { let mut this = nssa::V02State::new_with_genesis_accounts(&init_accs, initial_commitments); - this.add_pinata_program("cafe".repeat(16).parse().unwrap()); + this.add_pinata_program(PINATA_BASE58.parse().unwrap()); this }; diff --git a/sequencer_rpc/src/process.rs b/sequencer_rpc/src/process.rs index 0ff1b00..4147e5c 100644 --- a/sequencer_rpc/src/process.rs +++ b/sequencer_rpc/src/process.rs @@ -434,7 +434,7 @@ mod tests { let request = serde_json::json!({ "jsonrpc": "2.0", "method": "get_account_balance", - "params": { "address": "efac".repeat(16) }, + "params": { "address": "11".repeat(16) }, "id": 1 }); let expected_response = serde_json::json!({ @@ -451,12 +451,12 @@ mod tests { } #[actix_web::test] - async fn test_get_account_balance_for_invalid_hex() { + async fn test_get_account_balance_for_invalid_base58() { let (json_handler, _, _) = components_for_tests(); let request = serde_json::json!({ "jsonrpc": "2.0", "method": "get_account_balance", - "params": { "address": "not_a_valid_hex" }, + "params": { "address": "not_a_valid_base58" }, "id": 1 }); let expected_response = serde_json::json!({ @@ -465,7 +465,7 @@ mod tests { "error": { "code": -32602, "message": "Invalid params", - "data": "invalid hex" + "data": "invalid base58" } }); let response = call_rpc_handler_with_json(json_handler, request).await; @@ -527,7 +527,7 @@ mod tests { let request = serde_json::json!({ "jsonrpc": "2.0", "method": "get_accounts_nonces", - "params": { "addresses": ["efac".repeat(16)] }, + "params": { "addresses": ["11".repeat(16)] }, "id": 1 }); let expected_response = serde_json::json!({ @@ -575,7 +575,7 @@ mod tests { let request = serde_json::json!({ "jsonrpc": "2.0", "method": "get_account", - "params": { "address": "efac".repeat(16) }, + "params": { "address": "11".repeat(16) }, "id": 1 }); let expected_response = serde_json::json!({ diff --git a/wallet/src/chain_storage/mod.rs b/wallet/src/chain_storage/mod.rs index e07ba8e..8fc8805 100644 --- a/wallet/src/chain_storage/mod.rs +++ b/wallet/src/chain_storage/mod.rs @@ -75,19 +75,91 @@ mod tests { use tempfile::tempdir; fn create_initial_accounts() -> Vec { - let initial_acc1 = serde_json::from_str(r#"{ + let initial_acc1 = serde_json::from_str( + r#"{ "Public": { - "address": "d07ad2e84b27fa00c262f0a1eea0ff35ca0973547e6a106f72f193c2dc838b44", - "pub_sign_key": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] + "address": "BLgCRDXYdQPMMWVHYRFGQZbgeHx9frkipa8GtpG2Syqy", + "pub_sign_key": [ + 16, + 162, + 106, + 154, + 236, + 125, + 52, + 184, + 35, + 100, + 238, + 174, + 69, + 197, + 41, + 77, + 187, + 10, + 118, + 75, + 0, + 11, + 148, + 238, + 185, + 181, + 133, + 17, + 220, + 72, + 124, + 77 + ] } - }"#).unwrap(); + }"#, + ) + .unwrap(); - let initial_acc2 = serde_json::from_str(r#"{ + let initial_acc2 = serde_json::from_str( + r#"{ "Public": { - "address": "e7ae77c5ef1a05999344af499fc78a1705398d62ed06cf2e1479f6def89a39bc", - "pub_sign_key": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] + "address": "Gj1mJy5W7J5pfmLRujmQaLfLMWidNxQ6uwnhb666ZwHw", + "pub_sign_key": [ + 113, + 121, + 64, + 177, + 204, + 85, + 229, + 214, + 178, + 6, + 109, + 191, + 29, + 154, + 63, + 38, + 242, + 18, + 244, + 219, + 8, + 208, + 35, + 136, + 23, + 127, + 207, + 237, + 216, + 169, + 190, + 27 + ] } - }"#).unwrap(); + }"#, + ) + .unwrap(); let initial_accounts = vec![initial_acc1, initial_acc2]; diff --git a/wallet/src/cli/account.rs b/wallet/src/cli/account.rs index f801e30..23758d4 100644 --- a/wallet/src/cli/account.rs +++ b/wallet/src/cli/account.rs @@ -217,7 +217,10 @@ impl WalletSubcommand for NewSubcommand { .get_private_account(&addr) .unwrap(); - println!("Generated new account with addr {}", addr.to_bytes().to_base58()); + println!( + "Generated new account with addr {}", + addr.to_bytes().to_base58() + ); println!("With npk {}", hex::encode(&key.nullifer_public_key.0)); println!( "With ipk {}",