Skip to content

Commit f188468

Browse files
authored
Merge pull request #78 from neutron-org/feat/tf2
Feat: coinfactory contract
2 parents f59a062 + 8b2e156 commit f188468

File tree

31 files changed

+814
-10
lines changed

31 files changed

+814
-10
lines changed

Cargo.lock

Lines changed: 99 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ incremental = false
1313
overflow-checks = true
1414

1515
[workspace.dependencies]
16-
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/disable-feerefunder-fee" }
17-
neutron-std = { git = "https://github.com/neutron-org/neutron-std", branch = "feat/disable-feerefunder-fee" }
16+
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/tf2" }
17+
neutron-std = { git = "https://github.com/neutron-org/neutron-std", branch = "feat/tf2" }
1818

1919
prost = "0.12.4"
2020
prost-types = "0.12.4"
@@ -36,3 +36,4 @@ cosmwasm-schema = { version = "2.1.0", default-features = false }
3636
serde-json-wasm = "1.0.0"
3737
base64 = "0.21.7"
3838
thiserror = "1.0.49"
39+
getrandom = { version = "0.2.16", features = ["js"]}

contracts/balance-tracker/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ cw-storage-plus = "1.2"
2828
cosmwasm-schema = "1.5"
2929
thiserror = "1"
3030
astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "5" }
31+
getrandom = {workspace = true}

contracts/before-send-hook/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ cosmwasm-std = { workspace = true }
3535
serde = { version = "1.0.180", default-features = false, features = ["derive"] }
3636
schemars = { workspace = true }
3737
cw-storage-plus = { workspace = true }
38+
getrandom = {workspace = true}
3839

3940
[dev-dependencies]
4041
cosmwasm-schema = { workspace = true }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[alias]
2+
wasm = "build --release --target wasm32-unknown-unknown"
3+
wasm-debug = "build --target wasm32-unknown-unknown"
4+
unit-test = "test --lib"
5+
integration-test = "test --test integration"
6+
schema = "run --example coinfactory-schema"

contracts/coinfactory/Cargo.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[package]
2+
name = "coinfactory"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
exclude = [
7+
# 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.
8+
"contract.wasm",
9+
"hash.txt",
10+
]
11+
12+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
13+
14+
[lib]
15+
crate-type = ["cdylib", "rlib"]
16+
17+
[features]
18+
# for quicker tests, cargo test --lib
19+
library = []
20+
21+
[dependencies]
22+
cosmwasm-std = { workspace = true }
23+
serde = { workspace = true }
24+
schemars = { workspace = true }
25+
neutron-sdk = { workspace = true }
26+
neutron-std = { workspace = true }
27+
getrandom = {workspace = true}
28+
29+
[dev-dependencies]
30+
cosmwasm-schema = { workspace = true }

contracts/coinfactory/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# coinfactory
2+
3+
This contract exposes all coinfactory wasm messages through its ExecuteMsg and QueryMsg APIs.
4+
It is used for testing coinfactory and its corresponding bindings.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2022 Neutron
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
use coinfactory::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};
16+
use cosmwasm_schema::{export_schema, remove_schemas, schema_for};
17+
use std::{env::current_dir, fs::create_dir_all};
18+
19+
fn main() {
20+
let mut out_dir = current_dir().unwrap();
21+
out_dir.push("schema");
22+
create_dir_all(&out_dir).unwrap();
23+
remove_schemas(&out_dir).unwrap();
24+
25+
export_schema(&schema_for!(InstantiateMsg), &out_dir);
26+
export_schema(&schema_for!(ExecuteMsg), &out_dir);
27+
export_schema(&schema_for!(QueryMsg), &out_dir);
28+
export_schema(&schema_for!(MigrateMsg), &out_dir);
29+
}

0 commit comments

Comments
 (0)