Skip to content

Commit

Permalink
test: update broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sander2 committed Apr 14, 2022
1 parent c06b383 commit b03c853
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 33 deletions.
2 changes: 2 additions & 0 deletions bitcoin/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ mod tests {
async fn is_block_known(&self, block_hash: BlockHash) -> Result<bool, Error>;
async fn get_new_address<A: PartialAddress + Send + 'static>(&self) -> Result<A, Error>;
async fn get_new_public_key<P: From<[u8; PUBLIC_KEY_SIZE]> + 'static>(&self) -> Result<P, Error>;
fn dump_derivation_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P) -> Result<PrivateKey, Error>;
fn import_derivation_key(&self, private_key: &PrivateKey) -> Result<(), Error>;
async fn add_new_deposit_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(
&self,
public_key: P,
Expand Down
9 changes: 9 additions & 0 deletions runtime/src/integration/bitcoin_simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,15 @@ impl BitcoinCoreApi for MockBitcoinCore {
let public_key = PublicKey::from_secret_key(&secp, &secret_key);
Ok(P::from(public_key.serialize()))
}
fn dump_derivation_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(
&self,
public_key: P,
) -> Result<PrivateKey, BitcoinError> {
todo!()
}
fn import_derivation_key(&self, private_key: &PrivateKey) -> Result<(), BitcoinError> {
todo!()
}
async fn add_new_deposit_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(
&self,
_public_key: P,
Expand Down
2 changes: 0 additions & 2 deletions vault/src/collateral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ mod tests {
id: x.clone(),
wallet: Wallet {
addresses: Default::default(),
public_key: BtcPublicKey { 0: [0; 33] },
},
status: VaultStatus::Active(true),
banned_until: None,
Expand Down Expand Up @@ -338,7 +337,6 @@ mod tests {
id: x.clone(),
wallet: Wallet {
addresses: Default::default(),
public_key: BtcPublicKey { 0: [0; 33] },
},
status: VaultStatus::CommittedTheft,
banned_until: None,
Expand Down
2 changes: 2 additions & 0 deletions vault/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ mod tests {
async fn is_block_known(&self, block_hash: BlockHash) -> Result<bool, BitcoinError>;
async fn get_new_address<A: PartialAddress + Send + 'static>(&self) -> Result<A, BitcoinError>;
async fn get_new_public_key<P: From<[u8; PUBLIC_KEY_SIZE]> + 'static>(&self) -> Result<P, BitcoinError>;
fn dump_derivation_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P) -> Result<PrivateKey, BitcoinError>;
fn import_derivation_key(&self, private_key: &PrivateKey) -> Result<(), BitcoinError>;
async fn add_new_deposit_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P, secret_key: Vec<u8>) -> Result<(), BitcoinError>;
async fn get_best_block_hash(&self) -> Result<BlockHash, BitcoinError>;
async fn get_block(&self, hash: &BlockHash) -> Result<Block, BitcoinError>;
Expand Down
5 changes: 3 additions & 2 deletions vault/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ mod tests {
async fn get_vault(&self, vault_id: &VaultId) -> Result<InterBtcVault, RuntimeError>;
async fn get_vaults_by_account_id(&self, account_id: &AccountId) -> Result<Vec<VaultId>, RuntimeError>;
async fn get_all_vaults(&self) -> Result<Vec<InterBtcVault>, RuntimeError>;
async fn register_vault(&self, vault_id: &VaultId, collateral: u128, public_key: BtcPublicKey) -> Result<(), RuntimeError>;
async fn register_vault(&self, vault_id: &VaultId, collateral: u128) -> Result<(), RuntimeError>;
async fn deposit_collateral(&self, vault_id: &VaultId, amount: u128) -> Result<(), RuntimeError>;
async fn withdraw_collateral(&self, vault_id: &VaultId, amount: u128) -> Result<(), RuntimeError>;
async fn get_public_key(&self) -> Result<Option<BtcPublicKey>, RuntimeError>;
Expand Down Expand Up @@ -803,6 +803,8 @@ mod tests {
async fn is_block_known(&self, block_hash: BlockHash) -> Result<bool, BitcoinError>;
async fn get_new_address<A: PartialAddress + Send + 'static>(&self) -> Result<A, BitcoinError>;
async fn get_new_public_key<P: From<[u8; PUBLIC_KEY_SIZE]> + 'static>(&self) -> Result<P, BitcoinError>;
fn dump_derivation_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P) -> Result<PrivateKey, BitcoinError>;
fn import_derivation_key(&self, private_key: &PrivateKey) -> Result<(), BitcoinError>;
async fn add_new_deposit_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P, secret_key: Vec<u8>) -> Result<(), BitcoinError>;
async fn get_best_block_hash(&self) -> Result<BlockHash, BitcoinError>;
async fn get_block(&self, hash: &BlockHash) -> Result<Block, BitcoinError>;
Expand Down Expand Up @@ -924,7 +926,6 @@ mod tests {
id: x.clone(),
wallet: Wallet {
addresses: Default::default(),
public_key: BtcPublicKey { 0: [0; 33] },
},
status: VaultStatus::Active(true),
banned_until: None,
Expand Down
2 changes: 2 additions & 0 deletions vault/src/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ mod tests {
async fn is_block_known(&self, block_hash: BlockHash) -> Result<bool, BitcoinError>;
async fn get_new_address<A: PartialAddress + Send + 'static>(&self) -> Result<A, BitcoinError>;
async fn get_new_public_key<P: From<[u8; PUBLIC_KEY_SIZE]> + 'static>(&self) -> Result<P, BitcoinError>;
fn dump_derivation_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P) -> Result<PrivateKey, BitcoinError>;
fn import_derivation_key(&self, private_key: &PrivateKey) -> Result<(), BitcoinError>;
async fn add_new_deposit_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(
&self,
public_key: P,
Expand Down
2 changes: 2 additions & 0 deletions vault/src/vaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ mod tests {
async fn is_block_known(&self, block_hash: BlockHash) -> Result<bool, BitcoinError>;
async fn get_new_address<A: PartialAddress + Send + 'static>(&self) -> Result<A, BitcoinError>;
async fn get_new_public_key<P: From<[u8; PUBLIC_KEY_SIZE]> + 'static>(&self) -> Result<P, BitcoinError>;
fn dump_derivation_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(&self, public_key: P) -> Result<PrivateKey, BitcoinError>;
fn import_derivation_key(&self, private_key: &PrivateKey) -> Result<(), BitcoinError>;
async fn add_new_deposit_key<P: Into<[u8; PUBLIC_KEY_SIZE]> + Send + Sync + 'static>(
&self,
public_key: P,
Expand Down
Loading

0 comments on commit b03c853

Please sign in to comment.