Compare commits

..

No commits in common. "1b5d16864723dda22ce12fc31a253c03b6698499" and "adf1e680064d5db773a2d792835b09614bb3c265" have entirely different histories.

2 changed files with 18 additions and 23 deletions

View File

@ -168,7 +168,7 @@ fn seda_chains() -> Vec<Blockchain> {
let mut chains = vec![]; let mut chains = vec![];
let aseda = Currency::builder() let aseda = Currency::builder()
.coin_denom("SEDA") .coin_denom("seda")
.coin_minimal_denom("aseda") .coin_minimal_denom("aseda")
.coin_decimals(18) .coin_decimals(18)
.coin_gecko_id("ID") .coin_gecko_id("ID")

View File

@ -439,6 +439,14 @@ impl Payload {
for issuer in signature.issuer_fingerprints() { for issuer in signature.issuer_fingerprints() {
let mut currently_seen = std::collections::HashMap::new(); let mut currently_seen = std::collections::HashMap::new();
for cert in &certs { for cert in &certs {
if let Some(seen_index) = seen.get(&cert.fingerprint()) {
return Err(BaseError::DuplicateSignature(
cert.fingerprint(),
index,
*seen_index,
)
.into());
}
match cert match cert
.with_policy(&policy, None)? .with_policy(&policy, None)?
.keys() .keys()
@ -448,29 +456,16 @@ impl Payload {
.next() .next()
.map(|signing_key| signature.verify_hash(&signing_key, hashed.clone())) .map(|signing_key| signature.verify_hash(&signing_key, hashed.clone()))
{ {
Some(result) => { Some(Ok(())) => {
// matching key found, check for duplicates // key found, signature matched
if let Some(seen_index) = seen.get(&cert.fingerprint()) { signature_matched = true;
return Err(BaseError::DuplicateSignature(
cert.fingerprint(),
index,
*seen_index,
)
.into());
}
match result { // mark the cert as seen, so it isn't reusable
Ok(()) => { currently_seen.insert(cert.fingerprint(), index);
signature_matched = true; }
Some(Err(e)) => {
// mark the cert as seen, so it isn't reusable if error_on_invalid {
currently_seen.insert(cert.fingerprint(), index); return Err(e)?;
}
Err(e) => {
if error_on_invalid {
return Err(e)?;
}
}
} }
} }
None => { None => {