Remove rng argument

This commit is contained in:
Franck Royer 2020-11-25 14:37:37 +11:00 committed by rishflab
parent 6c0df836ca
commit 66866f8fbd
2 changed files with 36 additions and 33 deletions

View file

@ -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,