mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-02 06:46:06 -04:00
Remove rng argument
This commit is contained in:
parent
6c0df836ca
commit
66866f8fbd
2 changed files with 36 additions and 33 deletions
|
@ -416,8 +416,14 @@ impl State {
|
|||
redeem_address: bitcoin::Address,
|
||||
punish_address: bitcoin::Address,
|
||||
) -> Self {
|
||||
let a = bitcoin::SecretKey::new_random(rng);
|
||||
let s_a = cross_curve_dleq::Scalar::random(rng);
|
||||
let v_a = monero::PrivateViewKey::new_random(rng);
|
||||
|
||||
Self::State0(State0::new(
|
||||
rng,
|
||||
a,
|
||||
s_a,
|
||||
v_a,
|
||||
btc,
|
||||
xmr,
|
||||
refund_timelock,
|
||||
|
@ -443,8 +449,10 @@ pub struct State0 {
|
|||
}
|
||||
|
||||
impl State0 {
|
||||
pub fn new<R: RngCore + CryptoRng>(
|
||||
rng: &mut R,
|
||||
pub fn new(
|
||||
a: bitcoin::SecretKey,
|
||||
s_a: cross_curve_dleq::Scalar,
|
||||
v_a: monero::PrivateViewKey,
|
||||
btc: bitcoin::Amount,
|
||||
xmr: monero::Amount,
|
||||
refund_timelock: u32,
|
||||
|
@ -452,11 +460,6 @@ impl State0 {
|
|||
redeem_address: bitcoin::Address,
|
||||
punish_address: bitcoin::Address,
|
||||
) -> Self {
|
||||
let a = bitcoin::SecretKey::new_random(rng);
|
||||
|
||||
let s_a = cross_curve_dleq::Scalar::random(rng);
|
||||
let v_a = monero::PrivateViewKey::new_random(rng);
|
||||
|
||||
Self {
|
||||
a,
|
||||
s_a,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue