Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Velnbur committed Nov 26, 2024
1 parent 90eb572 commit d91767d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 2 additions & 4 deletions nero-core/src/claim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ impl Claim {
Self {
amount: ctx.staked_amount
+ fee_rate
.checked_mul_by_weight(
ctx.assert_tx_weight + ctx.largest_disprove_weight,
)
.checked_mul_by_weight(ctx.assert_tx_weight + ctx.largest_disprove_weight)
.unwrap(),
operator_pubkey: ctx.operator_pubkey.into(),
comittee_aggpubkey: ctx.comittee_aggpubkey(),
Expand Down Expand Up @@ -214,7 +212,7 @@ impl FundedClaim {

taptree
.control_block(&(
self.optimistic_payout_script().to_script(),
self.optimistic_payout_script().to_script(),
LeafVersion::TapScript,
))
.expect("taptree was constructed including assert script!")
Expand Down
19 changes: 15 additions & 4 deletions nero-core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ use bitcoin_splitter::split::script::SplitableScript;
use musig2::{secp::Point, KeyAggContext};

use crate::{
assert::Assert, disprove::{
assert::Assert,
disprove::{
form_disprove_scripts_distorted_with_seed, form_disprove_scripts_with_seed,
signing::SignedIntermediateState, Disprove, DisproveScript,
}, payout::PAYOUT_APPROX_WEIGHT, treepp::*
},
payout::PAYOUT_APPROX_WEIGHT,
treepp::*,
};

/// Global context of BitVM2 flow.
Expand Down Expand Up @@ -133,7 +136,11 @@ impl<S: SplitableScript, C: Verification> Context<S, C> {
secp: ctx,
operator_pubkey,
operator_script_pubkey,
largest_disprove_weight: disprove_txs.iter().map(|tx| tx.compute_weigth()).max().unwrap(),
largest_disprove_weight: disprove_txs
.iter()
.map(|tx| tx.compute_weigth())
.max()
.unwrap(),
disprove_scripts,
claim_challenge_period,
assert_challenge_period,
Expand Down Expand Up @@ -211,7 +218,11 @@ impl<S: SplitableScript, C: Verification> Context<S, C> {
secp: ctx,
operator_pubkey,
operator_script_pubkey,
largest_disprove_weight: disprove_txs.iter().map(|tx| tx.compute_weigth()).max().unwrap(),
largest_disprove_weight: disprove_txs
.iter()
.map(|tx| tx.compute_weigth())
.max()
.unwrap(),
disprove_scripts,
claim_challenge_period,
assert_challenge_period,
Expand Down
1 change: 0 additions & 1 deletion nero-core/src/disprove/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ impl SignedIntermediateState {
}
}


/// Script for verification of the witness script. Additionally,
/// the verification leaves the original stack and altstack of
/// the intermediate state.
Expand Down

0 comments on commit d91767d

Please sign in to comment.