Skip to content

Commit

Permalink
Merge pull request #11 from neutron-org/chore/fix-deps-hell
Browse files Browse the repository at this point in the history
Chore: deps hell
  • Loading branch information
pr0n00gler authored Mar 3, 2023
2 parents d7be169 + 310544d commit ccb2bc0
Show file tree
Hide file tree
Showing 25 changed files with 395 additions and 1,785 deletions.
1,075 changes: 272 additions & 803 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions contracts/auction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,12 @@ astroport-periphery = { path = "../../packages/astroport_periphery" }
cw20 = { version = "0.13" }
cw2 = { version = "0.13" }
cosmwasm-std = { version = "1.0" }
cw-storage-plus = { version = "0.13" }
cw-storage-plus = { version = "0.15.1" }
serde = { version = "1.0.127", default-features = false, features = ["derive"] }
schemars = "0.8"

[dev-dependencies]
cosmwasm-schema = { version = "1.0" }
cosmwasm-storage = { version = "1.0" }
cw-multi-test = "0.13"
# needed for intergration testing
astroport-pair = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-token = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-vesting = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-generator = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-whitelist = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-factory = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-lockdrop = { path = "../lockdrop" }
2 changes: 1 addition & 1 deletion contracts/auction/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"type": "string"
},
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"CallbackMsg": {
Expand Down
29 changes: 13 additions & 16 deletions contracts/auction/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use astroport_periphery::helpers::{build_approve_cw20_msg, cw20_get_balance};
use astroport_periphery::lockdrop::ExecuteMsg::EnableClaims as LockdropEnableClaims;

use crate::state::{CONFIG, STATE, USERS};
use astroport::asset::{addr_validate_to_lower, Asset, AssetInfo, PairInfo};
use astroport::asset::{Asset, AssetInfo, PairInfo};
use astroport::generator::{
ExecuteMsg as GenExecuteMsg, PendingTokenResponse, QueryMsg as GenQueryMsg, RewardInfoResponse,
};
Expand Down Expand Up @@ -62,15 +62,12 @@ pub fn instantiate(
let config = Config {
owner: msg
.owner
.map(|v| addr_validate_to_lower(deps.api, &v))
.map(|v| deps.api.addr_validate(&v))
.transpose()?
.unwrap_or(info.sender),
astro_token_address: addr_validate_to_lower(deps.api, &msg.astro_token_address)?,
airdrop_contract_address: addr_validate_to_lower(deps.api, &msg.airdrop_contract_address)?,
lockdrop_contract_address: addr_validate_to_lower(
deps.api,
&msg.lockdrop_contract_address,
)?,
astro_token_address: deps.api.addr_validate(&msg.astro_token_address)?,
airdrop_contract_address: deps.api.addr_validate(&msg.airdrop_contract_address)?,
lockdrop_contract_address: deps.api.addr_validate(&msg.lockdrop_contract_address)?,
pool_info: None,
generator_contract: None,
astro_incentive_amount: None,
Expand Down Expand Up @@ -274,7 +271,7 @@ pub fn handle_update_config(

// UPDATE :: ADDRESSES IF PROVIDED
if let Some(owner) = new_config.owner {
config.owner = addr_validate_to_lower(deps.api, &owner)?;
config.owner = deps.api.addr_validate(&owner)?;
attributes.push(attr("owner", config.owner.to_string()));
}

Expand All @@ -284,7 +281,7 @@ pub fn handle_update_config(
"Assets had already been provided to previous pool!",
));
}
let astro_ust_pair_addr = addr_validate_to_lower(deps.api, &astro_ust_pair_address)?;
let astro_ust_pair_addr = deps.api.addr_validate(&astro_ust_pair_address)?;

let pair_info: PairInfo = deps
.querier
Expand All @@ -302,7 +299,7 @@ pub fn handle_update_config(
return Err(StdError::generic_err("ASTRO-UST LP tokens already staked"));
}

let generator_addr = addr_validate_to_lower(deps.api, &generator_contract)?;
let generator_addr = deps.api.addr_validate(&generator_contract)?;
config.generator_contract = Some(generator_addr.clone());
attributes.push(attr("generator", generator_addr.to_string()));
}
Expand Down Expand Up @@ -356,7 +353,7 @@ pub fn handle_delegate_astro_tokens(
) -> Result<Response, StdError> {
let config = CONFIG.load(deps.storage)?;

let user_address = addr_validate_to_lower(deps.api, &user_address)?;
let user_address = deps.api.addr_validate(&user_address)?;

// CHECK :: Auction deposit window open
if !is_deposit_open(env.block.time.seconds(), &config) {
Expand Down Expand Up @@ -684,7 +681,7 @@ fn build_provide_liquidity_to_lp_pool_msg(
amount: ust.amount,
}],
msg: to_binary(&astroport::pair::ExecuteMsg::ProvideLiquidity {
assets: [ust, astro],
assets: [ust, astro].to_vec(),
slippage_tolerance,
auto_stake: None,
receiver: None,
Expand Down Expand Up @@ -867,7 +864,7 @@ pub fn handle_claim_rewards_and_withdraw_lp_shares(

let astro_balance = {
let res: BalanceResponse = deps.querier.query_wasm_smart(
rwi.base_reward_token,
rwi.base_reward_token.to_string(),
&Cw20QueryMsg::Balance {
address: env.contract.address.to_string(),
},
Expand Down Expand Up @@ -1194,7 +1191,7 @@ pub fn update_state_on_reward_claim(
let base_reward_received;
state.generator_astro_per_share += {
let res: BalanceResponse = deps.querier.query_wasm_smart(
rwi.base_reward_token,
rwi.base_reward_token.to_string(),
&Cw20QueryMsg::Balance {
address: env.contract.address.to_string(),
},
Expand Down Expand Up @@ -1266,7 +1263,7 @@ pub fn calculate_withdrawable_lp_shares(
fn query_user_info(deps: Deps, env: Env, user_address: String) -> StdResult<UserInfoResponse> {
let config = CONFIG.load(deps.storage)?;
let mut state = STATE.load(deps.storage)?;
let user_address = addr_validate_to_lower(deps.api, &user_address)?;
let user_address = deps.api.addr_validate(&user_address)?;
let mut user_info = USERS
.may_load(deps.storage, &user_address)?
.unwrap_or_default();
Expand Down
21 changes: 1 addition & 20 deletions contracts/lockdrop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,11 @@ terraswap = "2.6"
cosmwasm-std = { version = "1.0" }
cw20 = { version = "0.13" }
cw2 = { version = "0.13" }
cw-storage-plus = {version = "0.13", features = ["iterator"]}
cw-storage-plus = {version = "0.15.1", features = ["iterator"]}
schemars = "0.8.3"
serde = { version = "1.0.127", default-features = false, features = ["derive"] }

[dev-dependencies]
cw20-base = { version = "0.13", features = ["library"] }
cosmwasm-schema = { version = "1.0" }
cw-multi-test = "0.13"

# Terraswap contracts
terraswap-factory = { git = "https://github.com/terraswap/terraswap.git", branch = "main" }
terraswap-pair = { git = "https://github.com/terraswap/terraswap.git", branch = "main" }
terraswap-token = { git = "https://github.com/terraswap/terraswap.git", branch = "main" }
# Astroport contracts
astroport-factory = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-pair = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-pair-stable = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-token = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-vesting = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-generator = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-generator-proxy-to-mirror = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-staking = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-xastro-token = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-auction = { path = "../auction" }
astroport-whitelist = { git = "https://github.com/astroport-fi/astroport-core.git", branch = "main" }
astroport-governance = { git = "https://github.com/astroport-fi/astroport-governance.git", branch = "main" }
voting-escrow = { git = "https://github.com/astroport-fi/astroport-governance.git", branch = "main" }
14 changes: 8 additions & 6 deletions contracts/lockdrop/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@
"type": "string"
},
"Asset": {
"title": "Description",
"description": "This enum describes a Terra asset (native or CW20).",
"type": "object",
"required": [
Expand All @@ -387,10 +386,11 @@
}
]
}
}
},
"additionalProperties": false
},
"AssetInfo": {
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"terra...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"oneOf": [
{
"description": "Non-native Token",
Expand All @@ -408,7 +408,8 @@
"contract_addr": {
"$ref": "#/definitions/Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -429,15 +430,16 @@
"denom": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"CallbackMsg": {
Expand Down
8 changes: 5 additions & 3 deletions contracts/lockdrop/schema/lock_up_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"type": "string"
},
"AssetInfo": {
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"terra...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"oneOf": [
{
"description": "Non-native Token",
Expand All @@ -142,7 +142,8 @@
"contract_addr": {
"$ref": "#/definitions/Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -163,7 +164,8 @@
"denom": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
8 changes: 5 additions & 3 deletions contracts/lockdrop/schema/pool_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"type": "string"
},
"AssetInfo": {
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"terra...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"oneOf": [
{
"description": "Non-native Token",
Expand All @@ -92,7 +92,8 @@
"contract_addr": {
"$ref": "#/definitions/Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -113,7 +114,8 @@
"denom": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
8 changes: 5 additions & 3 deletions contracts/lockdrop/schema/user_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"type": "string"
},
"AssetInfo": {
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"terra...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"oneOf": [
{
"description": "Non-native Token",
Expand All @@ -77,7 +77,8 @@
"contract_addr": {
"$ref": "#/definitions/Addr"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -98,7 +99,8 @@
"denom": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
Loading

0 comments on commit ccb2bc0

Please sign in to comment.