Skip to content

Commit

Permalink
fix: genesis reissue failure in mint_repl
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach authored and davidrusu committed Feb 2, 2023
1 parent 11ea7f5 commit 6e501fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions examples/mint-repl/mint-repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,7 @@ fn reissue_auto_cli(mintinfo: &mut MintInfo) -> Result<()> {
let max_outputs: usize =
readline_prompt_default("\nMax number of outputs [2]: ", "2")?.parse()?;

println!(
"\ninputs to outputs. value wallet sb::random_decoys sb::log_spent total"
);
println!("\ninputs to outputs. value wallet sb::log_spent total");

for _i in 1..=num_reissues {
let iter_time_start = SystemTime::now();
Expand Down Expand Up @@ -761,10 +759,15 @@ fn reissue_auto_cli(mintinfo: &mut MintInfo) -> Result<()> {
let log_spent_start = SystemTime::now();
let spent_proof_share = spentbook_node.log_spent(public_key, tx.clone())?;
log_spent_duration += log_spent_start.elapsed().unwrap();
dbc_builder = dbc_builder.add_spent_proof_share(spent_proof_share);
dbc_builder = dbc_builder
.add_spent_proof_share(spent_proof_share)
.add_spent_transaction(tx.clone());
}
}
let outputs = dbc_builder.build(&mintinfo.spentbook()?.key_manager)?;
let outputs = match &input_dbcs[..] {
[dbc] if dbc == &mintinfo.genesis => dbc_builder.build_without_verifying()?,
_ => dbc_builder.build(&mintinfo.spentbook()?.key_manager)?,
};
let output_dbcs: Vec<Dbc> = outputs.into_iter().map(|(dbc, ..)| dbc).collect();

for dbc in input_dbcs.iter() {
Expand Down
2 changes: 1 addition & 1 deletion src/dbc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ use crate::{
/// from the user (owned). Subsequent code is then the same for both
/// types.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Dbc {
pub content: DbcContent,
pub transaction: DbcTransaction,
Expand Down

0 comments on commit 6e501fe

Please sign in to comment.