Skip to content

Commit

Permalink
Add execute bond
Browse files Browse the repository at this point in the history
  • Loading branch information
faust403 committed Nov 26, 2024
1 parent 0ba7ebb commit 9292ef7
Show file tree
Hide file tree
Showing 19 changed files with 418 additions and 36 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.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"contracts/pump",
"contracts/puppeteer",
"contracts/puppeteer-initia",
"contracts/lazy-staking",
# "contracts/puppeteer-authz",
"contracts/rewards-manager",
"contracts/strategy",
Expand Down
2 changes: 1 addition & 1 deletion contracts/factory/src/bin/drop-factory-schema.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::write_api;
use drop_factory::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};
use drop_staking_base::msg::factory::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

fn main() {
write_api! {
Expand Down
20 changes: 10 additions & 10 deletions contracts/factory/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use crate::{
error::ContractResult,
msg::{
ExecuteMsg, InstantiateMsg, MigrateMsg, ProxyMsg, QueryMsg, UpdateConfigMsg,
ValidatorSetMsg,
},
state::{State, STATE},
};
use crate::error::ContractResult;
use cosmwasm_std::{
attr, instantiate2_address, to_json_binary, Binary, CodeInfoResponse, CosmosMsg, Deps, DepsMut,
Env, HexBinary, MessageInfo, Response, StdResult, Uint128, WasmMsg,
};
use drop_helpers::answer::response;
use drop_staking_base::state::splitter::Config as SplitterConfig;
use drop_staking_base::{
msg::factory::{
ExecuteMsg, InstantiateMsg, MigrateMsg, ProxyMsg, QueryMsg, UpdateConfigMsg,
ValidatorSetMsg,
},
state::factory::{State, STATE},
};
use drop_staking_base::{
msg::{
core::{InstantiateMsg as CoreInstantiateMsg, QueryMsg as CoreQueryMsg},
Expand Down Expand Up @@ -462,7 +462,7 @@ pub fn query(deps: Deps<NeutronQuery>, _env: Env, msg: QueryMsg) -> StdResult<Bi
fn query_pause_info(deps: Deps<NeutronQuery>) -> StdResult<Binary> {
let state = STATE.load(deps.storage)?;

to_json_binary(&crate::state::PauseInfoResponse {
to_json_binary(&drop_staking_base::state::factory::PauseInfoResponse {
core: deps
.querier
.query_wasm_smart(state.core_contract, &CoreQueryMsg::Pause {})?,
Expand Down Expand Up @@ -670,7 +670,7 @@ pub fn migrate(
}

fn get_splitter_receivers(
fee_params: Option<crate::msg::FeeParams>,
fee_params: Option<drop_staking_base::msg::factory::FeeParams>,
bond_provider_address: String,
) -> ContractResult<Vec<(String, cosmwasm_std::Uint128)>> {
match fee_params {
Expand Down
2 changes: 0 additions & 2 deletions contracts/factory/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub mod contract;
pub mod error;
pub mod msg;
pub mod state;
#[cfg(test)]
pub mod tests;
30 changes: 15 additions & 15 deletions contracts/factory/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use crate::{
contract::{execute, instantiate, query},
msg::{
CoreParams, ExecuteMsg, FeeParams, InstantiateMsg, LsmShareBondParams, NativeBondParams,
QueryMsg, UpdateConfigMsg, ValidatorSetMsg,
},
state::{CodeIds, RemoteOpts, State, Timeout, STATE},
};
use crate::contract::{execute, instantiate, query};
use cosmwasm_std::{
attr, from_json,
testing::{mock_env, mock_info},
to_json_binary, BankMsg, Uint128,
};
use drop_helpers::testing::{mock_dependencies, mock_dependencies_with_api};
use drop_staking_base::{
msg::factory::{
CoreParams, ExecuteMsg, FeeParams, InstantiateMsg, LsmShareBondParams, NativeBondParams,
QueryMsg, UpdateConfigMsg, ValidatorSetMsg,
},
state::factory::{CodeIds, RemoteOpts, State, Timeout, STATE},
};
use drop_staking_base::{
msg::{
core::{ExecuteMsg as CoreExecuteMsg, InstantiateMsg as CoreInstantiateMsg},
Expand Down Expand Up @@ -707,7 +707,7 @@ fn test_proxy_validators_set_update_validators_unauthorized() {
deps.as_mut().into_empty(),
mock_env(),
mock_info("not_an_owner", &[]),
ExecuteMsg::Proxy(crate::msg::ProxyMsg::ValidatorSet(
ExecuteMsg::Proxy(drop_staking_base::msg::factory::ProxyMsg::ValidatorSet(
ValidatorSetMsg::UpdateValidators {
validators: vec![
drop_staking_base::msg::validatorset::ValidatorData {
Expand Down Expand Up @@ -744,7 +744,7 @@ fn test_proxy_validators_set_update_validators() {
deps.as_mut().into_empty(),
mock_env(),
mock_info("owner", &[]),
ExecuteMsg::Proxy(crate::msg::ProxyMsg::ValidatorSet(
ExecuteMsg::Proxy(drop_staking_base::msg::factory::ProxyMsg::ValidatorSet(
ValidatorSetMsg::UpdateValidators {
validators: vec![
drop_staking_base::msg::validatorset::ValidatorData {
Expand Down Expand Up @@ -1091,7 +1091,7 @@ fn test_query_state() {
STATE
.save(deps.as_mut().storage, &get_default_factory_state())
.unwrap();
let query_res: crate::state::State =
let query_res: drop_staking_base::state::factory::State =
from_json(query(deps.as_ref(), mock_env(), QueryMsg::State {}).unwrap()).unwrap();
assert_eq!(query_res, get_default_factory_state());
}
Expand Down Expand Up @@ -1121,11 +1121,11 @@ fn test_query_pause_info() {
STATE
.save(deps.as_mut().storage, &get_default_factory_state())
.unwrap();
let query_res: crate::state::PauseInfoResponse =
let query_res: drop_staking_base::state::factory::PauseInfoResponse =
from_json(query(deps.as_ref(), mock_env(), QueryMsg::PauseInfo {}).unwrap()).unwrap();
assert_eq!(
query_res,
crate::state::PauseInfoResponse {
drop_staking_base::state::factory::PauseInfoResponse {
core: CorePause {
tick: true,
bond: false,
Expand All @@ -1146,7 +1146,7 @@ fn test_query_ownership() {
query(
deps.as_ref(),
mock_env(),
crate::msg::QueryMsg::Ownership {},
drop_staking_base::msg::factory::QueryMsg::Ownership {},
)
.unwrap(),
)
Expand Down Expand Up @@ -1187,7 +1187,7 @@ fn test_transfer_ownership() {
query(
deps.as_ref(),
mock_env(),
crate::msg::QueryMsg::Ownership {},
drop_staking_base::msg::factory::QueryMsg::Ownership {},
)
.unwrap(),
)
Expand Down
32 changes: 32 additions & 0 deletions contracts/lazy-staking/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
authors = ["Vladislav Vasilev <[email protected]>"]
description = "Contract to mint lazy token"
edition = "2021"
name = "drop-lazy-staking"
version = "1.0.0"

exclude = [
"contract.wasm",
"hash.txt",
]

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

[features]
backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
cw2 = { workspace = true }
neutron-sdk = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-ownable = { workspace = true }
thiserror = { workspace = true }
cw-utils = { workspace = true }
cw-storage-plus = { workspace = true }
semver = { workspace = true }
cosmos-sdk-proto = { workspace = true }
drop-helpers = { workspace = true }
drop-staking-base = { workspace = true }
1 change: 1 addition & 0 deletions contracts/lazy-staking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Drop Lazy Staking
11 changes: 11 additions & 0 deletions contracts/lazy-staking/src/bin/drop-lazy-staking-schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use cosmwasm_schema::write_api;
use drop_lazy_staking::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

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

0 comments on commit 9292ef7

Please sign in to comment.