Skip to content

Commit

Permalink
add how to register tx ICQ contract
Browse files Browse the repository at this point in the history
  • Loading branch information
sotnikov-s committed Nov 8, 2024
1 parent 9918d0f commit 100af21
Show file tree
Hide file tree
Showing 13 changed files with 1,196 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
integration-test = "test --test integration"
schema = "run --example contracts/docs/interchainqueries/howto/register_kv_icq-schema"
34 changes: 34 additions & 0 deletions contracts/docs/interchainqueries/howto/register_tx_icq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "howto_register_tx_icq"
version = "0.1.0"
edition = "2021"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib", "rlib"]

[features]
library = []

[dependencies]
cosmwasm-std = { workspace = true, features = ["stargate", "staking"] }
cw2 = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
neutron-sdk = { workspace = true }
neutron-std = { workspace = true }
cosmos-sdk-proto = { workspace = true }
cw-storage-plus = { workspace = true }
prost = { workspace = true }
serde-json-wasm = { workspace = true }

[dev-dependencies]
base64 = { workspace = true }
cosmwasm-schema = { workspace = true }
11 changes: 11 additions & 0 deletions contracts/docs/interchainqueries/howto/register_tx_icq/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Validators Registry

CURRENT_DIR = $(shell pwd)
CURRENT_DIR_RELATIVE = $(notdir $(shell pwd))

clippy:
rustup component add clippy || true
cargo clippy --all-targets --all-features --workspace -- -D warnings

test: clippy
cargo unit-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# HowTo register a TX Interchain Query contract

A simple contract that implements the flow described in the [How to register a TX Interchain Query](https://docs.neutron.org/neutron/modules/interchain-queries/how-to#how-to-register-a-tx-interchain-query) documentation section.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2022 Neutron
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, remove_schemas, schema_for};
use howto_register_kv_icq::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(ExecuteMsg), &out_dir);
export_schema(&schema_for!(QueryMsg), &out_dir);
}
Loading

0 comments on commit 100af21

Please sign in to comment.