Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Mar 27, 2024
1 parent 254832d commit 5697e6a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
12 changes: 8 additions & 4 deletions sdk/src/client/api/block_builder/transaction_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,14 @@ impl TransactionBuilder {
return Err(TransactionBuilderError::InvalidInputCount(self.selected_inputs.len()));
}

let remainder_address = self
.get_remainder_address()?
.ok_or(TransactionBuilderError::MissingInputWithEd25519Address)?
.0;
let remainder_address = match self.get_remainder_address()? {
Some(a) => a,
None => {
log::debug!("MissingInputWithEd25519Address from finish");
return Err(TransactionBuilderError::MissingInputWithEd25519Address);
}
}
.0;

let mut added_amount_mana = HashMap::<Option<ChainId>, (u64, u64)>::new();
for (chain_id, added_amount) in self.remainders.added_amount.drain() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ impl TransactionBuilder {
mana_diff = mana_diff.saturating_sub(self.initial_mana_excess()?);
}

let (remainder_address, chain) = self
.get_remainder_address()?
.ok_or(TransactionBuilderError::MissingInputWithEd25519Address)?;
let (remainder_address, chain) = match self.get_remainder_address()? {
Some(a) => a,
None => {
log::debug!("MissingInputWithEd25519Address from update_remainders");
return Err(TransactionBuilderError::MissingInputWithEd25519Address);
}
};

// Amount can be just multiplied, because all remainder outputs with a native token have the same storage
// cost.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ impl TransactionBuilder {
// than the current block index
match &required_address {
Address::Ed25519(_) | Address::ImplicitAccountCreation(_) => {}
_ => Err(TransactionBuilderError::MissingInputWithEd25519Address)?,
_ => {
log::debug!("MissingInputWithEd25519Address from null_transaction_unlocks required_address {required_address:?}");
Err(TransactionBuilderError::MissingInputWithEd25519Address)?
}
}

let block = SignatureUnlock::new(
Expand Down
5 changes: 4 additions & 1 deletion sdk/src/client/secret/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,10 @@ where
// than the current block index
match &required_address {
Address::Ed25519(_) | Address::ImplicitAccountCreation(_) => {}
_ => Err(TransactionBuilderError::MissingInputWithEd25519Address)?,
_ => {
log::debug!("MissingInputWithEd25519Address from default_transaction_unlocks, required_address {required_address:?}");
Err(TransactionBuilderError::MissingInputWithEd25519Address)?
}
}

let chain = input.chain.ok_or(ClientError::MissingBip32Chain)?;
Expand Down

0 comments on commit 5697e6a

Please sign in to comment.