Skip to content

Commit

Permalink
Merge pull request #131 from sander2/fix/broken-error-checking-test
Browse files Browse the repository at this point in the history
test: disable broken test
  • Loading branch information
sander2 authored Jun 1, 2021
2 parents ab79388 + 1ae7a35 commit 1b5ce45
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
24 changes: 22 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ substrate-subxt-client = { git = "https://github.com/interlay/substrate-subxt",
btc-parachain = { git = "https://github.com/interlay/btc-parachain", branch = "master", features = ["aura-grandpa"] }
btc-parachain-service = { git = "https://github.com/interlay/btc-parachain", branch = "master", features = ["aura-grandpa"] }
tempdir = "0.3.7"
env_logger = "0.8.3"
13 changes: 9 additions & 4 deletions runtime/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,17 @@ impl PolkaBtcProvider {
}

#[cfg(test)]
async fn get_outdated_nonce_error(&self) -> Error {
let signer = {
pub async fn get_outdated_nonce_error(&self) -> Error {
let signer: PolkaBtcSigner = {
let mut signer = self.signer.write().await;
signer.set_nonce(1);
signer.set_nonce(0);
signer.clone()
};
self::set_redeem_period(2).unwrap_err()
self.ext_client
.withdraw_replace_and_watch(&signer, 23)
.await
.unwrap_err()
.into()
}
}

Expand Down
11 changes: 9 additions & 2 deletions runtime/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ async fn test_getters() {
}

#[tokio::test]
#[ignore]
async fn test_outdated_nonce_matching() {
env_logger::init();
let (client, _tmp_dir) = default_provider_client(AccountKeyring::Alice).await;
let provider = setup_provider(client.clone(), AccountKeyring::Alice).await;
set_exchange_rate(client.clone()).await;
assert!(provider.get_outdated_nonce_error().is_outdated_nonce())
provider
.set_exchange_rate_info(FixedU128::saturating_from_rational(1u128, 100u128))
.await
.unwrap();
let err = provider.get_outdated_nonce_error().await;
log::error!("Error: {:?}", err);
assert!(err.is_outdated_nonce())
}

#[tokio::test]
Expand Down

0 comments on commit 1b5ce45

Please sign in to comment.