Skip to content

Commit

Permalink
test(router): add golden test for chain not found failure (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth authored Jan 8, 2025
1 parent d13adec commit a7cb956
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 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 contracts/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ thiserror = { workspace = true }
assert_ok = { workspace = true }
axelar-core-std = { workspace = true, features = ["test"] }
cw-multi-test = { workspace = true }
goldie = { workspace = true }
hex = { version = "0.4.3", default-features = false }
integration-tests = { workspace = true }
rand = { workspace = true }
Expand Down
15 changes: 15 additions & 0 deletions contracts/router/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1823,4 +1823,19 @@ mod test {
)
.is_ok());
}

#[test]
fn chain_info_fails_on_unregistered_chain() {
let deps = setup();
let unregistered_chain: ChainName = "unregistered".parse().unwrap();

// Ensure that the error message doesn't change unexpectedly since the relayer depends on it
let err = query(
deps.as_ref(),
mock_env(),
QueryMsg::ChainInfo(unregistered_chain),
)
.unwrap_err();
goldie::assert!(err.to_string());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chain is not found

0 comments on commit a7cb956

Please sign in to comment.