diff --git a/app/src/network/cosmos/config/kujira.ts b/app/src/network/cosmos/config/kujira.ts index 70edaf17..5b814139 100644 --- a/app/src/network/cosmos/config/kujira.ts +++ b/app/src/network/cosmos/config/kujira.ts @@ -16,7 +16,7 @@ export const KUJIRA_TESTNET_HUB_INFO: HubInfo = { hubConfig: { offer_addr: 'kujira17yfjhj4adsqlsm452a4hawp6lgtzd2lyrqnmfe057vd5pcpd8rwsykv8na', trade_addr: 'kujira1kd0uf7za28hslrlz4ag82kyyaucmd8mzukut44p8nlnrkj4mps0sgxzuck', - profile_addr: '', + profile_addr: 'kujira1at4ls9w65hcpgk4jnzssdczyky2339h3apszcysh6xq9vx77mf8sdszr0s', trading_incentives_addr: 'kujira1lzsuzy7485zzyze0tla55vn4ddwxa2flwhws9mrwfxftmhzmnwuslxv6z2', local_market_addr: 'kujira1chejx4qqtvwxy6684yrsmf6pylancxqhk3vsmtleg5ta3zrffljq4xf685', local_denom: { diff --git a/contracts/packages/protocol/src/constants.rs b/contracts/packages/protocol/src/constants.rs index 80665e83..c8db76b0 100644 --- a/contracts/packages/protocol/src/constants.rs +++ b/contracts/packages/protocol/src/constants.rs @@ -1,4 +1,3 @@ -pub const OFFERS_KEY: &str = "offers"; pub const REQUEST_TIMEOUT: u64 = 20 * 60; // 20 mins pub const FUNDING_TIMEOUT: u64 = 140 * 60; // 2hrs 20 mins pub const LOCAL_FEE: u128 = 100; diff --git a/contracts/packages/protocol/src/offer.rs b/contracts/packages/protocol/src/offer.rs index 0574a386..52e09f8d 100644 --- a/contracts/packages/protocol/src/offer.rs +++ b/contracts/packages/protocol/src/offer.rs @@ -1,4 +1,3 @@ -use super::constants::OFFERS_KEY; use crate::currencies::FiatCurrency; use crate::denom_utils::denom_to_string; use crate::hub_utils::get_hub_config; @@ -28,8 +27,13 @@ impl<'a> IndexList for OfferIndexes<'a> { } pub fn offers<'a>() -> IndexedMap<'a, String, Offer, OfferIndexes<'a>> { + let offers_pk_namespace = "offers_v0_3_0"; let indexes = OfferIndexes { - owner: MultiIndex::new(|d| d.owner.clone().to_string(), "offers", "offers__owner"), + owner: MultiIndex::new( + |d| d.owner.clone().to_string(), + offers_pk_namespace, + "offers__owner", + ), filter: MultiIndex::new( |offer: &Offer| { offer @@ -39,11 +43,11 @@ pub fn offers<'a>() -> IndexedMap<'a, String, Offer, OfferIndexes<'a>> { .add(denom_to_string(&offer.denom).as_str()) .add(&offer.state.to_string()) }, - "offers", + offers_pk_namespace, "offers__filter", ), }; - IndexedMap::new(OFFERS_KEY, indexes) + IndexedMap::new(offers_pk_namespace, indexes) } // pub const OFFERS : IndexedMap<&str, Offer, OfferIndexes> = create_offers_indexedmap(); diff --git a/contracts/packages/protocol/src/trade.rs b/contracts/packages/protocol/src/trade.rs index a1042d3b..9fd92ef4 100644 --- a/contracts/packages/protocol/src/trade.rs +++ b/contracts/packages/protocol/src/trade.rs @@ -427,16 +427,17 @@ impl<'a> IndexList for TradeIndexes<'a> { } pub fn trades<'a>() -> IndexedMap<'a, String, Trade, TradeIndexes<'a>> { + let pk_namespace = "trades_v0_3_0"; let indexes = TradeIndexes { - buyer: MultiIndex::new(|t| t.buyer.to_string(), "trades", "trades__buyer"), - seller: MultiIndex::new(|t| t.seller.to_string(), "trades", "trades__seller"), + buyer: MultiIndex::new(|t| t.buyer.to_string(), pk_namespace, "trades__buyer"), + seller: MultiIndex::new(|t| t.seller.to_string(), pk_namespace, "trades__seller"), arbitrator: MultiIndex::new( |t| t.arbitrator.clone().to_string(), - "trades", + pk_namespace, "trades__arbitrator", ), }; - IndexedMap::new("trades", indexes) + IndexedMap::new(pk_namespace, indexes) } // Arbitrator @@ -537,19 +538,20 @@ impl ArbitratorModel { } pub fn arbitrators<'a>() -> IndexedMap<'a, &'a str, Arbitrator, ArbitratorIndexes<'a>> { + let arbitrators_pk_namespace = "arbitrators_v0_3_0"; let indexes = ArbitratorIndexes { arbitrator: MultiIndex::new( |d: &Arbitrator| d.arbitrator.clone(), - "arbitrators", + arbitrators_pk_namespace, "arbitrators__arbitrator", ), fiat: MultiIndex::new( |d: &Arbitrator| d.fiat.clone().to_string(), - "arbitrators", + arbitrators_pk_namespace, "arbitrators__asset", ), }; - IndexedMap::new("arbitrators", indexes) + IndexedMap::new(&arbitrators_pk_namespace, indexes) } pub struct ArbitratorIndexes<'a> {