Skip to content

Commit

Permalink
Fix FT test
Browse files Browse the repository at this point in the history
  • Loading branch information
masihyeganeh committed Oct 25, 2024
1 parent 17424fe commit cf5929b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
30 changes: 22 additions & 8 deletions integration-tests/contracts/modules/ft/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
use coreum_wasm_sdk::types::coreum::asset::ft::v1::{
MsgBurn, MsgClawback, MsgClearAdmin, MsgFreeze, MsgGloballyFreeze, MsgGloballyUnfreeze,
MsgIssue, MsgMint, MsgSetFrozen, MsgSetWhitelistedLimit, MsgTransferAdmin, MsgUnfreeze,
MsgUpgradeTokenV1, QueryBalanceRequest, QueryBalanceResponse, QueryFrozenBalanceRequest,
QueryFrozenBalanceResponse, QueryFrozenBalancesRequest, QueryFrozenBalancesResponse,
QueryParamsRequest, QueryParamsResponse, QueryTokenRequest, QueryTokenResponse,
QueryTokensRequest, QueryTokensResponse, QueryWhitelistedBalanceRequest,
ExtensionIssueSettings, MsgBurn, MsgClawback, MsgClearAdmin, MsgFreeze, MsgGloballyFreeze,
MsgGloballyUnfreeze, MsgIssue, MsgMint, MsgSetFrozen, MsgSetWhitelistedLimit, MsgTransferAdmin,
MsgUnfreeze, MsgUpgradeTokenV1, QueryBalanceRequest, QueryBalanceResponse,
QueryFrozenBalanceRequest, QueryFrozenBalanceResponse, QueryFrozenBalancesRequest,
QueryFrozenBalancesResponse, QueryParamsRequest, QueryParamsResponse, QueryTokenRequest,
QueryTokenResponse, QueryTokensRequest, QueryTokensResponse, QueryWhitelistedBalanceRequest,
QueryWhitelistedBalanceResponse, QueryWhitelistedBalancesRequest,
QueryWhitelistedBalancesResponse,
};
use coreum_wasm_sdk::types::cosmos::base::{query::v1beta1::PageRequest, v1beta1::Coin};
use cosmwasm_std::{entry_point, to_json_binary, Binary, CosmosMsg, Deps, StdResult, Uint128};
use cosmwasm_std::{
entry_point, to_json_binary, to_json_vec, Binary, CosmosMsg, Deps, StdResult, Uint128,
};
use cosmwasm_std::{DepsMut, Env, MessageInfo, Response};
use cw2::set_contract_version;
use cw_ownable::{assert_owner, initialize_owner};
Expand Down Expand Up @@ -46,7 +48,19 @@ pub fn instantiate(
send_commission_rate: msg.send_commission_rate,
uri: msg.uri.unwrap_or_default(),
uri_hash: msg.uri_hash.unwrap_or_default(),
extension_settings: msg.extension_settings,
extension_settings: msg.extension_settings.map(|s| ExtensionIssueSettings {
code_id: s.code_id,
label: s.label,
funds: s
.funds
.iter()
.map(|f| Coin {
denom: f.denom.to_string(),
amount: f.amount.to_string(),
})
.collect(),
issuance_msg: to_json_vec(&s.issuance_msg).unwrap(),
}),
dex_settings: msg.dex_settings,
};

Expand Down
17 changes: 15 additions & 2 deletions integration-tests/contracts/modules/ft/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use coreum_wasm_sdk::types::coreum::asset::ft::v1::{DexSettings, ExtensionIssueSettings};
use coreum_wasm_sdk::types::coreum::asset::ft::v1::DexSettings;
use cosmwasm_schema::cw_serde;
use cosmwasm_std::Uint128;
use cosmwasm_std::{Coin, Uint128};

#[cw_serde]
pub struct InstantiateMsg {
Expand All @@ -18,6 +18,19 @@ pub struct InstantiateMsg {
pub dex_settings: Option<DexSettings>,
}

#[cw_serde]
pub struct ExtensionIssueSettings {
pub code_id: u64,
pub label: String,
pub funds: Vec<Coin>,
pub issuance_msg: IssuanceMsg,
}

#[cw_serde]
pub struct IssuanceMsg {
pub extra_data: String,
}

#[cw_serde]
pub enum ExecuteMsg {
Mint {
Expand Down
1 change: 0 additions & 1 deletion integration-tests/modules/assetft_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,6 @@ func TestAssetFTExtensionAttachingToSmartContractCallIsDenied(t *testing.T) {
// TestAssetFTExtensionIssuingSmartContractIsAllowedToReceive verifies that issuing smart contract is allowed to
// receive coins even if sending them to smart contract is disabled.
func TestAssetFTExtensionIssuingSmartContractIsAllowedToSendAndReceive(t *testing.T) {
t.SkipNow() // TODO: Fix later
t.Parallel()

ctx, chain := integrationtests.NewCoreumTestingContext(t)
Expand Down

0 comments on commit cf5929b

Please sign in to comment.