Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrobot committed Dec 2, 2024
1 parent 86a73e6 commit e90514b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions packages/injective-testing/src/multi_test/address_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,34 +76,16 @@ pub fn generate_inj_address() -> Addr {

let public_key = PublicKey::from_secret_key(&secp256k1, &secret_key);

// let mut rng = OsRng::new().expect("failed to create new random number generator");
// let (_, public_key) = secp256k1.generate_keypair(&mut rng).expect("failed to generate key pair");

// println!("public key: {:?}", public_key);

let public_key_array = &public_key.serialize()[1..];
// let public_key_array = &public_key.serialize_vec(&secp256k1, true)[1..];

// let public_key_array = &public_key_array[1..];

println!("public key array: {:?}", public_key_array);

let keccak = tiny_keccak::keccak256(public_key_array);

println!("keccak: {:?}", keccak);

let address_short = to_hex_string(&keccak[ADDRESS_BYTE_INDEX..], 40); // get rid of the constant 0x04 byte
println!("address_short: {:?}", address_short);
let full_address = format!("0x{address_short}");

println!("full_address: {:?}", full_address);

let inj_address = addr_to_bech32(full_address);

println!("inj_address: {:?}", inj_address);

Addr::unchecked(inj_address)
// Addr::unchecked("inj123")
}

fn to_hex_string(slice: &[u8], expected_string_size: usize) -> String {
Expand Down

0 comments on commit e90514b

Please sign in to comment.