pub fn verify_signature(
	_p_hash: &Vec<u8>,
	_amount: u128,
	_to: &Vec<u8>,
	_n_hash: &Vec<u8>,
	_sig: &Vec<u8>,
) -> bool {
	let ren_btc_identifier = hex::decode(RENVM_BTC_IDENTIFIER).unwrap();

	let encoded = encode(
		_p_hash,
		_amount, // _amount,
		&ren_btc_identifier, // _token
		_to,
		_n_hash
	);

	let signed_message_hash = keccak(&encoded[..]);
	let recovered_address = ecrecover(signed_message_hash, _sig).unwrap();

	// Expected address is RenVM's split public key.
	let expected_address = hex::decode(RENVM_SPLIT_PUBLIC_KEY).unwrap();

	return recovered_address.eq(&expected_address);
}
// Verify that the signature has been signed by RenVM.
Verify that the signature has been signed by RenVM.
Verify that the signature has been signed by RenVM .
pub fn verify_signature(
	_p_hash: &Vec<u8>,
	_amount: u128,
	_to: &Vec<u8>,
	_n_hash: &Vec<u8>,
	_sig: &Vec<u8>,
) -> bool {
	let ren_btc_identifier = hex::decode(RENVM_BTC_IDENTIFIER).unwrap();
	let encoded = encode(
		_p_hash,
		_amount, // _amount,
		&ren_btc_identifier, // _token
		_to,
		_n_hash
	);
	let signed_message_hash = keccak(&encoded[..]);
	let recovered_address = ecrecover(signed_message_hash, _sig).unwrap();
	// Expected address is RenVM's split public key.
	let expected_address = hex::decode(RENVM_SPLIT_PUBLIC_KEY).unwrap();
	return recovered_address.eq(&expected_address);
}
pub fn verify_signature ( _p_hash : & Vec < u8 > , _amount : u128 , _to : & Vec < u8 > , _n_hash : & Vec < u8 > , _sig : & Vec < u8 > , ) -> bool { let ren_btc_identifier = hex :: decode ( RENVM_BTC_IDENTIFIER ) . unwrap ( ) ; let encoded = encode ( _p_hash , _amount , // _amount, & ren_btc_identifier , // _token _to , _n_hash ) ; let signed_message_hash = keccak ( & encoded [ .. ] ) ; let recovered_address = ecrecover ( signed_message_hash , _sig ) . unwrap ( ) ; // Expected address is RenVM's split public key. let expected_address = hex :: decode ( RENVM_SPLIT_PUBLIC_KEY ) . unwrap ( ) ; return recovered_address . eq ( & expected_address ) ; }
Verify that the signature has been signed by RenVM.
Verify that the signature has been signed by RenVM .
_p_hash
&Vec<u8>
_amount
u128
_to
&Vec<u8>
_n_hash
&Vec<u8>
_sig
&Vec<u8>
_p_hash
&Vec<u8>
_amount
u128
_to
&Vec<u8>
_n_hash
&Vec<u8>
_sig
&Vec<u8>