Skip to content

Commit

Permalink
Merge pull request #84 from PeggyJV/zaki/clean-up-rust-signing
Browse files Browse the repository at this point in the history
clean signing code for MsgDelegateKeys on the rust side
  • Loading branch information
zmanian authored Jul 20, 2021
2 parents 30a2517 + 2598968 commit 8ac5701
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions orchestrator/cosmos_gravity/src/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ pub async fn update_gravity_delegate_addresses(
validator_address: our_valoper_address.clone(),
nonce:*sequence,
};
let mut bytes = Vec::new();


eth_sign_msg.encode(&mut bytes).map_err(|x|CosmosGrpcError::BadInput(x.to_string()))?;

let eth_signature = eth_private_key.sign_ethereum_msg(&bytes).to_bytes().to_vec();
let size = Message::encoded_len(&eth_sign_msg);
let mut buf = BytesMut::with_capacity(size);
Message::encode(&eth_sign_msg, &mut buf).expect("Failed to encode DelegateKeysSignMsg!");

let eth_signature = eth_private_key.sign_ethereum_msg(&buf).to_bytes().to_vec();



Expand Down

0 comments on commit 8ac5701

Please sign in to comment.