Skip to content

Commit eb67a53

Browse files
Changes related to neutron sdk update
1 parent 13afd7a commit eb67a53

File tree

52 files changed

+977
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+977
-385
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ members = [
3434
]
3535

3636
[workspace.dependencies]
37-
cosmwasm-std = { version = "1.5.4", default-features = false, features = [
37+
cosmwasm-std = { version = "2.1.0", default-features = false, features = [
38+
"std",
3839
"stargate",
3940
"cosmwasm_1_2",
4041
] }
41-
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/proposal-votes" }
42-
42+
neutron-sdk = { version = "0.11.0" }
4343
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
44-
cw-ownable = { version = "0.5.1", default-features = false }
44+
cw-ownable = { version = "2.1.0", default-features = false }
4545
prost = { version = "0.12.3", default-features = false }
4646
prost-types = { version = "0.12.3", default-features = false }
47-
tendermint-proto = { version = "0.34.0", default-features = false }
48-
cosmwasm-schema = { version = "1.5.4", default-features = false }
49-
cw-storage-plus = { version = "1.2.0", default-features = false }
50-
cw2 = { version = "1.1.2", default-features = false }
47+
tendermint-proto = { version = "0.34.1", default-features = false }
48+
cosmwasm-schema = { version = "2.1.0", default-features = false }
49+
cw-storage-plus = { version = "2.0.0", default-features = false }
50+
cw2 = { version = "2.0.0", default-features = false }
5151
cw721 = { version = "0.18.0", default-features = false }
5252
cw721-base = { version = "0.18.0", features = ["library"] }
5353
cw-multi-test = { version = "0.20.0", default-features = false }
54-
cw-utils = { version = "1.0.3", default-features = false }
54+
cw-utils = { version = "2.0.0", default-features = false }
5555
serde = { version = "1.0.195", default-features = false }
5656
serde-json-wasm = { version = "1.0.0", default-features = false }
5757
sha2 = { version = "0.10.8", default-features = false }

contracts/astroport-exchange-handler/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ exclude = [
1919
crate-type = ["cdylib", "rlib"]
2020

2121
[features]
22-
# for more explicit tests, cargo test --features=backtraces
23-
backtraces = ["cosmwasm-std/backtraces"]
2422
# use library feature to disable all instantiate/execute/query exports
2523
library = []
2624

contracts/auto-withdrawer/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ version = "1.0.0"
99
crate-type = ["cdylib", "rlib"]
1010

1111
[features]
12-
backtraces = ["cosmwasm-std/backtraces"]
1312
library = []
1413

1514
[dependencies]

contracts/auto-withdrawer/src/store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod bondings {
2626
}
2727
}
2828

29-
pub fn map<'a>() -> IndexedMap<'a, &'a str, BondingRecord, BondingRecordIndexes<'a>> {
29+
pub fn map() -> IndexedMap<&'static str, BondingRecord, BondingRecordIndexes<'a>> {
3030
IndexedMap::new(
3131
"bondings",
3232
BondingRecordIndexes {

contracts/core/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ exclude = [
1717
crate-type = ["cdylib", "rlib"]
1818

1919
[features]
20-
# for more explicit tests, cargo test --features=backtraces
21-
backtraces = ["cosmwasm-std/backtraces"]
2220
# use library feature to disable all instantiate/execute/query exports
2321
library = []
2422

contracts/core/src/contract.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ fn execute_update_withdrawn_amount(
464464
let config = CONFIG.load(deps.storage)?;
465465
let addrs =
466466
drop_helpers::get_contracts!(deps, config.factory_contract, withdrawal_manager_contract);
467-
if info.sender != addrs.withdrawal_manager_contract {
467+
if info.sender.to_string() != addrs.withdrawal_manager_contract {
468468
return Err(ContractError::Unauthorized {});
469469
}
470470

@@ -1269,8 +1269,11 @@ fn get_unbonding_msg<T>(
12691269
{
12701270
let current_exchange_rate = query_exchange_rate(deps.as_ref(), config)?;
12711271
attrs.push(attr("exchange_rate", current_exchange_rate.to_string()));
1272-
let expected_native_asset_amount =
1273-
unbond.total_dasset_amount_to_withdraw * current_exchange_rate;
1272+
let expected_native_asset_amount = current_exchange_rate
1273+
.checked_mul(unbond.total_dasset_amount_to_withdraw.into())
1274+
.unwrap()
1275+
.atomics()
1276+
.into();
12741277

12751278
let calc_withdraw_query_result: Result<Vec<(String, Uint128)>, StdError> =
12761279
deps.querier.query_wasm_smart(
@@ -1431,6 +1434,7 @@ pub mod check_denom {
14311434
denom: impl Into<String>,
14321435
) -> StdResult<QueryDenomTraceResponse> {
14331436
let denom = denom.into();
1437+
#[allow(deprecated)]
14341438
deps.querier
14351439
.query(&QueryRequest::Stargate {
14361440
path: "/ibc.applications.transfer.v1.Query/DenomTrace".to_string(),

contracts/distribution/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ exclude = [
1717
crate-type = ["cdylib", "rlib"]
1818

1919
[features]
20-
# for more explicit tests, cargo test --features=backtraces
21-
backtraces = ["cosmwasm-std/backtraces"]
2220
# use library feature to disable all instantiate/execute/query exports
2321
library = []
2422

contracts/factory/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ exclude = [
1717
crate-type = ["cdylib", "rlib"]
1818

1919
[features]
20-
# for more explicit tests, cargo test --features=backtraces
21-
backtraces = ["cosmwasm-std/backtraces"]
2220
# use library feature to disable all instantiate/execute/query exports
2321
library = []
2422

contracts/factory/src/contract.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use std::collections::HashMap;
22

3-
use cosmwasm_std::{
4-
attr, instantiate2_address, to_json_binary, Binary, CodeInfoResponse, CosmosMsg, Deps, DepsMut,
5-
Env, HexBinary, MessageInfo, Response, StdResult, Uint128, WasmMsg,
6-
};
3+
use cosmwasm_std::{attr, instantiate2_address, to_json_binary, Binary, CodeInfoResponse, CosmosMsg, Deps, DepsMut, Env, HexBinary, MessageInfo, Response, StdResult, Uint128, WasmMsg, Decimal};
74
use drop_helpers::answer::response;
85
use drop_helpers::phonebook::{
96
CORE_CONTRACT, DISTRIBUTION_CONTRACT, LSM_SHARE_BOND_PROVIDER_CONTRACT,
@@ -674,7 +671,7 @@ fn get_proxied_message<T: cosmwasm_schema::serde::Serialize>(
674671

675672
fn get_code_checksum(deps: Deps, code_id: u64) -> NeutronResult<HexBinary> {
676673
let CodeInfoResponse { checksum, .. } = deps.querier.query_wasm_code_info(code_id)?;
677-
Ok(checksum)
674+
Ok(HexBinary::from(checksum.as_slice()))
678675
}
679676

680677
fn get_contract_label(base: &str) -> String {
@@ -704,7 +701,10 @@ fn get_splitter_receivers(
704701
) -> ContractResult<Vec<(String, cosmwasm_std::Uint128)>> {
705702
match fee_params {
706703
Some(fee_params) => {
707-
let fee_weight = PERCENT_PRECISION * fee_params.fee;
704+
let fee_weight = fee_params.fee
705+
.checked_mul(Decimal::from_ratio(PERCENT_PRECISION, Uint128::from(1u128)))
706+
.unwrap()
707+
.atomics();
708708
let bond_provider_weight = PERCENT_PRECISION - fee_weight;
709709
Ok(vec![
710710
(bond_provider_address, bond_provider_weight),

0 commit comments

Comments
 (0)