Skip to content

Commit

Permalink
Make sure all output token ids are actually configured
Browse files Browse the repository at this point in the history
Fixes #1868
  • Loading branch information
cbeck88 committed Apr 27, 2022
1 parent 36ed515 commit 97ec8f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions consensus/enclave/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,15 @@ impl ConsensusEnclave for SgxConsensusEnclave {
let minimum_fee = ct_min_fee_map
.get(&fee_token_id)
.ok_or(TransactionValidationError::TokenNotYetConfigured)?;

// Make sure any extra token ids that appear in the outputs are also already
// configured. (this was github issue #1868)
for token_id in tx.signature.output_token_ids.iter() {
ct_min_fee_map
.get(&TokenId::from(token_id))
.ok_or(TransactionValidationError::TokenNotYetConfigured)?;
}

mc_transaction_core::validation::validate(
&tx,
block_index,
Expand Down

0 comments on commit 97ec8f0

Please sign in to comment.