Skip to content

Commit

Permalink
fix queries Height struct used in sudo calls
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 17, 2024
1 parent 6c17bc8 commit 766672c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion contracts/neutron_interchain_queries/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use neutron_sdk::interchain_queries::helpers::{
remove_interchain_query as helpers_remove_interchain_query,
update_interchain_query as helpers_update_interchain_query,
};
use neutron_sdk::interchain_queries::sudo::Height;
use neutron_sdk::interchain_queries::types::{
QueryPayload, TransactionFilterItem, TransactionFilterOp, TransactionFilterValue,
};
Expand All @@ -57,7 +58,6 @@ use neutron_sdk::interchain_queries::v047::register_queries::{
use neutron_sdk::interchain_queries::v047::types::{COSMOS_SDK_TRANSFER_MSG_URL, RECIPIENT_FIELD};
use neutron_sdk::sudo::msg::SudoMsg;
use neutron_sdk::{NeutronError, NeutronResult};
use neutron_std::types::ibc::core::client::v1::Height;
use neutron_std::types::neutron::interchainqueries::KvKey;
use prost::Message as ProstMessage;

Expand Down
5 changes: 3 additions & 2 deletions contracts/neutron_interchain_queries/src/testing/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use cosmwasm_std::{
};
use neutron_sdk::interchain_queries::helpers::{decode_and_convert, kv_key_from_string};
use neutron_sdk::interchain_queries::hex::decode_hex;
use neutron_sdk::interchain_queries::sudo::Height as QueriesHeight;
use neutron_sdk::interchain_queries::types::{
QueryType, TransactionFilterItem, TransactionFilterOp, TransactionFilterValue,
};
Expand Down Expand Up @@ -1032,7 +1033,7 @@ fn test_sudo_tx_query_result_callback() {
let env = mock_env();
let watched_addr: String = "neutron1fj6yqrkpw6fmp7f7jhj57dujfpwal4m25dafzx".to_string();
let query_id: u64 = 1u64;
let height = Height {
let height = QueriesHeight {
revision_number: 0u64,
revision_height: 1u64,
};
Expand Down Expand Up @@ -1136,7 +1137,7 @@ fn test_sudo_tx_query_result_min_height_callback() {
let env = mock_env();
let watched_addr: String = "neutron1fj6yqrkpw6fmp7f7jhj57dujfpwal4m25dafzx".to_string();
let query_id: u64 = 1u64;
let height = Height {
let height = QueriesHeight {
revision_number: 0u64,
revision_height: 1u64,
};
Expand Down
9 changes: 3 additions & 6 deletions contracts/neutron_interchain_txs/schema/sudo_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,18 @@
"type": "string"
},
"Height": {
"description": "Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients\n\nNormally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset",
"type": "object",
"required": [
"revision_height",
"revision_number"
],
"properties": {
"revision_height": {
"description": "the height within the given revision",
"description": "*height** is a height of remote chain",
"default": 0,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"revision_number": {
"description": "the revision that the client is currently on",
"default": 0,
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
9 changes: 3 additions & 6 deletions contracts/neutron_validator_test/schema/sudo_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,18 @@
"type": "string"
},
"Height": {
"description": "Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients\n\nNormally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset",
"type": "object",
"required": [
"revision_height",
"revision_number"
],
"properties": {
"revision_height": {
"description": "the height within the given revision",
"description": "*height** is a height of remote chain",
"default": 0,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"revision_number": {
"description": "the revision that the client is currently on",
"default": 0,
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
2 changes: 1 addition & 1 deletion contracts/neutron_validator_test/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use cosmwasm_std::{
use cw2::set_contract_version;
use neutron_sdk::interchain_queries::helpers::remove_interchain_query as helpers_remove_interchain_query;
use neutron_sdk::interchain_queries::queries::get_registered_query;
use neutron_sdk::interchain_queries::sudo::Height;
use neutron_sdk::interchain_queries::types::{
TransactionFilterItem, TransactionFilterOp, TransactionFilterValue,
};
Expand All @@ -53,7 +54,6 @@ use neutron_sdk::{NeutronError, NeutronResult};
use neutron_std::shim::Any;
use neutron_std::types::cosmos::base::v1beta1::Coin as CosmosCoin;
use neutron_std::types::ibc::core::channel::v1::Order;
use neutron_std::types::ibc::core::client::v1::Height;
use neutron_std::types::neutron::feerefunder::Fee;
use neutron_std::types::neutron::interchainqueries::RegisteredQuery;
use neutron_std::types::neutron::interchaintxs::v1::{InterchaintxsQuerier, MsgSubmitTxResponse};
Expand Down

0 comments on commit 766672c

Please sign in to comment.