Crates.io | renvm-sig |
lib.rs | renvm-sig |
version | 0.1.1 |
source | src |
created_at | 2021-05-18 19:05:42.329124 |
updated_at | 2021-06-10 11:04:17.405349 |
description | A library to construct mock RenVM signatures for cross-chain lock-and-mint operations |
homepage | |
repository | |
max_upload_size | |
id | 399092 |
size | 10,544 |
A library to construct mock RenVm signatures for cross-chain lock-and-mint operations.
$ cargo build
let renvm = RenVm::random();
let renvm_msg = RenVmMsgBuilder::default().build().unwrap();
let _renvm_sig = renvm.sign(&renvm_msg).unwrap();
let sk_bytes = [0u8; 32];
let _renvm = RenVm::from_bytes(&sk_bytes).unwrap();
let sk = "0x0000000000000000000000000000000000000000000000000000000000000000";
let _renvm = RenVm::from_str(sk).unwrap();
// RenVm message structure
// | p_hash | amount | s_hash | to | n_hash |
// | 32 | 8 | 32 | 32 | 32 |
// random `to` and `n_hash`
let (p_hash, amount, s_hash) = ([0u8; 32], 0u64, [0u8; 32]);
let _renvm_msg = RenVmMsgBuilder::default()
.p_hash(p_hash)
.amount(amount)
.s_hash(s_hash)
.build()
.unwrap();