bug: fix updater always failing

buddies-main-deployment
James Prestwich 3 years ago
parent e4debf261f
commit e8ea331203
No known key found for this signature in database
GPG Key ID: 7CC174C250AD83AD
  1. 7
      rust/updater/src/updater.rs

@ -2,7 +2,7 @@ use std::{sync::Arc, time::Duration};
use async_trait::async_trait; use async_trait::async_trait;
use color_eyre::{ use color_eyre::{
eyre::{ensure, eyre, Context}, eyre::{bail, ensure, Context},
Result, Result,
}; };
use ethers::{core::types::H256, signers::Signer, types::Address}; use ethers::{core::types::H256, signers::Signer, types::Address};
@ -119,8 +119,9 @@ impl UpdateHandler {
// can check and enter the below `if` block at a time, // can check and enter the below `if` block at a time,
// protecting from races between threads. // protecting from races between threads.
self.check_conflict(&update) if self.check_conflict(&update).is_some() {
.ok_or_else(|| eyre!("Found conflicting update in DB"))?; bail!("Found conflicting update in DB");
}
// If we have a conflict, we grab that one instead // If we have a conflict, we grab that one instead
let signed = update.sign_with(self.signer.as_ref()).await.unwrap(); let signed = update.sign_with(self.signer.as_ref()).await.unwrap();

Loading…
Cancel
Save