Skip to content

Commit

Permalink
feat: hook tester, separate helpers, move puppeteer stuff to package
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Dec 27, 2023
1 parent 3182d15 commit 7151331
Show file tree
Hide file tree
Showing 36 changed files with 506 additions and 58 deletions.
48 changes: 47 additions & 1 deletion Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ members = [
"contracts/token",
"contracts/validators-set",
"contracts/strategy",
"contracts/hook-tester",
"contracts/core",
"packages/puppeteer-base",
"packages/base",
"packages/helpers",
]

resolver = "2"
Expand Down Expand Up @@ -45,6 +47,7 @@ bech32 = { version = "0.9.1" }

lido-puppeteer-base = { path = "./packages/puppeteer-base", default-features = false }
lido-staking-base = { path = "./packages/base", default-features = false }
lido-helpers = { path = "./packages/helpers", default-features = false }
thiserror = "1.0.50"

[profile.release]
Expand Down
1 change: 1 addition & 0 deletions contracts/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ serde = { workspace = true }
serde-json-wasm = { workspace = true }
thiserror = { workspace = true }
lido-staking-base = { workspace = true }
lido-helpers = { workspace = true }
neutron-sdk = { workspace = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion contracts/core/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cosmwasm_std::{
Deps, DepsMut, Env, MessageInfo, Response, StdResult, Uint128, WasmMsg,
};
use cw2::set_contract_version;
use lido_staking_base::helpers::answer::response;
use lido_helpers::answer::response;
use lido_staking_base::msg::core::{ExecuteMsg, InstantiateMsg, QueryMsg};
use lido_staking_base::msg::token::ExecuteMsg as TokenExecuteMsg;
use lido_staking_base::state::core::CONFIG;
Expand Down
1 change: 1 addition & 0 deletions contracts/factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ serde = { workspace = true }
serde-json-wasm = { workspace = true }
thiserror = { workspace = true }
lido-staking-base = { workspace = true }
lido-helpers = { workspace = true }
neutron-sdk = { workspace = true }

[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions contracts/factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ use cosmwasm_std::{
Deps, DepsMut, Env, HexBinary, MessageInfo, Response, StdResult, WasmMsg,
};
use cw2::set_contract_version;
use lido_helpers::answer::response;
use lido_staking_base::msg::core::InstantiateMsg as CoreInstantiateMsg;
use lido_staking_base::msg::token::InstantiateMsg as TokenInstantiateMsg;
use lido_staking_base::{
helpers::answer::response, msg::core::InstantiateMsg as CoreInstantiateMsg,
};
use neutron_sdk::{
bindings::{msg::NeutronMsg, query::NeutronQuery},
NeutronResult,
Expand Down
2 changes: 2 additions & 0 deletions contracts/hook-tester/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
schema = "run --bin lido-hook-tester-shema"
49 changes: 49 additions & 0 deletions contracts/hook-tester/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[package]
authors = ["Sergey Ratiashvili <[email protected]>"]
description = "Contract to test puppeteer and hooks"
edition = "2021"
name = "lido-hook-tester"
version = "1.0.0"

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]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []

[dependencies]
base64 = { workspace = true }
cosmos-sdk-proto = { workspace = true }
neutron-sdk = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
protobuf = { workspace = true }
tendermint-proto = { workspace = true }

cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
cw20 = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
serde-json-wasm = { workspace = true }
lido-staking-base = { workspace = true }
lido-helpers = { workspace = true }
lido-puppeteer-base = { workspace = true }

[dev-dependencies]
cosmwasm-storage = { workspace = true }
cw-multi-test = { workspace = true }
1 change: 1 addition & 0 deletions contracts/hook-tester/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# LIDO Hook Tester
15 changes: 15 additions & 0 deletions contracts/hook-tester/src/bin/lido-hook-tester-schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use cosmwasm_schema::write_api;

use lido_hook_tester::{
msg::{ExecuteMsg, InstantiateMsg, MigrateMsg},
state::QueryMsg,
};

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
migrate: MigrateMsg
}
}
Loading

0 comments on commit 7151331

Please sign in to comment.