From 8a1d2af3cfa8b4b3925afc22441df7867be18d5b Mon Sep 17 00:00:00 2001 From: Gala Date: Thu, 22 Dec 2022 14:44:58 +0100 Subject: [PATCH 01/27] adding changes --- explorer/src/api/index.ts | 7 +++++++ explorer/src/components/MobileNav.tsx | 29 ++++++++++++++++++++------- explorer/src/components/Nav.tsx | 21 +++++++++++++++++-- explorer/src/components/Switch.tsx | 2 +- explorer/src/context/main.tsx | 11 ++++++++-- explorer/src/typeDefs/explorer-api.ts | 2 ++ 6 files changed, 60 insertions(+), 12 deletions(-) diff --git a/explorer/src/api/index.ts b/explorer/src/api/index.ts index 37e68b8096..f5ee0216df 100644 --- a/explorer/src/api/index.ts +++ b/explorer/src/api/index.ts @@ -1,4 +1,5 @@ import { + API_BASE_URL, BLOCK_API, COUNTRY_DATA_API, GATEWAYS_API, @@ -27,6 +28,7 @@ import { StatusResponse, SummaryOverviewResponse, ValidatorsResponse, + Environment, } from '../typeDefs/explorer-api'; function getFromCache(key: string) { @@ -143,3 +145,8 @@ export class Api { static fetchUptimeStoryById = async (id: string): Promise => (await fetch(`${UPTIME_STORY_API}/${id}/history`)).json(); } + +export const getEnvironment = (): Environment => { + const matchEnv = (env: Environment) => API_BASE_URL?.toLocaleLowerCase().includes(env) && env; + return matchEnv('sandbox') || matchEnv('qa') || 'mainnet'; +}; \ No newline at end of file diff --git a/explorer/src/components/MobileNav.tsx b/explorer/src/components/MobileNav.tsx index cb44210e9d..e3515dff7f 100644 --- a/explorer/src/components/MobileNav.tsx +++ b/explorer/src/components/MobileNav.tsx @@ -31,11 +31,18 @@ type MobileNavProps = { export const MobileNav: React.FC<{ children: React.ReactNode }> = ({ children }: MobileNavProps) => { const theme = useTheme(); - const { navState, updateNavState } = useMainContext(); + const { navState, updateNavState, environment } = useMainContext(); const [drawerOpen, setDrawerOpen] = React.useState(false); // Set maintenance banner to false by default to don't display it const [openMaintenance, setOpenMaintenance] = React.useState(false); + const explorerName = + `${environment && environment.charAt(0).toUpperCase() + environment.slice(1)} Explorer` || 'Mainnet Explorer'; + + const switchNetworkText = environment === 'mainnet' ? 'Switch to Testnet' : 'Switch to Mainnet'; + const switchNetworkLink = + environment === 'mainnet' ? 'https://sandbox-explorer.nymtech.net' : 'https://explorer.nymtech.net'; + const toggleDrawer = () => { setDrawerOpen(!drawerOpen); }; @@ -76,7 +83,7 @@ export const MobileNav: React.FC<{ children: React.ReactNode }> = ({ children }: }} > - + = ({ children }: color: theme.palette.nym.networkExplorer.nav.text, fontSize: '18px', fontWeight: 600, - ml: 2, }} > - - Network Explorer + + {explorerName} + - + - diff --git a/explorer/src/components/Nav.tsx b/explorer/src/components/Nav.tsx index e2808871a0..93ea445a33 100644 --- a/explorer/src/components/Nav.tsx +++ b/explorer/src/components/Nav.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { Link } from 'react-router-dom'; import { ExpandLess, ExpandMore, Menu } from '@mui/icons-material'; import { CSSObject, styled, Theme, useTheme } from '@mui/material/styles'; +import Button from '@mui/material/Button'; import MuiLink from '@mui/material/Link'; import Box from '@mui/material/Box'; import ListItem from '@mui/material/ListItem'; @@ -231,13 +232,20 @@ ExpandableButton.defaultProps = { }; export const Nav: React.FC = ({ children }) => { - const { updateNavState, navState } = useMainContext(); + const { updateNavState, navState, environment } = useMainContext(); const [drawerIsOpen, setDrawerToOpen] = React.useState(false); const [fixedOpen, setFixedOpen] = React.useState(false); // Set maintenance banner to false by default to don't display it const [openMaintenance, setOpenMaintenance] = React.useState(false); const theme = useTheme(); + const explorerName = + `${environment && environment.charAt(0).toUpperCase() + environment.slice(1)} Explorer` || 'Mainnet Explorer'; + + const switchNetworkText = environment === 'mainnet' ? 'Switch to Testnet' : 'Switch to Mainnet'; + const switchNetworkLink = + environment === 'mainnet' ? 'https://sandbox-explorer.nymtech.net' : 'https://explorer.nymtech.net'; + const setToActive = (id: number) => { updateNavState(id); }; @@ -302,8 +310,17 @@ export const Nav: React.FC = ({ children }) => { }} > - Network Explorer + {explorerName} + ({ export const DarkLightSwitchMobile: React.FC = () => { const { toggleMode } = useMainContext(); return ( - ); diff --git a/explorer/src/context/main.tsx b/explorer/src/context/main.tsx index 42e89b32ee..7d9287d0bf 100644 --- a/explorer/src/context/main.tsx +++ b/explorer/src/context/main.tsx @@ -9,9 +9,10 @@ import { MixnodeStatus, SummaryOverviewResponse, ValidatorsResponse, + Environment, } from '../typeDefs/explorer-api'; import { EnumFilterKey } from '../typeDefs/filters'; -import { Api } from '../api'; +import { Api, getEnvironment } from '../api'; import { NavOptionType, originalNavOptions } from './nav'; interface StateData { @@ -24,6 +25,7 @@ interface StateData { mode: PaletteMode; navState: NavOptionType[]; validators?: ApiState; + environment?: Environment; } interface StateApi { @@ -47,6 +49,9 @@ export const MainContext = React.createContext({ export const useMainContext = (): React.ContextType => React.useContext(MainContext); export const MainContextProvider: React.FC = ({ children }) => { + // network explorer environment + const [environment, setEnvironment] = React.useState('mainnet'); + // light/dark mode const [mode, setMode] = React.useState('dark'); @@ -166,10 +171,12 @@ export const MainContextProvider: React.FC = ({ children }) => { React.useEffect(() => { Promise.all([fetchOverviewSummary(), fetchGateways(), fetchValidators(), fetchBlock(), fetchCountryData()]); + setEnvironment(getEnvironment()); }, []); const state = React.useMemo( () => ({ + environment, block, countryData, fetchMixnodes, @@ -184,7 +191,7 @@ export const MainContextProvider: React.FC = ({ children }) => { updateNavState, validators, }), - [block, countryData, gateways, globalError, mixnodes, mode, navState, summaryOverview, validators], + [environment, block, countryData, gateways, globalError, mixnodes, mode, navState, summaryOverview, validators], ); return {children}; diff --git a/explorer/src/typeDefs/explorer-api.ts b/explorer/src/typeDefs/explorer-api.ts index f8350775c4..0f832b9f59 100644 --- a/explorer/src/typeDefs/explorer-api.ts +++ b/explorer/src/typeDefs/explorer-api.ts @@ -224,3 +224,5 @@ export type MixNodeEconomicDynamicsStatsResponse = { estimated_delegators_reward: number; current_interval_uptime: number; }; + +export type Environment = 'mainnet' | 'sandbox' | 'qa'; From 4f59678ded67b6123c41582cf683f7107dbc4e35 Mon Sep 17 00:00:00 2001 From: Gala Date: Thu, 22 Dec 2022 15:31:35 +0100 Subject: [PATCH 02/27] center layout --- explorer/src/components/MobileNav.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/explorer/src/components/MobileNav.tsx b/explorer/src/components/MobileNav.tsx index e3515dff7f..1e37800894 100644 --- a/explorer/src/components/MobileNav.tsx +++ b/explorer/src/components/MobileNav.tsx @@ -70,6 +70,7 @@ export const MobileNav: React.FC<{ children: React.ReactNode }> = ({ children }: sx={{ display: 'flex', justifyContent: 'space-between', + alignItems: 'center', width: '100%', }} > @@ -111,7 +112,7 @@ export const MobileNav: React.FC<{ children: React.ReactNode }> = ({ children }: - From b1fb8bb18c3123c8b53fb1708d1103d66d516c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Tue, 7 Mar 2023 09:51:18 +0000 Subject: [PATCH 03/27] Validating new interval config parameters to prevent division by zero --- contracts/mixnet/src/interval/transactions.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contracts/mixnet/src/interval/transactions.rs b/contracts/mixnet/src/interval/transactions.rs index 1246aea2ae..0392368389 100644 --- a/contracts/mixnet/src/interval/transactions.rs +++ b/contracts/mixnet/src/interval/transactions.rs @@ -327,6 +327,14 @@ pub(crate) fn try_update_interval_config( ) -> Result { ensure_is_owner(info.sender, deps.storage)?; + if epochs_in_interval == 0 { + return Err(MixnetContractError::EpochsInIntervalZero); + } + + if epoch_duration_secs == 0 { + return Err(MixnetContractError::EpochDurationZero); + } + let interval = storage::current_interval(deps.storage)?; if force_immediately || interval.is_current_interval_over(&env) { change_interval_config( From 3b97844310dced590d94cc7769a9d12bfb3e7e77 Mon Sep 17 00:00:00 2001 From: Fouad Date: Wed, 8 Mar 2023 15:15:32 +0000 Subject: [PATCH 04/27] Feature/explorer 2979 (#3147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * additional unfiltered endpoints for nym-api * add poor performance UI * display appropriate UI when node is blacklisted * update explorer api with blacklisted nodes * add new unfiltered endpoint add new unfiltered endpoint * show blacklisted detail even when node description is unavailable remove console.log --------- Co-authored-by: Jędrzej Stuczyński --- .../validator-client/src/client.rs | 6 + .../validator-client/src/nym_api/mod.rs | 15 ++ .../validator-client/src/nym_api/routes.rs | 1 + explorer-api/src/mix_node/models.rs | 1 + explorer-api/src/mix_nodes/models.rs | 1 + explorer-api/src/tasks.rs | 2 +- .../components/MixNodes/Economics/Table.tsx | 1 - explorer/src/components/MixNodes/index.tsx | 2 + explorer/src/pages/MixnodeDetail/index.tsx | 8 +- explorer/src/typeDefs/explorer-api.ts | 1 + nym-api/nym-api-requests/src/models.rs | 2 + nym-api/src/epoch_operations/mod.rs | 2 +- nym-api/src/node_status_api/cache/mod.rs | 16 +- .../src/node_status_api/cache/node_sets.rs | 6 +- .../src/node_status_api/cache/refresher.rs | 18 ++- nym-api/src/node_status_api/helpers.rs | 48 ++++-- nym-api/src/node_status_api/mod.rs | 2 + nym-api/src/node_status_api/routes.rs | 26 +++- nym-api/src/nym_contract_cache/cache/mod.rs | 141 +++++++++--------- nym-api/src/nym_contract_cache/routes.rs | 18 ++- 20 files changed, 211 insertions(+), 106 deletions(-) diff --git a/common/client-libs/validator-client/src/client.rs b/common/client-libs/validator-client/src/client.rs index ee6dd47be9..1aaa514b87 100644 --- a/common/client-libs/validator-client/src/client.rs +++ b/common/client-libs/validator-client/src/client.rs @@ -749,6 +749,12 @@ where Ok(self.nym_api.get_mixnodes_detailed().await?) } + pub async fn get_cached_mixnodes_detailed_unfiltered( + &self, + ) -> Result, ValidatorClientError> { + Ok(self.nym_api.get_mixnodes_detailed_unfiltered().await?) + } + pub async fn get_cached_rewarded_mixnodes( &self, ) -> Result, ValidatorClientError> { diff --git a/common/client-libs/validator-client/src/nym_api/mod.rs b/common/client-libs/validator-client/src/nym_api/mod.rs index fa453d3c83..10bea35417 100644 --- a/common/client-libs/validator-client/src/nym_api/mod.rs +++ b/common/client-libs/validator-client/src/nym_api/mod.rs @@ -144,6 +144,21 @@ impl Client { .await } + pub async fn get_mixnodes_detailed_unfiltered( + &self, + ) -> Result, NymAPIError> { + self.query_nym_api( + &[ + routes::API_VERSION, + routes::STATUS, + routes::MIXNODES, + routes::DETAILED_UNFILTERED, + ], + NO_PARAMS, + ) + .await + } + pub async fn get_gateways(&self) -> Result, NymAPIError> { self.query_nym_api(&[routes::API_VERSION, routes::GATEWAYS], NO_PARAMS) .await diff --git a/common/client-libs/validator-client/src/nym_api/routes.rs b/common/client-libs/validator-client/src/nym_api/routes.rs index 1c715ff1b8..8b6bdeca2f 100644 --- a/common/client-libs/validator-client/src/nym_api/routes.rs +++ b/common/client-libs/validator-client/src/nym_api/routes.rs @@ -8,6 +8,7 @@ pub const MIXNODES: &str = "mixnodes"; pub const GATEWAYS: &str = "gateways"; pub const DETAILED: &str = "detailed"; +pub const DETAILED_UNFILTERED: &str = "detailed-unfiltered"; pub const ACTIVE: &str = "active"; pub const REWARDED: &str = "rewarded"; pub const COCONUT_ROUTES: &str = "coconut"; diff --git a/explorer-api/src/mix_node/models.rs b/explorer-api/src/mix_node/models.rs index 6cbb295b6b..1a8d34dc7a 100644 --- a/explorer-api/src/mix_node/models.rs +++ b/explorer-api/src/mix_node/models.rs @@ -42,6 +42,7 @@ pub(crate) struct PrettyDetailedMixNodeBond { pub operating_cost: Coin, pub profit_margin_percent: Percent, pub family_id: Option, + pub blacklisted: bool, } #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)] diff --git a/explorer-api/src/mix_nodes/models.rs b/explorer-api/src/mix_nodes/models.rs index 0cbc7b0167..0fc351ed89 100644 --- a/explorer-api/src/mix_nodes/models.rs +++ b/explorer-api/src/mix_nodes/models.rs @@ -162,6 +162,7 @@ impl ThreadsafeMixNodesCache { operating_cost: rewarding_info.cost_params.interval_operating_cost.clone(), profit_margin_percent: rewarding_info.cost_params.profit_margin_percent, family_id, + blacklisted: node.blacklisted, } } diff --git a/explorer-api/src/tasks.rs b/explorer-api/src/tasks.rs index 0602a2af69..2019d74dce 100644 --- a/explorer-api/src/tasks.rs +++ b/explorer-api/src/tasks.rs @@ -43,7 +43,7 @@ impl ExplorerApiTasks { async fn retrieve_all_mixnodes(&self) -> Vec { info!("About to retrieve all mixnode bonds..."); - self.retrieve_mixnodes(validator_client::Client::get_cached_mixnodes_detailed) + self.retrieve_mixnodes(validator_client::Client::get_cached_mixnodes_detailed_unfiltered) .await } diff --git a/explorer/src/components/MixNodes/Economics/Table.tsx b/explorer/src/components/MixNodes/Economics/Table.tsx index 74bfa30251..e6630334db 100644 --- a/explorer/src/components/MixNodes/Economics/Table.tsx +++ b/explorer/src/components/MixNodes/Economics/Table.tsx @@ -53,7 +53,6 @@ export const DelegatorsInfoTable: FCWithChildren { const { field } = columnsData[index]; const value: EconomicsRowsType = (eachRow as any)[field]; - console.log(value); return ( { const { mixNode, mixNodeRow, description, stats, status, uptimeStory, uniqDelegations } = useMixnodeContext(); - console.log(mixNodeRow); + const isMobile = useIsMobile(); return ( @@ -73,6 +74,11 @@ const PageMixnodeDetailWithState: FCWithChildren = () => { {mixNodeRow && description?.data && ( <MixNodeDetailSection mixNodeRow={mixNodeRow} mixnodeDescription={description.data} /> )} + {mixNodeRow?.blacklisted && ( + <Typography textAlign={isMobile ? 'left' : 'right'} fontSize="smaller" sx={{ color: 'error.main' }}> + This node is having a poor performance + </Typography> + )} </Grid> </Grid> <Grid container> diff --git a/explorer/src/typeDefs/explorer-api.ts b/explorer/src/typeDefs/explorer-api.ts index 6f1fe6a891..d81e3a3d8a 100644 --- a/explorer/src/typeDefs/explorer-api.ts +++ b/explorer/src/typeDefs/explorer-api.ts @@ -89,6 +89,7 @@ export interface MixNodeResponseItem { uncapped_saturation: number; operating_cost: Amount; profit_margin_percent: string; + blacklisted: boolean; } export type MixNodeResponse = MixNodeResponseItem[]; diff --git a/nym-api/nym-api-requests/src/models.rs b/nym-api/nym-api-requests/src/models.rs index daebc0b0ac..319d49edd1 100644 --- a/nym-api/nym-api-requests/src/models.rs +++ b/nym-api/nym-api-requests/src/models.rs @@ -111,6 +111,7 @@ pub struct MixNodeBondAnnotated { pub estimated_operator_apy: Decimal, pub estimated_delegators_apy: Decimal, pub family: Option<FamilyHead>, + pub blacklisted: bool, } impl MixNodeBondAnnotated { @@ -137,6 +138,7 @@ pub struct GatewayBondAnnotated { // NOTE: the performance field is deprecated in favour of node_performance pub performance: Performance, pub node_performance: NodePerformance, + pub blacklisted: bool, } impl GatewayBondAnnotated { diff --git a/nym-api/src/epoch_operations/mod.rs b/nym-api/src/epoch_operations/mod.rs index c151482bcb..4b25a8ae53 100644 --- a/nym-api/src/epoch_operations/mod.rs +++ b/nym-api/src/epoch_operations/mod.rs @@ -102,7 +102,7 @@ impl RewardedSetUpdater { let epoch_end = interval.current_epoch_end(); - let all_mixnodes = self.nym_contract_cache.mixnodes().await; + let all_mixnodes = self.nym_contract_cache.mixnodes_filtered().await; if all_mixnodes.is_empty() { // that's a bit weird, but log::warn!("there don't seem to be any mixnodes on the network!") diff --git a/nym-api/src/node_status_api/cache/mod.rs b/nym-api/src/node_status_api/cache/mod.rs index d996fbb69b..ba74ab561c 100644 --- a/nym-api/src/node_status_api/cache/mod.rs +++ b/nym-api/src/node_status_api/cache/mod.rs @@ -89,10 +89,15 @@ impl NodeStatusCache { } } - pub(crate) async fn mixnodes_annotated(&self) -> Option<Cache<Vec<MixNodeBondAnnotated>>> { + pub(crate) async fn mixnodes_annotated_full(&self) -> Option<Cache<Vec<MixNodeBondAnnotated>>> { self.get(|c| c.mixnodes_annotated.clone()).await } + pub(crate) async fn mixnodes_annotated_filtered(&self) -> Option<Vec<MixNodeBondAnnotated>> { + let full = self.mixnodes_annotated_full().await?; + Some(full.value.into_iter().filter(|m| !m.blacklisted).collect()) + } + pub(crate) async fn rewarded_set_annotated(&self) -> Option<Cache<Vec<MixNodeBondAnnotated>>> { self.get(|c| c.rewarded_set_annotated.clone()).await } @@ -101,10 +106,15 @@ impl NodeStatusCache { self.get(|c| c.active_set_annotated.clone()).await } - pub(crate) async fn gateways_annotated(&self) -> Option<Cache<Vec<GatewayBondAnnotated>>> { + pub(crate) async fn gateways_annotated_full(&self) -> Option<Cache<Vec<GatewayBondAnnotated>>> { self.get(|c| c.gateways_annotated.clone()).await } + pub(crate) async fn gateways_annotated_filtered(&self) -> Option<Vec<GatewayBondAnnotated>> { + let full = self.gateways_annotated_full().await?; + Some(full.value.into_iter().filter(|m| !m.blacklisted).collect()) + } + pub(crate) async fn inclusion_probabilities(&self) -> Option<Cache<InclusionProbabilities>> { self.get(|c| c.inclusion_probabilities.clone()).await } @@ -126,7 +136,7 @@ impl NodeStatusCache { return (Some(bond.clone()), MixnodeStatus::Standby); } - let all_bonded = &self.mixnodes_annotated().await.unwrap().into_inner(); + let all_bonded = &self.mixnodes_annotated_filtered().await.unwrap(); if let Some(bond) = all_bonded.iter().find(|mix| mix.mix_id() == mix_id) { (Some(bond.clone()), MixnodeStatus::Inactive) } else { diff --git a/nym-api/src/node_status_api/cache/node_sets.rs b/nym-api/src/node_status_api/cache/node_sets.rs index 2d856bf9e7..a80c84d2d1 100644 --- a/nym-api/src/node_status_api/cache/node_sets.rs +++ b/nym-api/src/node_status_api/cache/node_sets.rs @@ -6,7 +6,7 @@ use nym_mixnet_contract_common::{reward_params::Performance, Interval, MixId}; use nym_mixnet_contract_common::{ GatewayBond, IdentityKey, MixNodeDetails, RewardedSetNodeStatus, RewardingParams, }; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; pub(super) fn to_rewarded_set_node_status( rewarded_set: &[MixNodeDetails], @@ -84,6 +84,7 @@ pub(super) async fn annotate_nodes_with_details( current_interval: Interval, rewarded_set: &HashMap<MixId, RewardedSetNodeStatus>, mix_to_family: Vec<(IdentityKey, FamilyHead)>, + blacklist: &HashSet<MixId>, ) -> Vec<MixNodeBondAnnotated> { let mix_to_family = mix_to_family .into_iter() @@ -135,6 +136,7 @@ pub(super) async fn annotate_nodes_with_details( .cloned(); annotated.push(MixNodeBondAnnotated { + blacklisted: blacklist.contains(&mixnode.mix_id()), mixnode_details: mixnode, stake_saturation, uncapped_stake_saturation, @@ -152,6 +154,7 @@ pub(crate) async fn annotate_gateways_with_details( storage: &Option<NymApiStorage>, gateway_bonds: Vec<GatewayBond>, current_interval: Interval, + blacklist: &HashSet<IdentityKey>, ) -> Vec<GatewayBondAnnotated> { let mut annotated = Vec::new(); for gateway_bond in gateway_bonds { @@ -175,6 +178,7 @@ pub(crate) async fn annotate_gateways_with_details( .unwrap_or_default(); annotated.push(GatewayBondAnnotated { + blacklisted: blacklist.contains(&gateway_bond.gateway.identity_key), gateway_bond, performance, node_performance, diff --git a/nym-api/src/node_status_api/cache/refresher.rs b/nym-api/src/node_status_api/cache/refresher.rs index 146e75ebfb..7e84ea2ee8 100644 --- a/nym-api/src/node_status_api/cache/refresher.rs +++ b/nym-api/src/node_status_api/cache/refresher.rs @@ -109,13 +109,17 @@ impl NodeStatusCacheRefresher { log::info!("Updating node status cache"); // Fetch contract cache data to work with - let mixnode_details = self.contract_cache.mixnodes().await; + let mixnode_details = self.contract_cache.mixnodes_all().await; let interval_reward_params = self.contract_cache.interval_reward_params().await; let current_interval = self.contract_cache.current_interval().await; let rewarded_set = self.contract_cache.rewarded_set().await; let active_set = self.contract_cache.active_set().await; let mix_to_family = self.contract_cache.mix_to_family().await; - let gateway_bonds = self.contract_cache.gateways().await; + let gateway_bonds = self.contract_cache.gateways_all().await; + + // get blacklists + let mixnodes_blacklist = self.contract_cache.mixnodes_blacklist().await; + let gateways_blacklist = self.contract_cache.gateways_blacklist().await; let interval_reward_params = interval_reward_params.ok_or(NodeStatusCacheError::SourceDataMissing)?; @@ -140,6 +144,7 @@ impl NodeStatusCacheRefresher { current_interval, &rewarded_set_node_status, mix_to_family.to_vec(), + &mixnodes_blacklist, ) .await; @@ -147,8 +152,13 @@ impl NodeStatusCacheRefresher { let (rewarded_set, active_set) = split_into_active_and_rewarded_set(&mixnodes_annotated, &rewarded_set_node_status); - let gateways_annotated = - annotate_gateways_with_details(&self.storage, gateway_bonds, current_interval).await; + let gateways_annotated = annotate_gateways_with_details( + &self.storage, + gateway_bonds, + current_interval, + &gateways_blacklist, + ) + .await; // Update the cache self.cache diff --git a/nym-api/src/node_status_api/helpers.rs b/nym-api/src/node_status_api/helpers.rs index d131c6088e..6a67910810 100644 --- a/nym-api/src/node_status_api/helpers.rs +++ b/nym-api/src/node_status_api/helpers.rs @@ -24,17 +24,19 @@ async fn get_gateway_bond_annotated( cache: &NodeStatusCache, identity: &str, ) -> Result<GatewayBondAnnotated, ErrorResponse> { - let gateways = cache.gateways_annotated().await.ok_or(ErrorResponse::new( - "no data available", - Status::ServiceUnavailable, - ))?; + let gateways = cache + .gateways_annotated_filtered() + .await + .ok_or(ErrorResponse::new( + "no data available", + Status::ServiceUnavailable, + ))?; gateways - .into_inner() .into_iter() .find(|gateway| gateway.identity() == identity) .ok_or(ErrorResponse::new( - "mixnode bond not found", + "gateway bond not found", Status::NotFound, )) } @@ -43,13 +45,15 @@ async fn get_mixnode_bond_annotated( cache: &NodeStatusCache, mix_id: MixId, ) -> Result<MixNodeBondAnnotated, ErrorResponse> { - let mixnodes = cache.mixnodes_annotated().await.ok_or(ErrorResponse::new( - "no data available", - Status::ServiceUnavailable, - ))?; + let mixnodes = cache + .mixnodes_annotated_filtered() + .await + .ok_or(ErrorResponse::new( + "no data available", + Status::ServiceUnavailable, + ))?; mixnodes - .into_inner() .into_iter() .find(|mixnode| mixnode.mix_id() == mix_id) .ok_or(ErrorResponse::new( @@ -374,7 +378,16 @@ pub(crate) async fn _get_mixnode_inclusion_probabilities( pub(crate) async fn _get_mixnodes_detailed(cache: &NodeStatusCache) -> Vec<MixNodeBondAnnotated> { cache - .mixnodes_annotated() + .mixnodes_annotated_filtered() + .await + .unwrap_or_default() +} + +pub(crate) async fn _get_mixnodes_detailed_unfiltered( + cache: &NodeStatusCache, +) -> Vec<MixNodeBondAnnotated> { + cache + .mixnodes_annotated_full() .await .unwrap_or_default() .into_inner() @@ -400,7 +413,16 @@ pub(crate) async fn _get_active_set_detailed(cache: &NodeStatusCache) -> Vec<Mix pub(crate) async fn _get_gateways_detailed(cache: &NodeStatusCache) -> Vec<GatewayBondAnnotated> { cache - .gateways_annotated() + .gateways_annotated_filtered() + .await + .unwrap_or_default() +} + +pub(crate) async fn _get_gateways_detailed_unfiltered( + cache: &NodeStatusCache, +) -> Vec<GatewayBondAnnotated> { + cache + .gateways_annotated_full() .await .unwrap_or_default() .into_inner() diff --git a/nym-api/src/node_status_api/mod.rs b/nym-api/src/node_status_api/mod.rs index 1b05827e97..6906e8aab3 100644 --- a/nym-api/src/node_status_api/mod.rs +++ b/nym-api/src/node_status_api/mod.rs @@ -48,9 +48,11 @@ pub(crate) fn node_status_routes( routes::get_gateway_avg_uptime, routes::get_mixnode_inclusion_probabilities, routes::get_mixnodes_detailed, + routes::get_mixnodes_detailed_unfiltered, routes::get_rewarded_set_detailed, routes::get_active_set_detailed, routes::get_gateways_detailed, + routes::get_gateways_detailed_unfiltered, ] } else { // in the minimal variant we would not have access to endpoints relying on existence diff --git a/nym-api/src/node_status_api/routes.rs b/nym-api/src/node_status_api/routes.rs index 9d1f9d7dc0..b014abef06 100644 --- a/nym-api/src/node_status_api/routes.rs +++ b/nym-api/src/node_status_api/routes.rs @@ -6,11 +6,11 @@ use super::NodeStatusCache; use crate::node_status_api::helpers::{ _compute_mixnode_reward_estimation, _gateway_core_status_count, _gateway_report, _gateway_uptime_history, _get_active_set_detailed, _get_gateway_avg_uptime, - _get_mixnode_avg_uptime, _get_mixnode_inclusion_probabilities, - _get_mixnode_inclusion_probability, _get_mixnode_reward_estimation, - _get_mixnode_stake_saturation, _get_mixnode_status, _get_mixnodes_detailed, - _get_rewarded_set_detailed, _mixnode_core_status_count, _mixnode_report, - _mixnode_uptime_history, + _get_gateways_detailed_unfiltered, _get_mixnode_avg_uptime, + _get_mixnode_inclusion_probabilities, _get_mixnode_inclusion_probability, + _get_mixnode_reward_estimation, _get_mixnode_stake_saturation, _get_mixnode_status, + _get_mixnodes_detailed, _get_mixnodes_detailed_unfiltered, _get_rewarded_set_detailed, + _mixnode_core_status_count, _mixnode_report, _mixnode_uptime_history, }; use crate::node_status_api::models::ErrorResponse; use crate::storage::NymApiStorage; @@ -188,6 +188,14 @@ pub async fn get_mixnodes_detailed( Json(_get_mixnodes_detailed(cache).await) } +#[openapi(tag = "status")] +#[get("/mixnodes/detailed-unfiltered")] +pub async fn get_mixnodes_detailed_unfiltered( + cache: &State<NodeStatusCache>, +) -> Json<Vec<MixNodeBondAnnotated>> { + Json(_get_mixnodes_detailed_unfiltered(cache).await) +} + #[openapi(tag = "status")] #[get("/mixnodes/rewarded/detailed")] pub async fn get_rewarded_set_detailed( @@ -211,3 +219,11 @@ pub async fn get_gateways_detailed( ) -> Json<Vec<GatewayBondAnnotated>> { Json(_get_gateways_detailed(cache).await) } + +#[openapi(tag = "status")] +#[get("/gateways/detailed-unfiltered")] +pub async fn get_gateways_detailed_unfiltered( + cache: &State<NodeStatusCache>, +) -> Json<Vec<GatewayBondAnnotated>> { + Json(_get_gateways_detailed_unfiltered(cache).await) +} diff --git a/nym-api/src/nym_contract_cache/cache/mod.rs b/nym-api/src/nym_contract_cache/cache/mod.rs index 1ee787af17..cd885f7a5d 100644 --- a/nym-api/src/nym_contract_cache/cache/mod.rs +++ b/nym-api/src/nym_contract_cache/cache/mod.rs @@ -67,50 +67,48 @@ impl NymContractCache { } } - pub async fn mixnodes_blacklist(&self) -> Option<Cache<HashSet<MixId>>> { + pub async fn mixnodes_blacklist(&self) -> Cache<HashSet<MixId>> { match time::timeout(Duration::from_millis(100), self.inner.read()).await { - Ok(cache) => Some(cache.mixnodes_blacklist.clone()), + Ok(cache) => cache.mixnodes_blacklist.clone(), Err(err) => { error!("{err}"); - None + Cache::new(HashSet::new()) } } } - pub async fn gateways_blacklist(&self) -> Option<Cache<HashSet<IdentityKey>>> { + pub async fn gateways_blacklist(&self) -> Cache<HashSet<IdentityKey>> { match time::timeout(Duration::from_millis(100), self.inner.read()).await { - Ok(cache) => Some(cache.gateways_blacklist.clone()), + Ok(cache) => cache.gateways_blacklist.clone(), Err(err) => { error!("{err}"); - None + Cache::new(HashSet::new()) } } } pub async fn update_mixnodes_blacklist(&self, add: HashSet<MixId>, remove: HashSet<MixId>) { let blacklist = self.mixnodes_blacklist().await; - if let Some(blacklist) = blacklist { - let mut blacklist = blacklist - .value - .union(&add) - .cloned() - .collect::<HashSet<MixId>>(); - let to_remove = blacklist - .intersection(&remove) - .cloned() - .collect::<HashSet<MixId>>(); - for key in to_remove { - blacklist.remove(&key); + let mut blacklist = blacklist + .value + .union(&add) + .cloned() + .collect::<HashSet<MixId>>(); + let to_remove = blacklist + .intersection(&remove) + .cloned() + .collect::<HashSet<MixId>>(); + for key in to_remove { + blacklist.remove(&key); + } + match time::timeout(Duration::from_millis(100), self.inner.write()).await { + Ok(mut cache) => { + cache.mixnodes_blacklist.update(blacklist); } - match time::timeout(Duration::from_millis(100), self.inner.write()).await { - Ok(mut cache) => { - cache.mixnodes_blacklist.update(blacklist); - return; - } - Err(err) => error!("{err}"), + Err(err) => { + error!("Failed to update mixnodes blacklist: {err}"); } } - error!("Failed to update mixnodes blacklist"); } pub async fn update_gateways_blacklist( @@ -119,49 +117,52 @@ impl NymContractCache { remove: HashSet<IdentityKey>, ) { let blacklist = self.gateways_blacklist().await; - if let Some(blacklist) = blacklist { - let mut blacklist = blacklist - .value - .union(&add) - .cloned() - .collect::<HashSet<IdentityKey>>(); - let to_remove = blacklist - .intersection(&remove) - .cloned() - .collect::<HashSet<IdentityKey>>(); - for key in to_remove { - blacklist.remove(&key); + let mut blacklist = blacklist + .value + .union(&add) + .cloned() + .collect::<HashSet<IdentityKey>>(); + let to_remove = blacklist + .intersection(&remove) + .cloned() + .collect::<HashSet<IdentityKey>>(); + for key in to_remove { + blacklist.remove(&key); + } + match time::timeout(Duration::from_millis(100), self.inner.write()).await { + Ok(mut cache) => { + cache.gateways_blacklist.update(blacklist); } - match time::timeout(Duration::from_millis(100), self.inner.write()).await { - Ok(mut cache) => { - cache.gateways_blacklist.update(blacklist); - return; - } - Err(err) => error!("{err}"), + Err(err) => { + error!("Failed to update gateways blacklist: {err}"); } } - error!("Failed to update gateways blacklist"); } - pub async fn mixnodes(&self) -> Vec<MixNodeDetails> { + pub async fn mixnodes_filtered(&self) -> Vec<MixNodeDetails> { + let mixnodes = self.mixnodes_all().await; + if mixnodes.is_empty() { + return Vec::new(); + } let blacklist = self.mixnodes_blacklist().await; - let mixnodes = match time::timeout(Duration::from_millis(100), self.inner.read()).await { - Ok(cache) => cache.mixnodes.clone(), - Err(err) => { - error!("{err}"); - return Vec::new(); - } - }; - if let Some(blacklist) = blacklist { + if !blacklist.is_empty() { mixnodes - .value - .iter() + .into_iter() .filter(|mix| !blacklist.value.contains(&mix.mix_id())) - .cloned() .collect() } else { - mixnodes.value + mixnodes + } + } + + pub async fn mixnodes_all(&self) -> Vec<MixNodeDetails> { + match time::timeout(Duration::from_millis(100), self.inner.read()).await { + Ok(cache) => cache.mixnodes.clone().value, + Err(err) => { + error!("{err}"); + Vec::new() + } } } @@ -181,25 +182,21 @@ impl NymContractCache { } } - pub async fn gateways(&self) -> Vec<GatewayBond> { - let blacklist = self.gateways_blacklist().await; - let gateways = match time::timeout(Duration::from_millis(100), self.inner.read()).await { - Ok(cache) => cache.gateways.clone(), - Err(err) => { - error!("{err}"); - return Vec::new(); - } - }; + pub async fn gateways_filtered(&self) -> Vec<GatewayBond> { + let gateways = self.gateways_all().await; + if gateways.is_empty() { + return Vec::new(); + } - if let Some(blacklist) = blacklist { + let blacklist = self.gateways_blacklist().await; + + if !blacklist.is_empty() { gateways - .value - .iter() + .into_iter() .filter(|mix| !blacklist.value.contains(mix.identity())) - .cloned() .collect() } else { - gateways.value + gateways } } @@ -277,7 +274,7 @@ impl NymContractCache { return (Some(bond.clone()), MixnodeStatus::Standby); } - let all_bonded = &self.mixnodes().await; + let all_bonded = &self.mixnodes_filtered().await; if let Some(bond) = all_bonded.iter().find(|mix| mix.mix_id() == mix_id) { (Some(bond.clone()), MixnodeStatus::Inactive) } else { diff --git a/nym-api/src/nym_contract_cache/routes.rs b/nym-api/src/nym_contract_cache/routes.rs index d649fc46a4..7b33269c60 100644 --- a/nym-api/src/nym_contract_cache/routes.rs +++ b/nym-api/src/nym_contract_cache/routes.rs @@ -20,7 +20,7 @@ use std::collections::HashSet; #[openapi(tag = "contract-cache")] #[get("/mixnodes")] pub async fn get_mixnodes(cache: &State<NymContractCache>) -> Json<Vec<MixNodeDetails>> { - Json(cache.mixnodes().await) + Json(cache.mixnodes_filtered().await) } // DEPRECATED: this endpoint now lives in `node_status_api`. Once all consumers are updated, @@ -41,7 +41,7 @@ pub async fn get_mixnodes_detailed( #[openapi(tag = "contract-cache")] #[get("/gateways")] pub async fn get_gateways(cache: &State<NymContractCache>) -> Json<Vec<GatewayBond>> { - Json(cache.gateways().await) + Json(cache.gateways_filtered().await) } #[openapi(tag = "contract-cache")] @@ -91,7 +91,12 @@ pub async fn get_active_set_detailed( pub async fn get_blacklisted_mixnodes( cache: &State<NymContractCache>, ) -> Json<Option<HashSet<MixId>>> { - Json(cache.mixnodes_blacklist().await.map(|c| c.value)) + let blacklist = cache.mixnodes_blacklist().await.value; + if blacklist.is_empty() { + Json(None) + } else { + Json(Some(blacklist)) + } } #[openapi(tag = "contract-cache")] @@ -99,7 +104,12 @@ pub async fn get_blacklisted_mixnodes( pub async fn get_blacklisted_gateways( cache: &State<NymContractCache>, ) -> Json<Option<HashSet<String>>> { - Json(cache.gateways_blacklist().await.map(|c| c.value)) + let blacklist = cache.gateways_blacklist().await.value; + if blacklist.is_empty() { + Json(None) + } else { + Json(Some(blacklist)) + } } #[openapi(tag = "contract-cache")] From 60296f2a41a1bb0b99dda2c83ea17681719eec0b Mon Sep 17 00:00:00 2001 From: fmtabbara <fmtabbara@hotmail.co.uk> Date: Wed, 8 Mar 2023 17:51:30 +0000 Subject: [PATCH 05/27] update vesting schedule ui --- .../Balance/VestingTimeline.tsx} | 2 +- .../Balance/cards/TokenTransfer.tsx | 29 +++ .../Balance/cards/VestingSchedule.tsx | 110 +++++++++++ .../Balance/modals}/TransferModal.tsx | 30 +-- .../Balance/modals}/TransferModalSuccess.tsx | 3 +- .../balance/{balance.tsx => Balance.tsx} | 30 +-- nym-wallet/src/pages/balance/Vesting.tsx | 79 ++++++++ nym-wallet/src/pages/balance/index.tsx | 33 +++- nym-wallet/src/pages/balance/types.ts | 1 - nym-wallet/src/pages/balance/vesting.tsx | 185 ------------------ 10 files changed, 273 insertions(+), 229 deletions(-) rename nym-wallet/src/{pages/balance/components/vesting-timeline.tsx => components/Balance/VestingTimeline.tsx} (98%) create mode 100644 nym-wallet/src/components/Balance/cards/TokenTransfer.tsx create mode 100644 nym-wallet/src/components/Balance/cards/VestingSchedule.tsx rename nym-wallet/src/{pages/balance/components => components/Balance/modals}/TransferModal.tsx (79%) rename nym-wallet/src/{pages/balance/components => components/Balance/modals}/TransferModalSuccess.tsx (92%) rename nym-wallet/src/pages/balance/{balance.tsx => Balance.tsx} (73%) create mode 100644 nym-wallet/src/pages/balance/Vesting.tsx delete mode 100644 nym-wallet/src/pages/balance/vesting.tsx diff --git a/nym-wallet/src/pages/balance/components/vesting-timeline.tsx b/nym-wallet/src/components/Balance/VestingTimeline.tsx similarity index 98% rename from nym-wallet/src/pages/balance/components/vesting-timeline.tsx rename to nym-wallet/src/components/Balance/VestingTimeline.tsx index b1a0f663ce..6ff740e33a 100644 --- a/nym-wallet/src/pages/balance/components/vesting-timeline.tsx +++ b/nym-wallet/src/components/Balance/VestingTimeline.tsx @@ -3,7 +3,7 @@ import React, { useContext } from 'react'; import { useTheme } from '@mui/material/styles'; import { Box, Tooltip, Typography } from '@mui/material'; import { format } from 'date-fns'; -import { AppContext } from '../../../context'; +import { AppContext } from 'src/context'; const calculateMarkerPosition = (arrLength: number, index: number) => (1 / arrLength) * 100 * index; diff --git a/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx b/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx new file mode 100644 index 0000000000..cd1f3ba03c --- /dev/null +++ b/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { Card, Stack, Button } from '@mui/material'; +import { ModalListItem } from 'src/components/Modals/ModalListItem'; + +export const TokenTransfer = ({ + onTransfer, + unlockedTokens, + unlockedRewards, + unlockedTransferable, +}: { + userBalance?: string; + unlockedTokens?: string; + unlockedRewards?: string; + unlockedTransferable?: string; + onTransfer: () => void; +}) => { + return ( + <Card variant="outlined" sx={{ p: 3, height: '100%' }}> + <Stack gap={1} sx={{ mb: 2 }}> + <ModalListItem label="Unlocked tokens" value={unlockedTokens} /> + <ModalListItem label="Unlocked rewards" value={unlockedRewards} divider /> + <ModalListItem label="Unlocked transferabled tokens" value={unlockedTransferable} fontWeight={600} /> + </Stack> + <Button size="large" fullWidth variant="contained" onClick={onTransfer} disableElevation> + Transfer + </Button> + </Card> + ); +}; diff --git a/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx b/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx new file mode 100644 index 0000000000..8eec8c7eb7 --- /dev/null +++ b/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx @@ -0,0 +1,110 @@ +import { useContext, useState, useEffect } from 'react'; +import { + TableContainer, + Table, + TableHead, + TableRow, + TableCell, + TableBody, + Box, + Typography, + TableCellProps, + Card, +} from '@mui/material'; +import { Period } from '@nymproject/types'; +import { AppContext } from 'src/context'; +import { VestingTimeline } from '../VestingTimeline'; +import { Stack } from '@mui/system'; + +const columnsHeaders: Array<{ title: string; align: TableCellProps['align'] }> = [ + { title: 'Locked', align: 'left' }, + { title: 'Period', align: 'left' }, + { title: 'Unlocked', align: 'right' }, +]; + +const vestingPeriod = (current?: Period, original?: number) => { + if (current === 'After') return 'Complete'; + + if (typeof current === 'object' && typeof original === 'number') return `${current.In + 1}/${original}`; + + return 'N/A'; +}; + +export const VestingSchedule = () => { + const { userBalance, clientDetails } = useContext(AppContext); + const [vestedPercentage, setVestedPercentage] = useState(0); + + const calculatePercentage = () => { + const { tokenAllocation, originalVesting } = userBalance; + if (tokenAllocation?.vesting && tokenAllocation.vested && tokenAllocation.vested !== '0' && originalVesting) { + const percentage = (+tokenAllocation.vested / +originalVesting.amount.amount) * 100; + const rounded = percentage.toFixed(2); + setVestedPercentage(+rounded); + } else { + setVestedPercentage(0); + } + }; + + useEffect(() => { + calculatePercentage(); + }, [userBalance.tokenAllocation, calculatePercentage]); + + return ( + <Card variant="outlined" sx={{ p: 3, height: '100%' }}> + <TableContainer sx={{ mb: 2 }}> + <Table> + <TableHead> + <TableRow> + {columnsHeaders.map((header) => ( + <TableCell key={header.title} sx={{ color: 'nym.text.muted', pt: 0 }} align={header.align}> + {header.title} + </TableCell> + ))} + </TableRow> + </TableHead> + <TableBody> + <TableRow> + <TableCell + sx={{ + color: 'text.primary', + borderBottom: 'none', + textTransform: 'uppercase', + }} + > + {userBalance.tokenAllocation?.vesting || 'n/a'} / {userBalance.originalVesting?.amount.amount}{' '} + {clientDetails?.display_mix_denom.toUpperCase()} + </TableCell> + <TableCell + align="left" + sx={{ + color: 'text.primary', + borderBottom: 'none', + }} + > + {vestingPeriod(userBalance.currentVestingPeriod, userBalance.originalVesting?.number_of_periods)} + </TableCell> + <TableCell + sx={{ + color: 'text.primary', + borderBottom: 'none', + textTransform: 'uppercase', + }} + align="right" + > + {userBalance.tokenAllocation?.vested || 'n/a'} / {userBalance.originalVesting?.amount.amount}{' '} + {clientDetails?.display_mix_denom.toUpperCase()} + </TableCell> + </TableRow> + </TableBody> + </Table> + </TableContainer> + <Typography variant="body2" sx={{ color: 'nym.text.muted', mb: 3 }}> + Percentage + </Typography> + <Stack direction="row" alignItems="center" gap={2}> + <Typography variant="body2">{vestedPercentage}%</Typography> + <VestingTimeline percentageComplete={vestedPercentage} /> + </Stack> + </Card> + ); +}; diff --git a/nym-wallet/src/pages/balance/components/TransferModal.tsx b/nym-wallet/src/components/Balance/modals/TransferModal.tsx similarity index 79% rename from nym-wallet/src/pages/balance/components/TransferModal.tsx rename to nym-wallet/src/components/Balance/modals/TransferModal.tsx index 02a8318064..8e2d03251d 100644 --- a/nym-wallet/src/pages/balance/components/TransferModal.tsx +++ b/nym-wallet/src/components/Balance/modals/TransferModal.tsx @@ -8,36 +8,22 @@ import { FeeWarning } from 'src/components/FeeWarning'; import { withdrawVestedCoins } from 'src/requests'; import { Console } from 'src/utils/console'; import { simulateWithdrawVestedCoins } from 'src/requests/simulate'; -import { SuccessModal } from './TransferModalSuccess'; -import { TResponseState, TTransactionDetails } from '../types'; +import { useGetFee } from 'src/hooks/useGetFee'; +import { SuccessModal, TTransactionDetails } from './TransferModalSuccess'; +import { TResponseState } from '../../../pages/balance/types'; export const TransferModal = ({ onClose }: { onClose: () => void }) => { const [state, setState] = useState<TResponseState>(); - const [fee, setFee] = useState<FeeDetails>(); + const [tx, setTx] = useState<TTransactionDetails>(); const { userBalance, clientDetails, network } = useContext(AppContext); - - const getFee = async () => { - if (userBalance.tokenAllocation?.spendable && clientDetails?.display_mix_denom) { - try { - const simulatedFee = await simulateWithdrawVestedCoins({ - amount: { amount: userBalance.tokenAllocation?.spendable, denom: clientDetails?.display_mix_denom }, - }); - setFee(simulatedFee); - await userBalance.refreshBalances(); - } catch (e) { - setFee({ - amount: { amount: 'n/a', denom: clientDetails?.display_mix_denom.toUpperCase() as CurrencyDenom }, - fee: { Auto: null }, - }); - Console.error(e); - } - } - }; + const { fee, getFee } = useGetFee(); useEffect(() => { - getFee(); + getFee(simulateWithdrawVestedCoins, { + amount: { amount: userBalance.tokenAllocation?.spendable, denom: clientDetails?.display_mix_denom }, + }); }, []); const handleTransfer = async () => { diff --git a/nym-wallet/src/pages/balance/components/TransferModalSuccess.tsx b/nym-wallet/src/components/Balance/modals/TransferModalSuccess.tsx similarity index 92% rename from nym-wallet/src/pages/balance/components/TransferModalSuccess.tsx rename to nym-wallet/src/components/Balance/modals/TransferModalSuccess.tsx index b27c679d5a..13b762bcb5 100644 --- a/nym-wallet/src/pages/balance/components/TransferModalSuccess.tsx +++ b/nym-wallet/src/components/Balance/modals/TransferModalSuccess.tsx @@ -2,7 +2,8 @@ import React from 'react'; import { Stack, Typography } from '@mui/material'; import { Link } from '@nymproject/react/link/Link'; import { ConfirmationModal } from 'src/components'; -import { TTransactionDetails } from '../types'; + +export type TTransactionDetails = { amount: string; url: string }; export const SuccessModal = ({ tx, onClose }: { tx?: TTransactionDetails; onClose: () => void }) => ( <ConfirmationModal diff --git a/nym-wallet/src/pages/balance/balance.tsx b/nym-wallet/src/pages/balance/Balance.tsx similarity index 73% rename from nym-wallet/src/pages/balance/balance.tsx rename to nym-wallet/src/pages/balance/Balance.tsx index 12183ef987..160d136979 100644 --- a/nym-wallet/src/pages/balance/balance.tsx +++ b/nym-wallet/src/pages/balance/Balance.tsx @@ -3,14 +3,20 @@ import { Alert, Grid, Typography } from '@mui/material'; import { Link } from '@nymproject/react/link/Link'; import { NymCard, ClientAddress } from '../../components'; import { AppContext, urls } from '../../context/main'; +import { Network } from 'src/types'; +import { Balance } from '@nymproject/types'; -export const BalanceCard = () => { - const { userBalance, clientDetails, network } = useContext(AppContext); - - useEffect(() => { - userBalance.fetchBalance(); - }, []); - +export const BalanceCard = ({ + userBalance, + userBalanceError, + network, + clientAddress, +}: { + userBalance?: Balance; + userBalanceError?: string; + network?: Network; + clientAddress?: string; +}) => { return ( <NymCard title="Balance" @@ -20,12 +26,12 @@ export const BalanceCard = () => { > <Grid container direction="column" spacing={2}> <Grid item> - {userBalance.error && ( + {userBalanceError && ( <Alert severity="error" data-testid="error-refresh" sx={{ p: 2 }}> - {userBalance.error} + {userBalanceError} </Alert> )} - {!userBalance.error && ( + {!userBalanceError && ( <Typography data-testid="refresh-success" sx={{ @@ -36,14 +42,14 @@ export const BalanceCard = () => { }} variant="h5" > - {userBalance.balance?.printable_balance} + {userBalance?.printable_balance} </Typography> )} </Grid> {network && ( <Grid item> <Link - href={`${urls(network).mixnetExplorer}/account/${clientDetails?.client_address}`} + href={`${urls(network).mixnetExplorer}/account/${clientAddress}`} target="_blank" text="Last transactions" fontSize={14} diff --git a/nym-wallet/src/pages/balance/Vesting.tsx b/nym-wallet/src/pages/balance/Vesting.tsx new file mode 100644 index 0000000000..010a0cb94c --- /dev/null +++ b/nym-wallet/src/pages/balance/Vesting.tsx @@ -0,0 +1,79 @@ +import React from 'react'; +import { Refresh } from '@mui/icons-material'; +import { Grid, IconButton, Typography } from '@mui/material'; +import { useSnackbar } from 'notistack'; +import { useEffect } from 'react'; +import { NymCard } from 'src/components'; +import { TokenTransfer } from 'src/components/Balance/cards/TokenTransfer'; +import { OriginalVestingResponse } from '@nymproject/types'; +import { VestingSchedule } from 'src/components/Balance/cards/VestingSchedule'; + +export const VestingCard = ({ + userBalance, + unlockedTokens, + unlockedRewards, + originalVesting, + onTransfer, + fetchBalance, + fetchTokenAllocation, +}: { + unlockedTokens?: string; + unlockedRewards?: string; + userBalance?: string; + originalVesting?: OriginalVestingResponse; + fetchTokenAllocation: () => Promise<void>; + fetchBalance: () => Promise<void>; + onTransfer: () => Promise<void>; +}) => { + const { enqueueSnackbar, closeSnackbar } = useSnackbar(); + + const refreshBalances = async () => { + await fetchBalance(); + await fetchTokenAllocation(); + }; + + useEffect(() => { + closeSnackbar(); + fetchTokenAllocation(); + }, []); + + if (!originalVesting) return null; + + return ( + <NymCard + title="Vesting Schedule" + subheader={ + <Typography variant="caption" sx={{ color: 'nym.text.muted' }}> + You can use up to 10% of your locked tokens for bonding and delegating + </Typography> + } + borderless + data-testid="check-unvested-tokens" + Action={ + <IconButton + onClick={async () => { + await refreshBalances(); + enqueueSnackbar('Balances updated', { variant: 'success', preventDuplicate: true }); + }} + > + <Refresh /> + </IconButton> + } + > + <Grid container spacing={3}> + <Grid item xs={12} xl={8}> + <VestingSchedule /> + </Grid> + <Grid item xs={12} xl={4}> + <TokenTransfer + onTransfer={onTransfer} + unlockedTokens={unlockedTokens} + unlockedRewards={unlockedRewards} + unlockedTransferable={unlockedTokens} + userBalance={userBalance} + /> + </Grid> + </Grid> + </NymCard> + ); +}; diff --git a/nym-wallet/src/pages/balance/index.tsx b/nym-wallet/src/pages/balance/index.tsx index e214d1bddf..778ca020fc 100644 --- a/nym-wallet/src/pages/balance/index.tsx +++ b/nym-wallet/src/pages/balance/index.tsx @@ -1,27 +1,46 @@ -import React, { useContext, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { Box } from '@mui/material'; import { AppContext } from '../../context/main'; -import { BalanceCard } from './balance'; -import { VestingCard } from './vesting'; +import { BalanceCard } from './Balance'; +import { VestingCard } from './Vesting'; import { PageLayout } from '../../layouts'; -import { TransferModal } from './components/TransferModal'; +import { TransferModal } from '../../components/Balance/modals/TransferModal'; export const Balance = () => { const [showTransferModal, setShowTransferModal] = useState(false); - const { userBalance } = useContext(AppContext); + const { userBalance, clientDetails, network } = useContext(AppContext); + + useEffect(() => { + userBalance.fetchBalance(); + }, []); const handleShowTransferModal = async () => { await userBalance.refreshBalances(); setShowTransferModal(true); }; + const appendDenom = (value: string = '') => `${value} ${clientDetails?.display_mix_denom.toUpperCase()}`; + return ( <PageLayout> <Box display="flex" flexDirection="column" gap={4}> - <BalanceCard /> - <VestingCard onTransfer={handleShowTransferModal} /> + <BalanceCard + userBalance={userBalance.balance} + userBalanceError={userBalance.error} + clientAddress={clientDetails?.client_address} + network={network} + /> + <VestingCard + userBalance={appendDenom(userBalance.balance?.printable_balance)} + unlockedTokens={appendDenom(userBalance.tokenAllocation?.spendable)} + unlockedRewards={appendDenom(userBalance.tokenAllocation?.spendable)} + originalVesting={userBalance.originalVesting} + onTransfer={handleShowTransferModal} + fetchBalance={userBalance.fetchBalance} + fetchTokenAllocation={userBalance.fetchTokenAllocation} + /> {showTransferModal && <TransferModal onClose={() => setShowTransferModal(false)} />} </Box> </PageLayout> diff --git a/nym-wallet/src/pages/balance/types.ts b/nym-wallet/src/pages/balance/types.ts index 5f88fe60b1..4c4ee67403 100644 --- a/nym-wallet/src/pages/balance/types.ts +++ b/nym-wallet/src/pages/balance/types.ts @@ -1,2 +1 @@ export type TResponseState = 'loading' | 'success' | 'fail'; -export type TTransactionDetails = { amount: string; url: string }; diff --git a/nym-wallet/src/pages/balance/vesting.tsx b/nym-wallet/src/pages/balance/vesting.tsx deleted file mode 100644 index d84accf898..0000000000 --- a/nym-wallet/src/pages/balance/vesting.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import React, { useContext, useEffect, useState } from 'react'; -import { Refresh } from '@mui/icons-material'; -import { - Box, - Button, - IconButton, - Table, - TableBody, - TableCell, - TableCellProps, - TableContainer, - TableHead, - TableRow, - Typography, -} from '@mui/material'; -import { useSnackbar } from 'notistack'; -import { NymCard } from 'src/components'; -import { AppContext } from 'src/context/main'; -import { Period } from 'src/types'; -import { VestingTimeline } from './components/vesting-timeline'; - -const columnsHeaders: Array<{ title: string; align: TableCellProps['align'] }> = [ - { title: 'Locked', align: 'left' }, - { title: 'Period', align: 'left' }, - { title: 'Percentage Vested', align: 'left' }, - { title: 'Unlocked', align: 'right' }, -]; - -const vestingPeriod = (current?: Period, original?: number) => { - if (current === 'After') return 'Complete'; - - if (typeof current === 'object' && typeof original === 'number') return `${current.In + 1}/${original}`; - - return 'N/A'; -}; - -const VestingSchedule = () => { - const { userBalance, clientDetails } = useContext(AppContext); - const [vestedPercentage, setVestedPercentage] = useState(0); - - const calculatePercentage = () => { - const { tokenAllocation, originalVesting } = userBalance; - if (tokenAllocation?.vesting && tokenAllocation.vested && tokenAllocation.vested !== '0' && originalVesting) { - const percentage = (+tokenAllocation.vested / +originalVesting.amount.amount) * 100; - const rounded = percentage.toFixed(2); - setVestedPercentage(+rounded); - } else { - setVestedPercentage(0); - } - }; - - useEffect(() => { - calculatePercentage(); - }, [userBalance.tokenAllocation, calculatePercentage]); - - return ( - <TableContainer sx={{ py: 1 }}> - <Table> - <TableHead> - <TableRow> - {columnsHeaders.map((header) => ( - <TableCell key={header.title} sx={{ color: (t) => t.palette.nym.text.muted }} align={header.align}> - {header.title} - </TableCell> - ))} - </TableRow> - </TableHead> - <TableBody> - <TableRow> - <TableCell - sx={{ - color: 'text.primary', - borderBottom: 'none', - textTransform: 'uppercase', - }} - > - {userBalance.tokenAllocation?.vesting || 'n/a'} / {userBalance.originalVesting?.amount.amount}{' '} - {clientDetails?.display_mix_denom.toUpperCase()} - </TableCell> - <TableCell - align="left" - sx={{ - color: 'text.primary', - borderBottom: 'none', - }} - > - {vestingPeriod(userBalance.currentVestingPeriod, userBalance.originalVesting?.number_of_periods)} - </TableCell> - <TableCell - sx={{ - color: 'text.primary', - borderBottom: 'none', - }} - > - <Box display="flex" alignItems="center" gap={1}> - <Typography variant="body2">{`${vestedPercentage}%`}</Typography> - <VestingTimeline percentageComplete={vestedPercentage} /> - </Box> - </TableCell> - <TableCell - sx={{ - color: 'text.primary', - borderBottom: 'none', - textTransform: 'uppercase', - }} - align="right" - > - {userBalance.tokenAllocation?.vested || 'n/a'} / {userBalance.originalVesting?.amount.amount}{' '} - {clientDetails?.display_mix_denom.toUpperCase()} - </TableCell> - </TableRow> - </TableBody> - </Table> - </TableContainer> - ); -}; - -const TokenTransfer = () => { - const { userBalance, clientDetails } = useContext(AppContext); - - return ( - <Box sx={{ my: 3 }}> - <Typography variant="subtitle2" sx={{ mb: 3, fontWeight: '600' }}> - Unlocked transferable tokens - </Typography> - - <Typography - data-testid="refresh-success" - sx={{ color: 'text.primary', fontWeight: '600', fontSize: 28 }} - variant="h5" - textTransform="uppercase" - > - {userBalance.tokenAllocation?.spendable || 'n/a'} {clientDetails?.display_mix_denom.toUpperCase()} - </Typography> - </Box> - ); -}; - -export const VestingCard = ({ onTransfer }: { onTransfer: () => Promise<void> }) => { - const { userBalance } = useContext(AppContext); - const { enqueueSnackbar, closeSnackbar } = useSnackbar(); - - const refreshBalances = async () => { - await userBalance.fetchBalance(); - await userBalance.fetchTokenAllocation(); - }; - - useEffect(() => { - closeSnackbar(); - userBalance.fetchTokenAllocation(); - }, []); - - if (!userBalance.originalVesting) return null; - - return ( - <NymCard - title="Vesting Schedule" - subheader={ - <Typography variant="caption" sx={{ color: 'nym.text.muted' }}> - You can use up to 10% of your locked tokens for bonding and delegating - </Typography> - } - borderless - data-testid="check-unvested-tokens" - Action={ - <IconButton - onClick={async () => { - await refreshBalances(); - enqueueSnackbar('Balances updated', { variant: 'success', preventDuplicate: true }); - }} - > - <Refresh /> - </IconButton> - } - > - <VestingSchedule /> - <TokenTransfer /> - <Box display="flex" justifyContent="end" alignItems="center"> - <Button size="large" variant="contained" onClick={onTransfer} disableElevation> - Transfer - </Button> - </Box> - </NymCard> - ); -}; From 7061beea6efdde3952e75cc86fab1edc7763df8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= <jedrzej.stuczynski@gmail.com> Date: Thu, 9 Mar 2023 11:28:50 +0000 Subject: [PATCH 06/27] exposing tauri operations for spendable vested and reward coins --- nym-wallet/src-tauri/src/main.rs | 2 ++ .../src/operations/vesting/queries.rs | 36 +++++++++++++++++++ nym-wallet/src/requests/vesting.ts | 4 +++ 3 files changed, 42 insertions(+) diff --git a/nym-wallet/src-tauri/src/main.rs b/nym-wallet/src-tauri/src/main.rs index 15f03fc481..4677e46e69 100644 --- a/nym-wallet/src-tauri/src/main.rs +++ b/nym-wallet/src-tauri/src/main.rs @@ -126,6 +126,8 @@ fn main() { vesting::queries::locked_coins, vesting::queries::original_vesting, vesting::queries::spendable_coins, + vesting::queries::spendable_vested_coins, + vesting::queries::spendable_reward_coins, vesting::queries::get_historical_vesting_staking_reward, vesting::queries::get_spendable_vested_coins, vesting::queries::get_spendable_reward_coins, diff --git a/nym-wallet/src-tauri/src/operations/vesting/queries.rs b/nym-wallet/src-tauri/src/operations/vesting/queries.rs index afef1d3dac..412e88ea71 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/queries.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/queries.rs @@ -54,6 +54,42 @@ pub(crate) async fn spendable_coins( Ok(display) } +#[tauri::command] +pub(crate) async fn spendable_vested_coins( + state: tauri::State<'_, WalletState>, +) -> Result<DecCoin, BackendError> { + log::info!(">>> Query spendable vested coins"); + let guard = state.read().await; + let client = guard.current_client()?; + + let res = client + .nyxd + .get_spendable_vested_coins(client.nyxd.address().as_ref()) + .await?; + + let display = guard.attempt_convert_to_display_dec_coin(res)?; + log::info!("<<< spendable vested coins = {}", display); + Ok(display) +} + +#[tauri::command] +pub(crate) async fn spendable_reward_coins( + state: tauri::State<'_, WalletState>, +) -> Result<DecCoin, BackendError> { + log::info!(">>> Query spendable reward coins"); + let guard = state.read().await; + let client = guard.current_client()?; + + let res = client + .nyxd + .get_spendable_reward_coins(client.nyxd.address().as_ref()) + .await?; + + let display = guard.attempt_convert_to_display_dec_coin(res)?; + log::info!("<<< spendable reward coins = {}", display); + Ok(display) +} + #[tauri::command] pub(crate) async fn vested_coins( vesting_account_address: &str, diff --git a/nym-wallet/src/requests/vesting.ts b/nym-wallet/src/requests/vesting.ts index 993910dd14..4c64e3f63d 100644 --- a/nym-wallet/src/requests/vesting.ts +++ b/nym-wallet/src/requests/vesting.ts @@ -18,6 +18,10 @@ export const getLockedCoins = async (): Promise<DecCoin> => invokeWrapper<DecCoi export const getSpendableCoins = async (): Promise<DecCoin> => invokeWrapper<DecCoin>('spendable_coins'); +export const getSpendableVestedCoins = async (): Promise<DecCoin> => invokeWrapper<DecCoin>('spendable_vested_coins'); + +export const getSpendableRewardCoins = async (): Promise<DecCoin> => invokeWrapper<DecCoin>('spendable_reward_coins'); + export const getVestingCoins = async (vestingAccountAddress: string): Promise<DecCoin> => invokeWrapper<DecCoin>('vesting_coins', { vestingAccountAddress }); From ec7b9590289b26c32cfb661d1e308ef4c006cf15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= <jedrzej.stuczynski@gmail.com> Date: Thu, 9 Mar 2023 11:30:30 +0000 Subject: [PATCH 07/27] removed source of future clippy complaints --- .../src/operations/vesting/queries.rs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/nym-wallet/src-tauri/src/operations/vesting/queries.rs b/nym-wallet/src-tauri/src/operations/vesting/queries.rs index 412e88ea71..72ce47e9ef 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/queries.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/queries.rs @@ -28,7 +28,7 @@ pub(crate) async fn locked_coins( ) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< locked coins = {}", display); + log::info!("<<< locked coins = {display}"); Ok(display) } @@ -50,7 +50,7 @@ pub(crate) async fn spendable_coins( .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< spendable coins = {}", display); + log::info!("<<< spendable coins = {display}"); Ok(display) } @@ -68,7 +68,7 @@ pub(crate) async fn spendable_vested_coins( .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< spendable vested coins = {}", display); + log::info!("<<< spendable vested coins = {display}"); Ok(display) } @@ -86,7 +86,7 @@ pub(crate) async fn spendable_reward_coins( .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< spendable reward coins = {}", display); + log::info!("<<< spendable reward coins = {display}"); Ok(display) } @@ -109,7 +109,7 @@ pub(crate) async fn vested_coins( .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< vested coins = {}", display); + log::info!("<<< vested coins = {display}"); Ok(display) } @@ -132,7 +132,7 @@ pub(crate) async fn vesting_coins( .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< vesting coins = {}", display); + log::info!("<<< vesting coins = {display}"); Ok(display) } @@ -197,7 +197,7 @@ pub(crate) async fn get_historical_vesting_staking_reward( .get_historical_vesting_staking_reward(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< historical vesting staking reward coins = {}", display); + log::info!("<<< historical vesting staking reward coins = {display}"); Ok(display) } @@ -214,7 +214,7 @@ pub(crate) async fn get_spendable_vested_coins( .get_spendable_vested_coins(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< spendable vested coins = {}", display); + log::info!("<<< spendable vested coins = {display}"); Ok(display) } @@ -231,7 +231,7 @@ pub(crate) async fn get_spendable_reward_coins( .get_spendable_reward_coins(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< spendable reward coins = {}", display); + log::info!("<<< spendable reward coins = {display}"); Ok(display) } @@ -248,7 +248,7 @@ pub(crate) async fn get_delegated_coins( .get_delegated_coins(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< delegated coins = {}", display); + log::info!("<<< delegated coins = {display}"); Ok(display) } @@ -265,7 +265,7 @@ pub(crate) async fn get_pledged_coins( .get_pledged_coins(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< pledged coins = {}", display); + log::info!("<<< pledged coins = {display}"); Ok(display) } @@ -282,7 +282,7 @@ pub(crate) async fn get_staked_coins( .get_staked_coins(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< staked coins = {}", display); + log::info!("<<< staked coins = {display}"); Ok(display) } @@ -299,7 +299,7 @@ pub(crate) async fn get_withdrawn_coins( .get_withdrawn_coins(client.nyxd.address().as_ref()) .await?; let display = guard.attempt_convert_to_display_dec_coin(res)?; - log::info!("<<< pledged coins = {}", display); + log::info!("<<< pledged coins = {display}"); Ok(display) } From 94a451c79b77f51ee97b671ab1ff59213b8cc53c Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Thu, 9 Mar 2023 13:41:22 +0100 Subject: [PATCH 08/27] fix: updated build-and-upload-binaries-ci workflow with explorer-api and the new contracts --- .github/workflows/build-and-upload-binaries-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-upload-binaries-ci.yml b/.github/workflows/build-and-upload-binaries-ci.yml index a78eadfff4..d61e236711 100644 --- a/.github/workflows/build-and-upload-binaries-ci.yml +++ b/.github/workflows/build-and-upload-binaries-ci.yml @@ -99,9 +99,14 @@ jobs: cp target/release/nym-network-statistics $OUTPUT_DIR cp target/release/nym-cli $OUTPUT_DIR cp target/release/credential $OUTPUT_DIR + cp target/release/explorer-api $OUTPUT_DIR cp contracts/target/wasm32-unknown-unknown/release/mixnet_contract.wasm $OUTPUT_DIR cp contracts/target/wasm32-unknown-unknown/release/vesting_contract.wasm $OUTPUT_DIR + cp contracts/target/wasm32-unknown-unknown/release/nym_coconut_bandwidth.wasm $OUTPUT_DIR + cp contracts/target/wasm32-unknown-unknown/release/nym_coconut_dkg.wasm $OUTPUT_DIR + cp contracts/target/wasm32-unknown-unknown/release/cw3_flex_multisig.wasm $OUTPUT_DIR + cp contracts/target/wasm32-unknown-unknown/release/cw4_group.wasm $OUTPUT_DIR - name: Deploy branch to CI www continue-on-error: true From b3b3279345ec95cfc5ac24d92e1d57bb5f147f1f Mon Sep 17 00:00:00 2001 From: fmtabbara <fmtabbara@hotmail.co.uk> Date: Thu, 9 Mar 2023 14:45:45 +0000 Subject: [PATCH 09/27] fix gateway click thorough from gateway version field --- explorer/src/pages/Gateways/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/explorer/src/pages/Gateways/index.tsx b/explorer/src/pages/Gateways/index.tsx index 5c52f4a5b3..77e9e04fa2 100644 --- a/explorer/src/pages/Gateways/index.tsx +++ b/explorer/src/pages/Gateways/index.tsx @@ -153,9 +153,9 @@ export const PageGateways: FCWithChildren = () => { renderCell: (params: GridRenderCellParams) => ( <MuiLink sx={{ ...cellStyles }} - href={`${NYM_BIG_DIPPER}/account/${params.value}`} - target="_blank" - data-testid="owner" + component={RRDLink} + to={`/network-components/gateway/${params.row.identity_key}`} + data-testid="version" > {params.value} </MuiLink> From 8ae2451340c534b82764ecba30a3b04db0fcf757 Mon Sep 17 00:00:00 2001 From: fmtabbara <fmtabbara@hotmail.co.uk> Date: Thu, 9 Mar 2023 16:28:30 +0000 Subject: [PATCH 10/27] add y-axis label --- explorer/src/pages/GatewayDetail/index.tsx | 7 ++++++- explorer/src/pages/MixnodeDetail/index.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/explorer/src/pages/GatewayDetail/index.tsx b/explorer/src/pages/GatewayDetail/index.tsx index cad23ad16f..3382947512 100644 --- a/explorer/src/pages/GatewayDetail/index.tsx +++ b/explorer/src/pages/GatewayDetail/index.tsx @@ -111,7 +111,12 @@ const PageGatewayDetailsWithState = ({ selectedGateway }: { selectedGateway: Gat {uptimeStory && ( <ContentCard title="Routing Score"> {uptimeStory.error && <ComponentError text="There was a problem retrieving routing score." />} - <UptimeChart loading={uptimeStory.isLoading} xLabel="date" uptimeStory={uptimeStory} /> + <UptimeChart + loading={uptimeStory.isLoading} + xLabel="Date" + yLabel="Daily average" + uptimeStory={uptimeStory} + /> </ContentCard> )} </Grid> diff --git a/explorer/src/pages/MixnodeDetail/index.tsx b/explorer/src/pages/MixnodeDetail/index.tsx index c324f5a0f0..83a730f4fa 100644 --- a/explorer/src/pages/MixnodeDetail/index.tsx +++ b/explorer/src/pages/MixnodeDetail/index.tsx @@ -140,7 +140,12 @@ const PageMixnodeDetailWithState: FCWithChildren = () => { {uptimeStory && ( <ContentCard title="Routing Score"> {uptimeStory.error && <ComponentError text="There was a problem retrieving routing score." />} - <UptimeChart loading={uptimeStory.isLoading} xLabel="date" uptimeStory={uptimeStory} /> + <UptimeChart + loading={uptimeStory.isLoading} + xLabel="Date" + yLabel="Daily average" + uptimeStory={uptimeStory} + /> </ContentCard> )} </Grid> From e69b05693ab56cecbcf4e95cf5d7e318a7323646 Mon Sep 17 00:00:00 2001 From: fmtabbara <fmtabbara@hotmail.co.uk> Date: Thu, 9 Mar 2023 16:30:58 +0000 Subject: [PATCH 11/27] switch avg and routing score table positions --- .../src/components/MixNodes/Economics/Columns.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/explorer/src/components/MixNodes/Economics/Columns.ts b/explorer/src/components/MixNodes/Economics/Columns.ts index c3ac85baaf..b2115c0749 100644 --- a/explorer/src/components/MixNodes/Economics/Columns.ts +++ b/explorer/src/components/MixNodes/Economics/Columns.ts @@ -36,16 +36,16 @@ export const EconomicsInfoColumns: ColumnsType[] = [ tooltipInfo: 'Monthly operational cost of running this node. This cost is set by the operator and it influences how the rewards are split between the operator and delegators.', }, - { - field: 'avgUptime', - title: 'Avg. Score', - width: '10%', - tooltipInfo: "Mixnode's average routing score in the last 24 hour", - }, { field: 'nodePerformance', title: 'Routing Score', + width: '10%', tooltipInfo: "Mixnode's most recent score (measured in the last 15 minutes). Routing score is relative to that of the network. Each time a gateway is tested, the test packets have to go through the full path of the network (gateway + 3 nodes). If a node in the path drop packets it will affect the score of the gateway and other nodes in the test.", }, + { + field: 'avgUptime', + title: 'Avg. Score', + tooltipInfo: "Mixnode's average routing score in the last 24 hour", + }, ]; From 5f56b3eeeac39d306473a29e0cc9a3dd5210f70c Mon Sep 17 00:00:00 2001 From: fmtabbara <fmtabbara@hotmail.co.uk> Date: Thu, 9 Mar 2023 16:34:22 +0000 Subject: [PATCH 12/27] add bond % tooltip --- explorer/src/pages/MixnodeDetail/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/explorer/src/pages/MixnodeDetail/index.tsx b/explorer/src/pages/MixnodeDetail/index.tsx index 83a730f4fa..288c1bd8c0 100644 --- a/explorer/src/pages/MixnodeDetail/index.tsx +++ b/explorer/src/pages/MixnodeDetail/index.tsx @@ -42,6 +42,7 @@ const columns: ColumnsType[] = [ field: 'self_percentage', width: '10%', title: 'Bond %', + tooltipInfo: "Percentage of the operator's bond to the total stake on the node", }, { From 31e93428cfb9e00d4289079639a504178752776e Mon Sep 17 00:00:00 2001 From: fmtabbara <fmtabbara@hotmail.co.uk> Date: Thu, 9 Mar 2023 14:30:13 +0000 Subject: [PATCH 13/27] use new locked rewards and locked coins endpoints --- .../components/Balance/VestingTimeline.tsx | 47 ++++++----- .../Balance/cards/TokenTransfer.tsx | 15 ++-- .../Balance/cards/VestingSchedule.tsx | 15 ++-- .../Balance/modals/TransferModal.tsx | 1 - .../components/Delegation/DelegationItem.tsx | 11 ++- .../components/Delegation/DelegationList.tsx | 1 + .../src/components/Modals/ModalListItem.tsx | 11 ++- nym-wallet/src/hooks/useGetBalance.ts | 16 +++- nym-wallet/src/pages/balance/Balance.tsx | 83 +++++++++---------- nym-wallet/src/pages/balance/Vesting.tsx | 10 +-- nym-wallet/src/pages/balance/index.tsx | 6 +- 11 files changed, 116 insertions(+), 100 deletions(-) diff --git a/nym-wallet/src/components/Balance/VestingTimeline.tsx b/nym-wallet/src/components/Balance/VestingTimeline.tsx index 6ff740e33a..cfb489056d 100644 --- a/nym-wallet/src/components/Balance/VestingTimeline.tsx +++ b/nym-wallet/src/components/Balance/VestingTimeline.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/no-array-index-key */ import React, { useContext } from 'react'; import { useTheme } from '@mui/material/styles'; -import { Box, Tooltip, Typography } from '@mui/material'; +import { Box, Stack, Tooltip, Typography } from '@mui/material'; import { format } from 'date-fns'; import { AppContext } from 'src/context'; @@ -30,30 +30,33 @@ export const VestingTimeline: FCWithChildren<{ percentageComplete: number }> = ( : undefined; return ( - <Box display="flex" flexDirection="column" gap={1} position="relative" width="100%"> - <svg width="100%" height="12"> - <rect y="2" width="100%" height="6" rx="0" fill="#E6E6E6" /> - <rect y="2" width={`${percentageComplete}%`} height="6" rx="0" fill={theme.palette.success.main} /> - {vestingAccountInfo?.periods.map((period, i, arr) => ( + <Box> + <Stack direction="row" gap={1} alignItems="center"> + <Typography variant="body2">{percentageComplete}%</Typography> + <svg width="100%" height="12"> + <rect y="2" width="100%" height="6" rx="0" fill="#E6E6E6" /> + <rect y="2" width={`${percentageComplete}%`} height="6" rx="0" fill={theme.palette.success.main} /> + {vestingAccountInfo?.periods.map((period, i, arr) => ( + <Marker + position={`${calculateMarkerPosition(arr.length, i)}%`} + color={ + Math.ceil(+percentageComplete) >= calculateMarkerPosition(arr.length, i) + ? theme.palette.success.main + : '#B9B9B9' + } + tooltipText={format(new Date(Number(period.start_time) * 1000), 'HH:mm do MMM yyyy')} + key={i} + /> + ))} <Marker - position={`${calculateMarkerPosition(arr.length, i)}%`} - color={ - Math.ceil(+percentageComplete) >= calculateMarkerPosition(arr.length, i) - ? theme.palette.success.main - : '#B9B9B9' - } - tooltipText={format(new Date(Number(period.start_time) * 1000), 'HH:mm do MMM yyyy')} - key={i} + position="calc(100% - 4px)" + color={percentageComplete === 100 ? theme.palette.success.main : '#B9B9B9'} + tooltipText="End of vesting schedule" /> - ))} - <Marker - position="calc(100% - 4px)" - color={percentageComplete === 100 ? theme.palette.success.main : '#B9B9B9'} - tooltipText="End of vesting schedule" - /> - </svg> + </svg> + </Stack> {!!nextPeriod && ( - <Typography variant="caption" sx={{ color: 'nym.text.muted', position: 'absolute', top: 15, left: 0 }}> + <Typography variant="caption" sx={{ color: 'nym.text.muted', ml: 6 }}> Next vesting period: {format(new Date(nextPeriod * 1000), 'HH:mm do MMM yyyy')} </Typography> )} diff --git a/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx b/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx index cd1f3ba03c..1600a9b54e 100644 --- a/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx +++ b/nym-wallet/src/components/Balance/cards/TokenTransfer.tsx @@ -8,22 +8,21 @@ export const TokenTransfer = ({ unlockedRewards, unlockedTransferable, }: { - userBalance?: string; unlockedTokens?: string; unlockedRewards?: string; unlockedTransferable?: string; onTransfer: () => void; -}) => { - return ( - <Card variant="outlined" sx={{ p: 3, height: '100%' }}> +}) => ( + <Card variant="outlined" sx={{ p: 3, height: '100%' }}> + <Stack justifyContent="space-between" sx={{ height: '100%' }}> <Stack gap={1} sx={{ mb: 2 }}> <ModalListItem label="Unlocked tokens" value={unlockedTokens} /> <ModalListItem label="Unlocked rewards" value={unlockedRewards} divider /> - <ModalListItem label="Unlocked transferabled tokens" value={unlockedTransferable} fontWeight={600} /> + <ModalListItem fontSize={16} label="Transferable tokens" value={unlockedTransferable} fontWeight={600} /> </Stack> <Button size="large" fullWidth variant="contained" onClick={onTransfer} disableElevation> Transfer </Button> - </Card> - ); -}; + </Stack> + </Card> +); diff --git a/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx b/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx index 8eec8c7eb7..b26b999970 100644 --- a/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx +++ b/nym-wallet/src/components/Balance/cards/VestingSchedule.tsx @@ -1,4 +1,4 @@ -import { useContext, useState, useEffect } from 'react'; +import React, { useContext, useState, useEffect } from 'react'; import { TableContainer, Table, @@ -6,7 +6,6 @@ import { TableRow, TableCell, TableBody, - Box, Typography, TableCellProps, Card, @@ -14,7 +13,6 @@ import { import { Period } from '@nymproject/types'; import { AppContext } from 'src/context'; import { VestingTimeline } from '../VestingTimeline'; -import { Stack } from '@mui/system'; const columnsHeaders: Array<{ title: string; align: TableCellProps['align'] }> = [ { title: 'Locked', align: 'left' }, @@ -56,7 +54,11 @@ export const VestingSchedule = () => { <TableHead> <TableRow> {columnsHeaders.map((header) => ( - <TableCell key={header.title} sx={{ color: 'nym.text.muted', pt: 0 }} align={header.align}> + <TableCell + key={header.title} + sx={{ color: 'nym.text.muted', pt: 0, border: 'none', pb: 0 }} + align={header.align} + > {header.title} </TableCell> ))} @@ -101,10 +103,7 @@ export const VestingSchedule = () => { <Typography variant="body2" sx={{ color: 'nym.text.muted', mb: 3 }}> Percentage </Typography> - <Stack direction="row" alignItems="center" gap={2}> - <Typography variant="body2">{vestedPercentage}%</Typography> - <VestingTimeline percentageComplete={vestedPercentage} /> - </Stack> + <VestingTimeline percentageComplete={vestedPercentage} /> </Card> ); }; diff --git a/nym-wallet/src/components/Balance/modals/TransferModal.tsx b/nym-wallet/src/components/Balance/modals/TransferModal.tsx index 8e2d03251d..1d3713b184 100644 --- a/nym-wallet/src/components/Balance/modals/TransferModal.tsx +++ b/nym-wallet/src/components/Balance/modals/TransferModal.tsx @@ -1,6 +1,5 @@ import React, { useContext, useEffect, useState } from 'react'; import { Alert, Box, CircularProgress } from '@mui/material'; -import { CurrencyDenom, FeeDetails } from '@nymproject/types'; import { SimpleModal } from 'src/components/Modals/SimpleModal'; import { ModalListItem } from 'src/components/Modals/ModalListItem'; import { AppContext, urls } from 'src/context'; diff --git a/nym-wallet/src/components/Delegation/DelegationItem.tsx b/nym-wallet/src/components/Delegation/DelegationItem.tsx index 188901902f..c405c18d83 100644 --- a/nym-wallet/src/components/Delegation/DelegationItem.tsx +++ b/nym-wallet/src/components/Delegation/DelegationItem.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { Chip, IconButton, TableCell, TableRow, Tooltip, Typography } from '@mui/material'; import { Link } from '@nymproject/react/link/Link'; import { decimalToPercentage, DelegationWithEverything } from '@nymproject/types'; +import { LockOutlined } from '@mui/icons-material'; import { isDelegation } from 'src/context/delegations'; import { toPercentIntegerString } from 'src/utils'; import { format } from 'date-fns'; @@ -34,9 +35,6 @@ export const DelegationItem = ({ if (nodeIsUnbonded) { return 'This node has unbonded and it does not exist anymore. You need to undelegate from it to get your stake and outstanding rewards (if any) back.'; } - if (item.uses_vesting_contract_tokens) { - return 'Delegation made with locked tockens'; - } return ''; }; @@ -80,6 +78,13 @@ export const DelegationItem = ({ </Typography> </TableCell> <TableCell sx={{ textTransform: 'uppercase', color: 'inherit' }}>{getRewardValue(item)}</TableCell> + <TableCell> + {item.uses_vesting_contract_tokens && ( + <Tooltip title="Delegation uses locked tokens"> + <LockOutlined sx={{ color: 'grey.800' }} fontSize="small" /> + </Tooltip> + )} + </TableCell> <TableCell align="right" sx={{ color: 'inherit' }}> {!item.pending_events.length && !nodeIsUnbonded && ( <DelegationsActionsMenu diff --git a/nym-wallet/src/components/Delegation/DelegationList.tsx b/nym-wallet/src/components/Delegation/DelegationList.tsx index 42f4a5e3a3..e2a66822d7 100644 --- a/nym-wallet/src/components/Delegation/DelegationList.tsx +++ b/nym-wallet/src/components/Delegation/DelegationList.tsx @@ -46,6 +46,7 @@ const headCells: HeadCell[] = [ { id: 'delegated_on_iso_datetime', label: 'Delegated on', sortable: true, align: 'left' }, { id: 'amount', label: 'Delegation', sortable: true, align: 'left' }, { id: 'unclaimed_rewards', label: 'Reward', sortable: true, align: 'left' }, + { id: 'uses_locked_tokens', label: '', sortable: false, align: 'left' }, ]; const EnhancedTableHead: FCWithChildren<EnhancedTableProps> = ({ order, orderBy, onRequestSort }) => { diff --git a/nym-wallet/src/components/Modals/ModalListItem.tsx b/nym-wallet/src/components/Modals/ModalListItem.tsx index 916603e011..830c25705e 100644 --- a/nym-wallet/src/components/Modals/ModalListItem.tsx +++ b/nym-wallet/src/components/Modals/ModalListItem.tsx @@ -7,17 +7,22 @@ export const ModalListItem: FCWithChildren<{ divider?: boolean; hidden?: boolean; fontWeight?: TypographyProps['fontWeight']; + fontSize?: TypographyProps['fontSize']; light?: boolean; value?: React.ReactNode; sxValue?: SxProps; -}> = ({ label, value, hidden, fontWeight, divider, sxValue }) => ( +}> = ({ label, value, hidden, fontWeight, fontSize, divider, sxValue }) => ( <Box sx={{ display: hidden ? 'none' : 'block' }}> - <Stack direction="row" justifyContent="space-between"> + <Stack direction="row" justifyContent="space-between" alignItems="center"> <Typography fontSize="smaller" fontWeight={fontWeight} sx={{ color: 'text.primary', fontSize: 14 }}> {label} </Typography> {value && ( - <Typography fontSize="smaller" fontWeight={fontWeight} sx={{ color: 'text.primary', fontSize: 14, ...sxValue }}> + <Typography + fontSize="smaller" + fontWeight={fontWeight} + sx={{ color: 'text.primary', fontSize: fontSize || 14, ...sxValue }} + > {value} </Typography> )} diff --git a/nym-wallet/src/hooks/useGetBalance.ts b/nym-wallet/src/hooks/useGetBalance.ts index 0da3ca7476..240910e493 100644 --- a/nym-wallet/src/hooks/useGetBalance.ts +++ b/nym-wallet/src/hooks/useGetBalance.ts @@ -9,11 +9,19 @@ import { getOriginalVesting, getCurrentVestingPeriod, getVestingAccountInfo, + getSpendableRewardCoins, + getSpendableVestedCoins, } from '../requests'; import { Console } from '../utils/console'; type TTokenAllocation = { - [key in 'vesting' | 'vested' | 'locked' | 'spendable']: DecCoin['amount']; + [key in + | 'vesting' + | 'vested' + | 'locked' + | 'spendable' + | 'spendableRewardCoins' + | 'spendableVestedCoins']: DecCoin['amount']; }; export type TUseuserBalance = { @@ -54,6 +62,8 @@ export const useGetBalance = (clientDetails?: Account): TUseuserBalance => { vestedCoins, lockedCoins, spendableCoins, + spendableVestedCoins, + spendableRewardCoins, currentPeriod, vestingAccountDetail, ] = await Promise.all([ @@ -62,6 +72,8 @@ export const useGetBalance = (clientDetails?: Account): TUseuserBalance => { getVestedCoins(clientDetails?.client_address), getLockedCoins(), getSpendableCoins(), + getSpendableVestedCoins(), + getSpendableRewardCoins(), getCurrentVestingPeriod(clientDetails?.client_address), getVestingAccountInfo(clientDetails?.client_address), ]); @@ -72,6 +84,8 @@ export const useGetBalance = (clientDetails?: Account): TUseuserBalance => { vested: vestedCoins.amount, locked: lockedCoins.amount, spendable: spendableCoins.amount, + spendableVestedCoins: spendableVestedCoins.amount, + spendableRewardCoins: spendableRewardCoins.amount, }); setVestingAccountInfo(vestingAccountDetail); } catch (e) { diff --git a/nym-wallet/src/pages/balance/Balance.tsx b/nym-wallet/src/pages/balance/Balance.tsx index 160d136979..1125076ee5 100644 --- a/nym-wallet/src/pages/balance/Balance.tsx +++ b/nym-wallet/src/pages/balance/Balance.tsx @@ -1,10 +1,10 @@ -import React, { useContext, useEffect } from 'react'; +import React from 'react'; import { Alert, Grid, Typography } from '@mui/material'; import { Link } from '@nymproject/react/link/Link'; -import { NymCard, ClientAddress } from '../../components'; -import { AppContext, urls } from '../../context/main'; import { Network } from 'src/types'; import { Balance } from '@nymproject/types'; +import { NymCard, ClientAddress } from '../../components'; +import { urls } from '../../context/main'; export const BalanceCard = ({ userBalance, @@ -16,47 +16,40 @@ export const BalanceCard = ({ userBalanceError?: string; network?: Network; clientAddress?: string; -}) => { - return ( - <NymCard - title="Balance" - data-testid="check-balance" - borderless - Action={<ClientAddress withCopy showEntireAddress />} - > - <Grid container direction="column" spacing={2}> - <Grid item> - {userBalanceError && ( - <Alert severity="error" data-testid="error-refresh" sx={{ p: 2 }}> - {userBalanceError} - </Alert> - )} - {!userBalanceError && ( - <Typography - data-testid="refresh-success" - sx={{ - color: 'text.primary', - textTransform: 'uppercase', - fontWeight: '600', - fontSize: 28, - }} - variant="h5" - > - {userBalance?.printable_balance} - </Typography> - )} - </Grid> - {network && ( - <Grid item> - <Link - href={`${urls(network).mixnetExplorer}/account/${clientAddress}`} - target="_blank" - text="Last transactions" - fontSize={14} - /> - </Grid> +}) => ( + <NymCard title="Balance" data-testid="check-balance" borderless Action={<ClientAddress withCopy showEntireAddress />}> + <Grid container direction="column" spacing={2}> + <Grid item> + {userBalanceError && ( + <Alert severity="error" data-testid="error-refresh" sx={{ p: 2 }}> + {userBalanceError} + </Alert> + )} + {!userBalanceError && ( + <Typography + data-testid="refresh-success" + sx={{ + color: 'text.primary', + textTransform: 'uppercase', + fontWeight: '600', + fontSize: 28, + }} + variant="h5" + > + {userBalance?.printable_balance} + </Typography> )} </Grid> - </NymCard> - ); -}; + {network && ( + <Grid item> + <Link + href={`${urls(network).mixnetExplorer}/account/${clientAddress}`} + target="_blank" + text="Last transactions" + fontSize={14} + /> + </Grid> + )} + </Grid> + </NymCard> +); diff --git a/nym-wallet/src/pages/balance/Vesting.tsx b/nym-wallet/src/pages/balance/Vesting.tsx index 010a0cb94c..23e018438c 100644 --- a/nym-wallet/src/pages/balance/Vesting.tsx +++ b/nym-wallet/src/pages/balance/Vesting.tsx @@ -1,17 +1,16 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { Refresh } from '@mui/icons-material'; import { Grid, IconButton, Typography } from '@mui/material'; import { useSnackbar } from 'notistack'; -import { useEffect } from 'react'; import { NymCard } from 'src/components'; import { TokenTransfer } from 'src/components/Balance/cards/TokenTransfer'; import { OriginalVestingResponse } from '@nymproject/types'; import { VestingSchedule } from 'src/components/Balance/cards/VestingSchedule'; export const VestingCard = ({ - userBalance, unlockedTokens, unlockedRewards, + unlockedTransferable, originalVesting, onTransfer, fetchBalance, @@ -19,7 +18,7 @@ export const VestingCard = ({ }: { unlockedTokens?: string; unlockedRewards?: string; - userBalance?: string; + unlockedTransferable?: string; originalVesting?: OriginalVestingResponse; fetchTokenAllocation: () => Promise<void>; fetchBalance: () => Promise<void>; @@ -69,8 +68,7 @@ export const VestingCard = ({ onTransfer={onTransfer} unlockedTokens={unlockedTokens} unlockedRewards={unlockedRewards} - unlockedTransferable={unlockedTokens} - userBalance={userBalance} + unlockedTransferable={unlockedTransferable} /> </Grid> </Grid> diff --git a/nym-wallet/src/pages/balance/index.tsx b/nym-wallet/src/pages/balance/index.tsx index 778ca020fc..89767f370e 100644 --- a/nym-wallet/src/pages/balance/index.tsx +++ b/nym-wallet/src/pages/balance/index.tsx @@ -33,9 +33,9 @@ export const Balance = () => { network={network} /> <VestingCard - userBalance={appendDenom(userBalance.balance?.printable_balance)} - unlockedTokens={appendDenom(userBalance.tokenAllocation?.spendable)} - unlockedRewards={appendDenom(userBalance.tokenAllocation?.spendable)} + unlockedTokens={appendDenom(userBalance.tokenAllocation?.spendableVestedCoins)} + unlockedRewards={appendDenom(userBalance.tokenAllocation?.spendableRewardCoins)} + unlockedTransferable={appendDenom(userBalance.tokenAllocation?.spendable)} originalVesting={userBalance.originalVesting} onTransfer={handleShowTransferModal} fetchBalance={userBalance.fetchBalance} From 605aed6f20a37b0cf38d706c6048916bde8180bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= <jon.haggblad@gmail.com> Date: Mon, 13 Mar 2023 12:23:17 +0100 Subject: [PATCH 14/27] mock-nym-api: fix .storybook lint error (#3178) --- ts-packages/mock-nym-api/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts-packages/mock-nym-api/package.json b/ts-packages/mock-nym-api/package.json index 10a5a7d3e5..a712fb99b9 100644 --- a/ts-packages/mock-nym-api/package.json +++ b/ts-packages/mock-nym-api/package.json @@ -43,7 +43,7 @@ "run:caddy": "caddy run", "build": "tsc --noEmit false", "watch": "tsc --noEmit false -w", - "lint": "eslint src .storybook", - "lint:fix": "eslint src .storybook --fix" + "lint": "eslint src", + "lint:fix": "eslint src --fix" } } From 71a10a9a8b2b6fabcc4b82e9b628bcbee8f74e21 Mon Sep 17 00:00:00 2001 From: Fouad <fmtabbara@hotmail.co.uk> Date: Mon, 13 Mar 2023 16:05:21 +0000 Subject: [PATCH 15/27] add blockstream green to sp list (#3180) --- explorer/src/pages/ServiceProviders/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/explorer/src/pages/ServiceProviders/index.tsx b/explorer/src/pages/ServiceProviders/index.tsx index 63bdf956ea..512042a4e5 100644 --- a/explorer/src/pages/ServiceProviders/index.tsx +++ b/explorer/src/pages/ServiceProviders/index.tsx @@ -22,9 +22,10 @@ const SupportedApps = () => { <FormControl size="small"> <Select value={selected} onChange={handleChange} displayEmpty sx={{ mr: 2 }}> <MenuItem value="">Supported Apps</MenuItem> - <MenuItem sx={{ opacity: 1 }}>Keybase</MenuItem> + <MenuItem>Keybase</MenuItem> <MenuItem>Telegram</MenuItem> <MenuItem>Electrum</MenuItem> + <MenuItem>Blockstream Green</MenuItem> </Select> </FormControl> ); From 71853f69f336da182199f295c6806933bbaa16ac Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Wed, 15 Mar 2023 15:23:15 +0100 Subject: [PATCH 16/27] chore: update changelogs for release/v1.1.13 --- CHANGELOG.md | 20 ++++++++++++++++++++ nym-wallet/CHANGELOG.md | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38b033c5c4..dbc5cfaefb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,26 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// ## [Unreleased] +## [v1.1.13] (2023-03-15) + +- NE - instead of throwing a "Mixnode/Gateway not found" error for blacklisted nodes due to bad performance, show their history but tag them as "Having poor performance" ([#2979]) +- NE - Upgrade Sandbox and make below changes: ([#2332]) +- Explorer - Updates ([#3168]) +- Fix contracts and nym-api audit findings ([#3026]) +- Website v2 - deploy infrastructure for strapi and CI ([#2213]) +- add blockstream green to sp list ([#3180]) +- mock-nym-api: fix .storybook lint error ([#3178]) +- Validating new interval config parameters to prevent division by zero ([#3153]) + +[#2979]: https://github.com/nymtech/nym/issues/2979 +[#2332]: https://github.com/nymtech/nym/issues/2332 +[#3168]: https://github.com/nymtech/nym/issues/3168 +[#3026]: https://github.com/nymtech/nym/issues/3026 +[#2213]: https://github.com/nymtech/nym/issues/2213 +[#3180]: https://github.com/nymtech/nym/pull/3180 +[#3178]: https://github.com/nymtech/nym/pull/3178 +[#3153]: https://github.com/nymtech/nym/pull/3153 + ## [v1.1.12] (2023-03-07) - Fix generated docs for mixnet and vesting contract on docs.rs ([#3093]) diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index 882ae175ad..8eccaf2471 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -2,6 +2,14 @@ ## [Unreleased] +## [v1.1.13] (2023-03-15) + +- Wallet - in the vesting section separate the "Unlocked transferable tokens" into "Unlocked vesting tokens" and "Transferable rewards" for better clarity ([#3132]) +- Wallet - change the Bonding flow to include an additional step for the user to provide a unique signature when they bond their node ([#3109]) + +[#3132]: https://github.com/nymtech/nym/issues/3132 +[#3109]: https://github.com/nymtech/nym/issues/3109 + ## [v1.1.11] (2023-03-07) - Wallet: optional gas and memo fields ([#2222]) From cdfa5ee540f53e12e94fc29c978af86dd7d081fd Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Wed, 15 Mar 2023 15:23:55 +0100 Subject: [PATCH 17/27] chore: update versions for release/v1.1.13 --- clients/client-core/Cargo.toml | 2 +- clients/native/Cargo.toml | 2 +- clients/socks5/Cargo.toml | 2 +- explorer-api/Cargo.toml | 2 +- gateway/Cargo.toml | 2 +- mixnode/Cargo.toml | 2 +- nym-api/Cargo.toml | 2 +- nym-wallet/package.json | 2 +- nym-wallet/src-tauri/Cargo.toml | 2 +- nym-wallet/src-tauri/tauri.conf.json | 2 +- service-providers/network-requester/Cargo.toml | 2 +- service-providers/network-statistics/Cargo.toml | 2 +- tools/nym-cli/Cargo.toml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index be8f3e048c..36fc8b52eb 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "client-core" -version = "1.1.12" +version = "1.1.13" authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"] edition = "2021" rust-version = "1.66" diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index a111f91fe1..c7190f1b18 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-client" -version = "1.1.12" +version = "1.1.13" authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"] description = "Implementation of the Nym Client" edition = "2021" diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index c1bc449dd4..a9e131f778 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-socks5-client" -version = "1.1.12" +version = "1.1.13" authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"] description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address" edition = "2021" diff --git a/explorer-api/Cargo.toml b/explorer-api/Cargo.toml index 72ed732e62..a9dde6c94a 100644 --- a/explorer-api/Cargo.toml +++ b/explorer-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "explorer-api" -version = "1.1.12" +version = "1.1.13" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index c7f54810c6..75b3e5b078 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-gateway" -version = "1.1.12" +version = "1.1.13" authors = [ "Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>", diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 343aab2622..77f21164cd 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-mixnode" -version = "1.1.13" +version = "1.1.14" authors = [ "Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>", diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index acbbc3c305..2bbf7cc32b 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-api" -version = "1.1.13" +version = "1.1.14" authors = [ "Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>", diff --git a/nym-wallet/package.json b/nym-wallet/package.json index f44d127d96..05d6195526 100644 --- a/nym-wallet/package.json +++ b/nym-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@nymproject/nym-wallet-app", - "version": "1.1.11", + "version": "1.1.12", "main": "index.js", "license": "MIT", "scripts": { diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index 406e9fb4c1..81b001f0bf 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym_wallet" -version = "1.1.11" +version = "1.1.12" description = "Nym Native Wallet" authors = ["Nym Technologies SA"] license = "" diff --git a/nym-wallet/src-tauri/tauri.conf.json b/nym-wallet/src-tauri/tauri.conf.json index 607ecd1673..c6374a010f 100644 --- a/nym-wallet/src-tauri/tauri.conf.json +++ b/nym-wallet/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "nym-wallet", - "version": "1.1.11" + "version": "1.1.12" }, "build": { "distDir": "../dist", diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index a320e3ac07..88f8502564 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-network-requester" -version = "1.1.12" +version = "1.1.13" authors.workspace = true edition.workspace = true rust-version = "1.65" diff --git a/service-providers/network-statistics/Cargo.toml b/service-providers/network-statistics/Cargo.toml index 929c8fda8e..ee6cb15703 100644 --- a/service-providers/network-statistics/Cargo.toml +++ b/service-providers/network-statistics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-network-statistics" -version = "1.1.12" +version = "1.1.13" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tools/nym-cli/Cargo.toml b/tools/nym-cli/Cargo.toml index cf62275946..4b796278e7 100644 --- a/tools/nym-cli/Cargo.toml +++ b/tools/nym-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-cli" -version = "1.1.12" +version = "1.1.13" authors.workspace = true edition = "2021" From 746ec71a0d0853a5043ec91d6e528689e163f935 Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Tue, 21 Mar 2023 10:54:18 +0100 Subject: [PATCH 18/27] update package versions --- Cargo.lock | 22 +++++++++---------- common/bin-common/Cargo.toml | 2 +- .../contracts-common/Cargo.toml | 2 +- .../mixnet-contract/Cargo.toml | 4 ++-- .../vesting-contract/Cargo.toml | 6 ++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43ed1faa62..bcb62479fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -646,7 +646,7 @@ dependencies = [ [[package]] name = "client-core" -version = "1.1.12" +version = "1.1.13" dependencies = [ "async-trait", "dashmap 5.4.0", @@ -1612,7 +1612,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "explorer-api" -version = "1.1.12" +version = "1.1.13" dependencies = [ "chrono", "clap 4.1.4", @@ -3062,7 +3062,7 @@ dependencies = [ [[package]] name = "nym-api" -version = "1.1.13" +version = "1.1.14" dependencies = [ "anyhow", "async-trait", @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "nym-bin-common" -version = "0.2.0" +version = "0.3.0" dependencies = [ "clap 4.1.4", "clap_complete", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "nym-cli" -version = "1.1.12" +version = "1.1.13" dependencies = [ "anyhow", "base64 0.13.1", @@ -3237,7 +3237,7 @@ dependencies = [ [[package]] name = "nym-client" -version = "1.1.12" +version = "1.1.13" dependencies = [ "clap 4.1.4", "client-core", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "nym-gateway" -version = "1.1.12" +version = "1.1.13" dependencies = [ "anyhow", "async-trait", @@ -3498,7 +3498,7 @@ dependencies = [ [[package]] name = "nym-mixnode" -version = "1.1.13" +version = "1.1.14" dependencies = [ "anyhow", "atty", @@ -3566,7 +3566,7 @@ dependencies = [ [[package]] name = "nym-network-requester" -version = "1.1.12" +version = "1.1.13" dependencies = [ "async-trait", "clap 4.1.4", @@ -3604,7 +3604,7 @@ dependencies = [ [[package]] name = "nym-network-statistics" -version = "1.1.12" +version = "1.1.13" dependencies = [ "dirs", "log", @@ -3704,7 +3704,7 @@ dependencies = [ [[package]] name = "nym-socks5-client" -version = "1.1.12" +version = "1.1.13" dependencies = [ "clap 4.1.4", "client-core", diff --git a/common/bin-common/Cargo.toml b/common/bin-common/Cargo.toml index b19d692d74..21f90d27f9 100644 --- a/common/bin-common/Cargo.toml +++ b/common/bin-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-bin-common" -version = "0.2.0" +version = "0.3.0" description = "Common code for nym binaries" edition = { workspace = true } authors = { workspace = true } diff --git a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml index e5b6dd66eb..a0120d1203 100644 --- a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml +++ b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-contracts-common" -version = "0.2.0" +version = "0.3.0" description = "Common library for Nym cosmwasm contracts" edition = { workspace = true } authors = { workspace = true } diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml b/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml index 670c993554..67227064a0 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-mixnet-contract-common" -version = "0.2.0" +version = "0.3.0" description = "Common library for the Nym mixnet contract" rust-version = "1.62" edition = { workspace = true } @@ -15,7 +15,7 @@ serde = { version = "1.0", features = ["derive"] } serde_repr = "0.1" schemars = "0.8" thiserror = "1.0" -contracts-common = { path = "../contracts-common", package = "nym-contracts-common", version = "0.2.0" } +contracts-common = { path = "../contracts-common", package = "nym-contracts-common", version = "0.3.0" } serde_json = "1.0.0" humantime-serde = "1.1.1" diff --git a/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml b/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml index 7742b7c7a8..9f813f89eb 100644 --- a/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-vesting-contract-common" -version = "0.2.0" +version = "0.3.0" description = "Common library for the Nym vesting contract" edition = { workspace = true } authors = { workspace = true } @@ -9,8 +9,8 @@ repository = { workspace = true } [dependencies] cosmwasm-std = "1.0.0" -mixnet-contract-common = { path = "../mixnet-contract", package = "nym-mixnet-contract-common", version = "0.2.0" } -contracts-common = { path = "../contracts-common", package = "nym-contracts-common", version = "0.2.0" } +mixnet-contract-common = { path = "../mixnet-contract", package = "nym-mixnet-contract-common", version = "0.3.0" } +contracts-common = { path = "../contracts-common", package = "nym-contracts-common", version = "0.3.0" } serde = { version = "1.0", features = ["derive"] } schemars = "0.8" ts-rs = {version = "6.1.2", optional = true} From f7a0b305df26c034f1a790eacf30e13c6384186d Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Tue, 21 Mar 2023 11:10:55 +0100 Subject: [PATCH 19/27] update common crate version in contracts --- Cargo.lock | 6 +++--- contracts/mixnet/Cargo.toml | 4 ++-- contracts/vesting/Cargo.toml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcb62479fd..3f1c7d5e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3319,7 +3319,7 @@ dependencies = [ [[package]] name = "nym-contracts-common" -version = "0.2.0" +version = "0.3.0" dependencies = [ "bs58", "cosmwasm-std", @@ -3479,7 +3479,7 @@ dependencies = [ [[package]] name = "nym-mixnet-contract-common" -version = "0.2.0" +version = "0.3.0" dependencies = [ "bs58", "cosmwasm-std", @@ -3982,7 +3982,7 @@ dependencies = [ [[package]] name = "nym-vesting-contract-common" -version = "0.2.0" +version = "0.3.0" dependencies = [ "cosmwasm-std", "nym-contracts-common", diff --git a/contracts/mixnet/Cargo.toml b/contracts/mixnet/Cargo.toml index b75700efd1..ec6a6659a0 100644 --- a/contracts/mixnet/Cargo.toml +++ b/contracts/mixnet/Cargo.toml @@ -22,8 +22,8 @@ name = "mixnet_contract" crate-type = ["cdylib", "rlib"] [dependencies] -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common", version = "0.2.0" } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.2.0" } +mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common", version = "0.3.0" } +vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.3.0" } #nym-config = { path = "../../common/config"} cosmwasm-std = "1.0.0" diff --git a/contracts/vesting/Cargo.toml b/contracts/vesting/Cargo.toml index 157bd40b8f..dcfbd2af57 100644 --- a/contracts/vesting/Cargo.toml +++ b/contracts/vesting/Cargo.toml @@ -20,9 +20,9 @@ name = "vesting_contract" crate-type = ["cdylib", "rlib"] [dependencies] -mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common", version = "0.2.0" } -contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common", package = "nym-contracts-common", version = "0.2.0" } -vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.2.0" } +mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract", package = "nym-mixnet-contract-common", version = "0.3.0" } +contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common", package = "nym-contracts-common", version = "0.3.0" } +vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.3.0" } cosmwasm-std = { version = "1.0.0 "} cw2 = { version = "0.13.4" } From 1d2722f994a25d3d0dc94d890686c9138d670f8d Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Tue, 21 Mar 2023 16:30:40 +0100 Subject: [PATCH 20/27] update workflows with specific wasm-opt version --- .github/workflows/build-and-upload-binaries-ci.yml | 2 +- .github/workflows/contracts-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-upload-binaries-ci.yml b/.github/workflows/build-and-upload-binaries-ci.yml index d61e236711..929913fb4f 100644 --- a/.github/workflows/build-and-upload-binaries-ci.yml +++ b/.github/workflows/build-and-upload-binaries-ci.yml @@ -80,7 +80,7 @@ jobs: components: rustfmt, clippy - name: Install wasm-opt - run: cargo install wasm-opt + run: cargo install --version 0.110.0 wasm-opt - name: Build release contracts run: make wasm diff --git a/.github/workflows/contracts-build.yml b/.github/workflows/contracts-build.yml index 839a8804e6..36c809daf6 100644 --- a/.github/workflows/contracts-build.yml +++ b/.github/workflows/contracts-build.yml @@ -20,7 +20,7 @@ jobs: components: rustfmt, clippy - name: Install wasm-opt - run: cargo install wasm-opt + run: cargo install --version 0.110.0 wasm-opt - name: Build release contracts run: make wasm From ce4ae8d90c105fd038bbcaa325c2b10ec54b7660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= <jon.haggblad@gmail.com> Date: Tue, 21 Mar 2023 12:05:44 +0100 Subject: [PATCH 21/27] Set cosmwasm versions on workspace and strictly use 1.0.0 --- .gitignore | 2 - Cargo.lock | 5 +- Cargo.toml | 10 + .../coconut-bandwidth-contract/Cargo.toml | 2 +- .../coconut-dkg/Cargo.toml | 4 +- .../contracts-common/Cargo.toml | 2 +- .../group-contract/Cargo.toml | 2 +- .../mixnet-contract/Cargo.toml | 2 +- .../multisig-contract/Cargo.toml | 10 +- .../vesting-contract/Cargo.toml | 2 +- contracts/.gitignore | 1 - contracts/Cargo.lock | 2036 +++++++++++++++++ contracts/Cargo.toml | 8 + contracts/mixnet/Cargo.toml | 11 +- contracts/vesting/Cargo.toml | 7 +- 15 files changed, 2079 insertions(+), 25 deletions(-) delete mode 100644 contracts/.gitignore create mode 100644 contracts/Cargo.lock diff --git a/.gitignore b/.gitignore index 2b0cb82a78..82f4286297 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,5 @@ validator-api-config.toml dist storybook-static envs/qwerty.env -Cargo.lock -nym-connect/Cargo.lock .parcel-cache **/.DS_Store diff --git a/Cargo.lock b/Cargo.lock index 3f1c7d5e74..dda9321c80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -855,9 +855,9 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.2.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5abeeb891e6d0098402e4d3d042f90451db52651d2fe14b170e69a1dd3e4115" +checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4" dependencies = [ "syn", ] @@ -3967,6 +3967,7 @@ dependencies = [ name = "nym-vesting-contract" version = "1.2.0-pre.1" dependencies = [ + "cosmwasm-derive", "cosmwasm-std", "cw-storage-plus", "cw2", diff --git a/Cargo.toml b/Cargo.toml index ae2be51ec6..f1e6937055 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -107,6 +107,16 @@ license = "Apache-2.0" [workspace.dependencies] async-trait = "0.1.64" cfg-if = "1.0.0" +cosmwasm-derive = "=1.0.0" +cosmwasm-schema = "=1.0.0" +cosmwasm-std = "=1.0.0" +cosmwasm-storage = "=1.0.0" +cw-utils = "=0.13.4" +cw-storage-plus = "=0.13.4" +cw2 = { version = "=0.13.4" } +cw3 = { version = "=0.13.4" } +cw3-fixed-multisig = { version = "=0.13.4" } +cw4 = { version = "=0.13.4" } dotenvy = "0.15.6" lazy_static = "1.4.0" log = "0.4" diff --git a/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/Cargo.toml b/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/Cargo.toml index c91b3b94ac..fc5e1b43d7 100644 --- a/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cosmwasm-std = "1.0.0" +cosmwasm-std = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } nym-multisig-contract-common = { path = "../multisig-contract" } diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml b/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml index 24a14cfb0b..1f6d6c3f3f 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml +++ b/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cosmwasm-std = "1.0.0" -cw-utils = "0.13.4" +cosmwasm-std = { workspace = true } +cw-utils = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml index a0120d1203..dbed7f9cf6 100644 --- a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml +++ b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml @@ -9,7 +9,7 @@ repository = { workspace = true } [dependencies] bs58 = "0.4.0" -cosmwasm-std = "1.0.0" +cosmwasm-std = { workspace = true } schemars = "0.8" serde = { version = "1.0", features = ["derive"] } thiserror = "1" diff --git a/common/cosmwasm-smart-contracts/group-contract/Cargo.toml b/common/cosmwasm-smart-contracts/group-contract/Cargo.toml index ba25bbb653..9f57c84154 100644 --- a/common/cosmwasm-smart-contracts/group-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/group-contract/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cw4 = { version = "0.13.4" } +cw4 = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml b/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml index 67227064a0..ac6c2c2061 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml @@ -10,7 +10,7 @@ repository = { workspace = true } [dependencies] bs58 = "0.4.0" -cosmwasm-std = "1.0.0" +cosmwasm-std = { workspace = true } serde = { version = "1.0", features = ["derive"] } serde_repr = "0.1" schemars = "0.8" diff --git a/common/cosmwasm-smart-contracts/multisig-contract/Cargo.toml b/common/cosmwasm-smart-contracts/multisig-contract/Cargo.toml index 0d5a62759e..14ef586c93 100644 --- a/common/cosmwasm-smart-contracts/multisig-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/multisig-contract/Cargo.toml @@ -6,11 +6,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cw-utils = { version = "0.13.4" } -cw3 = { version = "0.13.4" } -cw3-fixed-multisig = { version = "0.13.4", features = ["library"] } -cw4 = { version = "0.13.4" } -cosmwasm-std = "1.0.0" +cw-utils = { workspace = true } +cw3 = { workspace = true } +cw3-fixed-multisig = { workspace = true, features = ["library"] } +cw4 = { workspace= true } +cosmwasm-std = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = { version = "1.0.23" } diff --git a/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml b/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml index 9f813f89eb..88a67765d9 100644 --- a/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml +++ b/common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml @@ -8,7 +8,7 @@ license = { workspace = true } repository = { workspace = true } [dependencies] -cosmwasm-std = "1.0.0" +cosmwasm-std = { workspace = true } mixnet-contract-common = { path = "../mixnet-contract", package = "nym-mixnet-contract-common", version = "0.3.0" } contracts-common = { path = "../contracts-common", package = "nym-contracts-common", version = "0.3.0" } serde = { version = "1.0", features = ["derive"] } diff --git a/contracts/.gitignore b/contracts/.gitignore deleted file mode 100644 index ffa3bbd20e..0000000000 --- a/contracts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Cargo.lock \ No newline at end of file diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock new file mode 100644 index 0000000000..0eeec44dd4 --- /dev/null +++ b/contracts/Cargo.lock @@ -0,0 +1,2036 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "ctr", + "opaque-debug 0.3.0", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +dependencies = [ + "byte-tools", + "crypto-mac 0.7.0", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf3c081b5fba1e5615640aae998e0fbd10c24cbd897ee39ed754a77601a4862" +dependencies = [ + "byteorder", + "keystream", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "coconut-test" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "cosmwasm-storage", + "cw-controllers", + "cw-multi-test", + "cw-storage-plus", + "cw-utils", + "cw3", + "cw3-flex-multisig", + "cw4", + "cw4-group", + "nym-bandwidth-claim-contract", + "nym-coconut-bandwidth", + "nym-coconut-bandwidth-contract-common", + "nym-coconut-dkg", + "nym-coconut-dkg-common", + "nym-group-contract-common", + "nym-multisig-contract-common", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "cosmwasm-crypto" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb0afef2325df81aadbf9be1233f522ed8f6e91df870c764bc44cca2b1415bd" +dependencies = [ + "digest 0.9.0", + "ed25519-zebra", + "k256", + "rand_core 0.6.4", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4" +dependencies = [ + "syn 1.0.109", +] + +[[package]] +name = "cosmwasm-schema" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772e80bbad231a47a2068812b723a1ff81dd4a0d56c9391ac748177bea3a61da" +dependencies = [ + "schemars", + "serde_json", +] + +[[package]] +name = "cosmwasm-std" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875994993c2082a6fcd406937bf0fca21c349e4a624f3810253a14fa83a3a195" +dependencies = [ + "base64 0.13.1", + "cosmwasm-crypto", + "cosmwasm-derive", + "forward_ref", + "schemars", + "serde", + "serde-json-wasm", + "thiserror", + "uint", +] + +[[package]] +name = "cosmwasm-storage" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18403b07304d15d304dad11040d45bbcaf78d603b4be3fb5e2685c16f9229b5" +dependencies = [ + "cosmwasm-std", + "serde", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.6", + "rand_core 0.6.4", + "subtle 2.4.1", + "zeroize", +] + +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +dependencies = [ + "generic-array 0.12.4", + "subtle 1.0.0", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.6", + "subtle 2.4.1", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle 2.4.1", + "zeroize", +] + +[[package]] +name = "cw-controllers" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f0bc6019b4d3d81e11f5c384bcce7173e2210bd654d75c6c9668e12cca05dfa" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw-multi-test" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f9a8ab7c3c29ec93cb7a39ce4b14a05e053153b4a17ef7cf2246af1b7c087e" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cosmwasm-storage", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools", + "prost", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw-storage-plus" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648b1507290bbc03a8d88463d7cd9b04b1fa0155e5eef366c4fa052b9caaac7a" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "cw-utils" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbaecb78c8e8abfd6b4258c7f4fbeb5c49a5e45ee4d910d3240ee8e1d714e1b" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw2" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cf4639517490dd36b333bbd6c4fbd92e325fd0acf4683b41753bc5eb63bfc1" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "serde", +] + +[[package]] +name = "cw3" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe19462a7f644ba60c19d3443cb90d00c50d9b6b3b0a3a7fca93df8261af979b" +dependencies = [ + "cosmwasm-std", + "cw-utils", + "schemars", + "serde", +] + +[[package]] +name = "cw3-fixed-multisig" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54aa54c13f405ec4ab36b6217538bc957d439eee58f89312db05a79caf6706" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "cw2", + "cw3", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw3-flex-multisig" +version = "0.13.1" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-multi-test", + "cw-storage-plus", + "cw-utils", + "cw2", + "cw3", + "cw3-fixed-multisig", + "cw4", + "cw4-group", + "nym-group-contract-common", + "nym-multisig-contract-common", + "schemars", + "serde", +] + +[[package]] +name = "cw4" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0acc3549d5ce11c6901b3a676f2e2628684722197054d97cd0101ea174ed5cbd" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "serde", +] + +[[package]] +name = "cw4-group" +version = "0.13.4" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-controllers", + "cw-storage-plus", + "cw-utils", + "cw2", + "cw4", + "nym-group-contract-common", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "dyn-clone" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" + +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand", + "serde", + "sha2", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek", + "hashbrown", + "hex", + "rand_core 0.6.4", + "serde", + "sha2", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array 0.14.6", + "group", + "rand_core 0.6.4", + "sec1", + "subtle 2.4.1", + "zeroize", +] + +[[package]] +name = "enum-iterator" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "355f93763ef7b0ae1c43c4d8eccc9d5848d84ad1a1d8ce61c421d1ac85a19d05" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle 2.4.1", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "forward_ref" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getset" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "git2" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "url", +] + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle 2.4.1", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01706d578d5c281058480e673ae4086a9f4710d8df1ad80a5b03e39ece5f886b" +dependencies = [ + "digest 0.9.0", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sec1", + "sha2", +] + +[[package]] +name = "keystream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "libgit2-sys" +version = "0.13.5+1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51e5ea06c26926f1002dd553fded6cfcdc9784c1f60feeb58368b4d9b07b6dba" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "lioness" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae926706ba42c425c9457121178330d75e273df2e82e28b758faf3de3a9acb9" +dependencies = [ + "arrayref", + "blake2", + "chacha", + "keystream", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "nym-bandwidth-claim-contract" +version = "0.1.0" +dependencies = [ + "schemars", + "serde", +] + +[[package]] +name = "nym-coconut-bandwidth" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "cosmwasm-storage", + "cw-controllers", + "cw-storage-plus", + "nym-bandwidth-claim-contract", + "nym-coconut-bandwidth-contract-common", + "nym-multisig-contract-common", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "nym-coconut-bandwidth-contract-common" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "nym-multisig-contract-common", + "schemars", + "serde", +] + +[[package]] +name = "nym-coconut-dkg" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "cosmwasm-storage", + "cw-controllers", + "cw-multi-test", + "cw-storage-plus", + "cw4", + "cw4-group", + "lazy_static", + "nym-coconut-dkg-common", + "nym-group-contract-common", + "rusty-fork", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "nym-coconut-dkg-common" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "cw-utils", + "nym-contracts-common", + "nym-multisig-contract-common", + "schemars", + "serde", +] + +[[package]] +name = "nym-contracts-common" +version = "0.3.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "nym-crypto" +version = "0.2.0" +dependencies = [ + "bs58", + "ed25519-dalek", + "nym-pemstore", + "nym-sphinx-types", + "rand", + "subtle-encoding", + "thiserror", + "x25519-dalek", +] + +[[package]] +name = "nym-group-contract-common" +version = "0.1.0" +dependencies = [ + "cw4", + "schemars", + "serde", +] + +[[package]] +name = "nym-mixnet-contract" +version = "1.2.0-pre.0" +dependencies = [ + "bs58", + "cosmwasm-derive", + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-storage", + "cw-storage-plus", + "cw2", + "nym-crypto", + "nym-mixnet-contract-common", + "nym-vesting-contract-common", + "rand_chacha 0.2.2", + "schemars", + "semver", + "serde", + "thiserror", + "time", + "vergen", +] + +[[package]] +name = "nym-mixnet-contract-common" +version = "0.3.0" +dependencies = [ + "bs58", + "cosmwasm-std", + "humantime-serde", + "log", + "nym-contracts-common", + "schemars", + "serde", + "serde_json", + "serde_repr", + "thiserror", + "time", +] + +[[package]] +name = "nym-multisig-contract-common" +version = "0.1.0" +dependencies = [ + "cosmwasm-std", + "cw-utils", + "cw3", + "cw3-fixed-multisig", + "cw4", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "nym-pemstore" +version = "0.2.0" +dependencies = [ + "pem", +] + +[[package]] +name = "nym-sphinx-types" +version = "0.2.0" +dependencies = [ + "sphinx-packet", +] + +[[package]] +name = "nym-vesting-contract" +version = "1.2.0-pre.1" +dependencies = [ + "base64 0.21.0", + "cosmwasm-derive", + "cosmwasm-std", + "cw-storage-plus", + "cw2", + "hex", + "nym-contracts-common", + "nym-mixnet-contract-common", + "nym-vesting-contract-common", + "rand_chacha 0.3.1", + "schemars", + "semver", + "serde", + "serde_json", + "thiserror", + "vergen", +] + +[[package]] +name = "nym-vesting-contract-common" +version = "0.3.0" +dependencies = [ + "cosmwasm-std", + "nym-contracts-common", + "nym-mixnet-contract-common", + "schemars", + "serde", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "pem" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" +dependencies = [ + "base64 0.13.1", + "once_cell", + "regex", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_distr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9532ada3929fb8b2e9dbe28d1e06c9b2cc65813f074fcb6bd5fbefeff9d56" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac", + "zeroize", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.36.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schemars" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array 0.14.6", + "pkcs8", + "subtle 2.4.1", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-json-wasm" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.3", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] + +[[package]] +name = "sphinx-packet" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc43eda802856ee82a7555c7b75ceb9e07451741c7a2f5f23d036020e01189d4" +dependencies = [ + "aes", + "arrayref", + "blake2", + "bs58", + "byteorder", + "chacha", + "curve25519-dalek", + "digest 0.9.0", + "hkdf", + "hmac", + "lioness", + "log", + "rand", + "rand_distr", + "sha2", + "subtle 2.4.1", +] + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subtle-encoding" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +dependencies = [ + "zeroize", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8234ae35e70582bfa0f1fedffa6daa248e41dd045310b19800c4a36382c8f60" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.42.0", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.3", +] + +[[package]] +name = "time" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vergen" +version = "7.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447f9238a4553957277b3ee09d80babeae0811f1b3baefb093de1c0448437a37" +dependencies = [ + "anyhow", + "cfg-if", + "enum-iterator", + "getset", + "git2", + "rustc_version", + "rustversion", + "thiserror", + "time", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "x25519-dalek" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077" +dependencies = [ + "curve25519-dalek", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 38c8c24f84..404e7fbc61 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -27,3 +27,11 @@ codegen-units = 1 panic = 'abort' incremental = false overflow-checks = true + +[workspace.dependencies] +cosmwasm-std = "=1.0.0" +cosmwasm-storage = "=1.0.0" +cosmwasm-schema = "=1.0.0" +cosmwasm-derive = "=1.0.0" +cw2 = { version = "=0.13.4" } +cw-storage-plus = "=0.13.4" diff --git a/contracts/mixnet/Cargo.toml b/contracts/mixnet/Cargo.toml index ec6a6659a0..d02afd93f4 100644 --- a/contracts/mixnet/Cargo.toml +++ b/contracts/mixnet/Cargo.toml @@ -26,10 +26,11 @@ mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet- vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.3.0" } #nym-config = { path = "../../common/config"} -cosmwasm-std = "1.0.0" -cosmwasm-storage = "1.0.0" -cw2 = { version = "0.13.4" } -cw-storage-plus = "0.13.4" +cosmwasm-std = { workspace = true } +cosmwasm-storage = { workspace = true } +cosmwasm-derive = { workspace = true } +cw2 = { workspace = true } +cw-storage-plus = { workspace = true } bs58 = "0.4.0" schemars = "0.8" @@ -39,7 +40,7 @@ time = { version = "0.3", features = ["macros"] } semver = { version = "1.0.16", default-features = false } [dev-dependencies] -cosmwasm-schema = "1.0.0" +cosmwasm-schema = { workspace = true } rand_chacha = "0.2" #rand = "0.7" nym-crypto = { path = "../../common/crypto", features = ["asymmetric", "rand"] } diff --git a/contracts/vesting/Cargo.toml b/contracts/vesting/Cargo.toml index dcfbd2af57..5e2a6d5780 100644 --- a/contracts/vesting/Cargo.toml +++ b/contracts/vesting/Cargo.toml @@ -24,9 +24,10 @@ mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet- contracts-common = { path = "../../common/cosmwasm-smart-contracts/contracts-common", package = "nym-contracts-common", version = "0.3.0" } vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract", package = "nym-vesting-contract-common", version = "0.3.0" } -cosmwasm-std = { version = "1.0.0 "} -cw2 = { version = "0.13.4" } -cw-storage-plus = { version = "0.13.4", features = ["iterator"] } +cosmwasm-std = { workspace = true } +cosmwasm-derive = { workspace = true } +cw2 = { workspace = true } +cw-storage-plus = { workspace = true, features = ["iterator"] } schemars = "0.8" serde = { version = "1.0", default-features = false, features = ["derive"] } From efd98831974f29f2462a2d0e24ccf682d0eeb43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= <jon.haggblad@gmail.com> Date: Tue, 21 Mar 2023 12:19:11 +0100 Subject: [PATCH 22/27] Use workspace deps for coconut contracts --- contracts/Cargo.toml | 12 +++++++++--- contracts/coconut-bandwidth/Cargo.toml | 8 ++++---- contracts/coconut-dkg/Cargo.toml | 12 ++++++------ contracts/coconut-test/Cargo.toml | 16 ++++++++-------- contracts/multisig/cw3-flex-multisig/Cargo.toml | 14 +++++++------- contracts/multisig/cw4-group/Cargo.toml | 14 +++++++------- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 404e7fbc61..1462b2cb56 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -29,9 +29,15 @@ incremental = false overflow-checks = true [workspace.dependencies] +cosmwasm-derive = "=1.0.0" +cosmwasm-schema = "=1.0.0" cosmwasm-std = "=1.0.0" cosmwasm-storage = "=1.0.0" -cosmwasm-schema = "=1.0.0" -cosmwasm-derive = "=1.0.0" -cw2 = { version = "=0.13.4" } +cw-controllers = "=0.13.4" +cw-multi-test = "=0.13.4" cw-storage-plus = "=0.13.4" +cw-utils = "=0.13.4" +cw2 = "=0.13.4" +cw3 = "=0.13.4" +cw3-fixed-multisig = "=0.13.4" +cw4 = "=0.13.4" diff --git a/contracts/coconut-bandwidth/Cargo.toml b/contracts/coconut-bandwidth/Cargo.toml index 1f71495471..5064d41867 100644 --- a/contracts/coconut-bandwidth/Cargo.toml +++ b/contracts/coconut-bandwidth/Cargo.toml @@ -13,10 +13,10 @@ nym-bandwidth-claim-contract = { path = "../../common/bandwidth-claim-contract" nym-coconut-bandwidth-contract-common = { path = "../../common/cosmwasm-smart-contracts/coconut-bandwidth-contract" } nym-multisig-contract-common = { path = "../../common/cosmwasm-smart-contracts/multisig-contract" } -cosmwasm-std = "1.0.0" -cosmwasm-storage = "1.0.0" -cw-storage-plus = "0.13.4" -cw-controllers = "0.13.4" +cosmwasm-std = { workspace = true } +cosmwasm-storage = { workspace = true } +cw-storage-plus = { workspace = true } +cw-controllers = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/contracts/coconut-dkg/Cargo.toml b/contracts/coconut-dkg/Cargo.toml index 6198886828..f877df138d 100644 --- a/contracts/coconut-dkg/Cargo.toml +++ b/contracts/coconut-dkg/Cargo.toml @@ -11,18 +11,18 @@ crate-type = ["cdylib", "rlib"] [dependencies] nym-coconut-dkg-common = { path = "../../common/cosmwasm-smart-contracts/coconut-dkg" } -cosmwasm-std = "1.0.0" -cosmwasm-storage = "1.0.0" -cw-storage-plus = "0.13.4" -cw-controllers = "0.13.4" -cw4 = { version = "0.13.4" } +cosmwasm-std = { workspace = true } +cosmwasm-storage = { workspace = true } +cw-storage-plus = { workspace = true } +cw-controllers = { workspace = true } +cw4 = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = "1.0.23" [dev-dependencies] -cw-multi-test = { version = "0.13.4" } +cw-multi-test = { workspace = true } cw4-group = { path = "../multisig/cw4-group" } nym-group-contract-common = { path = "../../common/cosmwasm-smart-contracts/group-contract" } lazy_static = "1.4" diff --git a/contracts/coconut-test/Cargo.toml b/contracts/coconut-test/Cargo.toml index 846cf3ed7b..2a0eb5cb3f 100644 --- a/contracts/coconut-test/Cargo.toml +++ b/contracts/coconut-test/Cargo.toml @@ -13,13 +13,13 @@ nym-coconut-dkg-common = { path = "../../common/cosmwasm-smart-contracts/coconut nym-multisig-contract-common = { path = "../../common/cosmwasm-smart-contracts/multisig-contract" } nym-group-contract-common = { path = "../../common/cosmwasm-smart-contracts/group-contract" } -cosmwasm-std = "1.0.0" -cosmwasm-storage = "1.0.0" -cw3 = "0.13.4" -cw4 = "0.13.4" -cw-storage-plus = "0.13.4" -cw-controllers = "0.13.4" -cw-utils = "0.13.4" +cosmwasm-std = { workspace = true } +cosmwasm-storage = { workspace = true } +cw3 = { workspace = true } +cw4 = { workspace = true } +cw-storage-plus = { workspace = true } +cw-controllers = { workspace = true } +cw-utils = { workspace = true } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } @@ -27,7 +27,7 @@ thiserror = "1.0.23" nym-coconut-bandwidth = { path = "../coconut-bandwidth" } nym-coconut-dkg = { path = "../coconut-dkg" } -cw-multi-test = { version = "0.13.4" } +cw-multi-test = { workspace = true } cw3-flex-multisig = { path = "../multisig/cw3-flex-multisig" } cw4-group = { path = "../multisig/cw4-group" } diff --git a/contracts/multisig/cw3-flex-multisig/Cargo.toml b/contracts/multisig/cw3-flex-multisig/Cargo.toml index 6cee7f8529..cf2277e5b1 100644 --- a/contracts/multisig/cw3-flex-multisig/Cargo.toml +++ b/contracts/multisig/cw3-flex-multisig/Cargo.toml @@ -17,13 +17,13 @@ crate-type = ["cdylib", "rlib"] library = [] [dependencies] -cw-utils = { version = "0.13.4" } -cw2 = { version = "0.13.4" } -cw3 = { version = "0.13.4" } -cw3-fixed-multisig = { version = "0.13.4", features = ["library"] } -cw4 = { version = "0.13.4" } -cw-storage-plus = { version = "0.13.4" } -cosmwasm-std = { version = "1.0.0" } +cw-utils = { workspace = true } +cw2 = { workspace = true } +cw3 = { workspace = true } +cw3-fixed-multisig = { workspace = true, features = ["library"] } +cw4 = { workspace = true } +cw-storage-plus = { workspace = true } +cosmwasm-std = { workspace = true } schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/contracts/multisig/cw4-group/Cargo.toml b/contracts/multisig/cw4-group/Cargo.toml index 8002cca469..4605ec5bcc 100644 --- a/contracts/multisig/cw4-group/Cargo.toml +++ b/contracts/multisig/cw4-group/Cargo.toml @@ -26,15 +26,15 @@ library = [] [dependencies] nym-group-contract-common = { path = "../../../common/cosmwasm-smart-contracts/group-contract" } -cw-utils = { version = "0.13.4" } -cw2 = { version = "0.13.4" } -cw4 = { version = "0.13.4" } -cw-controllers = { version = "0.13.4" } -cw-storage-plus = { version = "0.13.4" } -cosmwasm-std = { version = "1.0.0" } +cw-utils = { workspace = true } +cw2 = { workspace = true } +cw4 = { workspace = true } +cw-controllers = { workspace = true } +cw-storage-plus = { workspace = true } +cosmwasm-std = { workspace = true } schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = { version = "1.0.23" } [dev-dependencies] -cosmwasm-schema = { version = "1.0.0" } +cosmwasm-schema = { workspace = true } From 61982de511d4862cf55aca98c762e715cb5523a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= <jon.haggblad@gmail.com> Date: Tue, 21 Mar 2023 12:23:42 +0100 Subject: [PATCH 23/27] A few more workspace versions --- common/client-libs/validator-client/Cargo.toml | 2 +- common/commands/Cargo.toml | 2 +- common/types/Cargo.toml | 2 +- nym-api/Cargo.toml | 2 +- nym-api/nym-api-requests/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index f218d7a6c7..dbe25ebbbd 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -46,7 +46,7 @@ prost = { version = "0.10", default-features = false, optional = true } flate2 = { version = "1.0.20", optional = true } sha2 = { version = "0.9.5", optional = true } itertools = { version = "0.10", optional = true } -cosmwasm-std = { version = "1.0.0", optional = true } +cosmwasm-std = { workspace = true, optional = true } zeroize = { version = "1.5.7", optional = true } [dev-dependencies] diff --git a/common/commands/Cargo.toml b/common/commands/Cargo.toml index 5a872b0ec1..013670d8cd 100644 --- a/common/commands/Cargo.toml +++ b/common/commands/Cargo.toml @@ -26,7 +26,7 @@ url = "2.2" tap = "1" cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support" } -cosmwasm-std = { version = "1.0.0" } +cosmwasm-std = { workspace = true } validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"] } nym-network-defaults = { path = "../network-defaults" } diff --git a/common/types/Cargo.toml b/common/types/Cargo.toml index 33fb8c327c..5f822c4987 100644 --- a/common/types/Cargo.toml +++ b/common/types/Cargo.toml @@ -19,7 +19,7 @@ thiserror = "1.0" url = "2.2" ts-rs = "6.1.2" -cosmwasm-std = "1.0.0" +cosmwasm-std = { workspace = true } cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support" } validator-client = { path = "../../common/client-libs/validator-client", features = [ diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 2bbf7cc32b..14f4cac876 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -68,7 +68,7 @@ nym-coconut-bandwidth-contract-common = { path = "../common/cosmwasm-smart-contr nym-coconut-dkg-common = { path = "../common/cosmwasm-smart-contracts/coconut-dkg" } nym-coconut-interface = { path = "../common/coconut-interface" } nym-config = { path = "../common/config" } -cosmwasm-std = "1.0.0" +cosmwasm-std = { workspace = true } nym-credential-storage = { path = "../common/credential-storage" } nym-credentials = { path = "../common/credentials" } nym-crypto = { path = "../common/crypto" } diff --git a/nym-api/nym-api-requests/Cargo.toml b/nym-api/nym-api-requests/Cargo.toml index e2c21bc49e..ed8dc1dce6 100644 --- a/nym-api/nym-api-requests/Cargo.toml +++ b/nym-api/nym-api-requests/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] bs58 = "0.4.0" cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support" } -cosmwasm-std = { version = "1.0.0", default-features = false } +cosmwasm-std = { workspace = true, default-features = false } getset = "0.1.1" schemars = { version = "0.8", features = ["preserve_order"] } serde = { version = "1.0", features = ["derive"] } From 27a6b99453a5e3650c172f3254a174716020d451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= <jon.haggblad@gmail.com> Date: Tue, 21 Mar 2023 12:31:25 +0100 Subject: [PATCH 24/27] Even more workspace version missed earlier --- common/client-libs/validator-client/Cargo.toml | 4 ++-- common/commands/Cargo.toml | 2 +- contracts/multisig/cw3-flex-multisig/Cargo.toml | 2 +- nym-api/Cargo.toml | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index dbe25ebbbd..7673c3ab46 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -40,8 +40,8 @@ async-trait = { workspace = true, optional = true } bip39 = { version = "1", features = ["rand"], optional = true } nym-config = { path = "../../config", optional = true } cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support", features = ["rpc", "bip32", "cosmwasm"], optional = true} -cw3 = { version = "0.13.4", optional = true } -cw4 = { version = "0.13.4", optional = true } +cw3 = { workspace = true, optional = true } +cw4 = { workspace = true, optional = true } prost = { version = "0.10", default-features = false, optional = true } flate2 = { version = "1.0.20", optional = true } sha2 = { version = "0.9.5", optional = true } diff --git a/common/commands/Cargo.toml b/common/commands/Cargo.toml index 013670d8cd..01d9f3f5fa 100644 --- a/common/commands/Cargo.toml +++ b/common/commands/Cargo.toml @@ -11,7 +11,7 @@ bs58 = "0.4" comfy-table = "6.0.0" cfg-if = "1.0.0" clap = { version = "4.0", features = ["derive"] } -cw-utils = { version = "0.13.4" } +cw-utils = { workspace = true } handlebars = "3.0.1" humantime-serde = "1.0" k256 = { version = "0.10", features = ["ecdsa", "sha256"] } diff --git a/contracts/multisig/cw3-flex-multisig/Cargo.toml b/contracts/multisig/cw3-flex-multisig/Cargo.toml index cf2277e5b1..0c45bb149d 100644 --- a/contracts/multisig/cw3-flex-multisig/Cargo.toml +++ b/contracts/multisig/cw3-flex-multisig/Cargo.toml @@ -33,4 +33,4 @@ nym-multisig-contract-common = { path= "../../../common/cosmwasm-smart-contracts [dev-dependencies] cosmwasm-schema = { version = "1.0.0" } cw4-group = { path = "../cw4-group", version = "0.13.4" } -cw-multi-test = { version = "0.13.4" } +cw-multi-test = { workspace = true } diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 14f4cac876..b1f76ffae6 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -72,8 +72,8 @@ cosmwasm-std = { workspace = true } nym-credential-storage = { path = "../common/credential-storage" } nym-credentials = { path = "../common/credentials" } nym-crypto = { path = "../common/crypto" } -cw3 = { version = "0.13.4" } -cw4 = { version = "0.13.4" } +cw3 = { workspace = true } +cw4 = { workspace = true } nym-dkg = { path = "../common/dkg", features = ["cw-types"] } gateway-client = { path = "../common/client-libs/gateway-client" } nym-inclusion-probability = { path = "../common/inclusion-probability" } @@ -106,5 +106,5 @@ sqlx = { version = "0.6.2", features = [ ] } [dev-dependencies] -cw3 = "0.13.4" -cw-utils = "0.13.4" +cw3 = { workspace = true } +cw-utils = { workspace = true } From 80c5194d8ba1a554d1a1fa6a6c55813a6a040b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= <jon.haggblad@gmail.com> Date: Tue, 21 Mar 2023 12:39:21 +0100 Subject: [PATCH 25/27] Add explicit cosmwasm-crypto 1.0.0 dev-dependency --- contracts/Cargo.lock | 1 + contracts/Cargo.toml | 1 + contracts/vesting/Cargo.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index 0eeec44dd4..11bcb094d5 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -1133,6 +1133,7 @@ name = "nym-vesting-contract" version = "1.2.0-pre.1" dependencies = [ "base64 0.21.0", + "cosmwasm-crypto", "cosmwasm-derive", "cosmwasm-std", "cw-storage-plus", diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 1462b2cb56..553b276573 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -29,6 +29,7 @@ incremental = false overflow-checks = true [workspace.dependencies] +cosmwasm-crypto = "=1.0.0" cosmwasm-derive = "=1.0.0" cosmwasm-schema = "=1.0.0" cosmwasm-std = "=1.0.0" diff --git a/contracts/vesting/Cargo.toml b/contracts/vesting/Cargo.toml index 5e2a6d5780..d50c363e07 100644 --- a/contracts/vesting/Cargo.toml +++ b/contracts/vesting/Cargo.toml @@ -39,6 +39,7 @@ rand_chacha = "0.3.1" base64 = "0.21.0" hex = "0.4.3" serde_json = "1.0.66" +cosmwasm-crypto = { workspace = true } [build-dependencies] vergen = { version = "=7.4.3", default-features = false, features = ["build", "git", "rustc"] } From 7b419c2b12fe51d55059e6c161e09473c2789054 Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Wed, 22 Mar 2023 10:12:33 +0100 Subject: [PATCH 26/27] bump version of contracts --- contracts/Cargo.lock | 4 ++-- contracts/mixnet/Cargo.toml | 2 +- contracts/vesting/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index 11bcb094d5..b1c927514c 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -1062,7 +1062,7 @@ dependencies = [ [[package]] name = "nym-mixnet-contract" -version = "1.2.0-pre.0" +version = "1.2.0" dependencies = [ "bs58", "cosmwasm-derive", @@ -1130,7 +1130,7 @@ dependencies = [ [[package]] name = "nym-vesting-contract" -version = "1.2.0-pre.1" +version = "1.2.0" dependencies = [ "base64 0.21.0", "cosmwasm-crypto", diff --git a/contracts/mixnet/Cargo.toml b/contracts/mixnet/Cargo.toml index d02afd93f4..9f180929d3 100644 --- a/contracts/mixnet/Cargo.toml +++ b/contracts/mixnet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-mixnet-contract" -version = "1.2.0-pre.0" +version = "1.2.0" description = "Nym mixnet contract" edition = { workspace = true } authors = { workspace = true } diff --git a/contracts/vesting/Cargo.toml b/contracts/vesting/Cargo.toml index d50c363e07..341fdf284f 100644 --- a/contracts/vesting/Cargo.toml +++ b/contracts/vesting/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-vesting-contract" -version = "1.2.0-pre.1" +version = "1.2.0" description = "Nym vesting contract" edition = { workspace = true } authors = { workspace = true } From c7f8b05604c61c4403f3a2126fb1081bb23e5cb8 Mon Sep 17 00:00:00 2001 From: farbanas <arbanasfran@gmail.com> Date: Wed, 22 Mar 2023 10:23:19 +0100 Subject: [PATCH 27/27] fix: wallet CHANGELOG --- nym-wallet/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index 8eccaf2471..32bba826cb 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Unreleased] -## [v1.1.13] (2023-03-15) +## [v1.1.12] (2023-03-15) - Wallet - in the vesting section separate the "Unlocked transferable tokens" into "Unlocked vesting tokens" and "Transferable rewards" for better clarity ([#3132]) - Wallet - change the Bonding flow to include an additional step for the user to provide a unique signature when they bond their node ([#3109])