Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/wallet delegation UI squashed #1326

Merged
merged 51 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
7f2027c
Delegation UI:
tommyv1987 May 11, 2022
51b0408
Fix rebase errors
mmsinclair May 27, 2022
0812296
Integrate fees changes:
mmsinclair May 27, 2022
9fbefa3
get wallet balance after transactions
fmtabbara May 27, 2022
97ad1a2
fix duplicate key
fmtabbara May 30, 2022
83090c0
use token pool selector
fmtabbara May 30, 2022
b550c32
update wording
fmtabbara May 30, 2022
3f718fe
Created nymd internal coin
jstuczyn May 30, 2022
ece22b9
spell delegations correctly!
fmtabbara May 30, 2022
972c607
Additional From implementations plus a constructor
jstuczyn May 30, 2022
5925e85
try_add
jstuczyn May 30, 2022
84a42f6
Changed client API to use the new coin type
jstuczyn May 30, 2022
ecca7e8
CoinConverter trait
jstuczyn May 30, 2022
766c315
Made wallet compilable with the recent changes
jstuczyn May 30, 2022
de1df74
Simplified the API by removing the generics in favour of explicit Coi…
jstuczyn May 30, 2022
374baa5
Fixed validator api
jstuczyn May 30, 2022
b2ce142
integrate modal divider with modal component
fmtabbara May 30, 2022
37d55f3
handle undelegation of locked tokens
fmtabbara May 30, 2022
c9f8218
only return events table if there are events
fmtabbara May 31, 2022
985a384
Fixed up tests and clippy
jstuczyn May 31, 2022
ea54a3e
Merge with develop
jstuczyn May 31, 2022
1112263
Refactored missed coin-generic API methods
jstuczyn May 31, 2022
241f0cf
changelog
jstuczyn May 31, 2022
6030d38
refresh on network or client details change
fmtabbara May 31, 2022
84c9394
Broken, but compilable first stage of post-merging
jstuczyn Jun 1, 2022
9460276
Bunch of temporary workaround to have wallet working-ish
jstuczyn Jun 1, 2022
04d02b0
Merged with develop
jstuczyn Jun 1, 2022
a33c21d
Merge branch 'develop' into feature/wallet-delegation-ui-squashed
fmtabbara Jun 1, 2022
3519d0c
Merge branch 'develop' into feature/wallet-delegation-ui-squashed
fmtabbara Jun 1, 2022
df19260
Add claim and compound wallet endpoints, proc_macro to generate execu…
durch Jun 6, 2022
2483a54
CHANGELOG
durch Jun 6, 2022
184dd77
Sort CHANGELOG lines
durch Jun 6, 2022
282b186
PR comments
durch Jun 6, 2022
24c1467
Merge with wallet-claim-rewards
jstuczyn Jun 6, 2022
78e0ae0
allow sorting of pending events
fmtabbara Jun 6, 2022
9503521
fix lint errors
fmtabbara Jun 6, 2022
0894be7
handle page overflow
fmtabbara Jun 6, 2022
bf91e89
handle reedem and vesting redeem requests
fmtabbara Jun 6, 2022
3e9aa02
set up compound rewards
fmtabbara Jun 6, 2022
9092a80
refresh locked tokens on page load
fmtabbara Jun 6, 2022
91640f1
remove old delegations pages + remove settings modal + update network…
fmtabbara Jun 7, 2022
e448136
Merge with develop
jstuczyn Jun 8, 2022
dc7feea
update validation for hostname (prevent leading spaces)
fmtabbara Jun 8, 2022
9d856c5
add compound success case
fmtabbara Jun 8, 2022
2a4b800
display est fee until new simulations are used
fmtabbara Jun 8, 2022
b15292e
fix up coin validation
fmtabbara Jun 9, 2022
6eb0742
tommy fixes
fmtabbara Jun 9, 2022
40c0764
Show app version at bottom of nav
mmsinclair Jun 9, 2022
44c437e
Show admin page when account matches account id from `.env` file `ADM…
mmsinclair Jun 9, 2022
fed1136
Merge branch 'develop' into feature/wallet-delegation-ui-squashed
mmsinclair Jun 9, 2022
e12549e
Update change log
mmsinclair Jun 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/nym-wallet-publish-macos.yml
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ jobs:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
ADMIN_ADDRESS: ${{ secrets.WALLET_ADMIN_ADDRESS }}
run: yarn && yarn build

- name: Upload to release based on tag name
1 change: 1 addition & 0 deletions .github/workflows/nym-wallet-publish-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ jobs:
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
ADMIN_ADDRESS: ${{ secrets.WALLET_ADMIN_ADDRESS }}
- name: Upload to release based on tag name
uses: softprops/action-gh-release@v1
with:
1 change: 1 addition & 0 deletions .github/workflows/nym-wallet-publish-windows10.yml
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ jobs:
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
ADMIN_ADDRESS: ${{ secrets.WALLET_ADMIN_ADDRESS }}
run: yarn build

- name: Upload to release based on tag name
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
- wallet: compound and claim reward endpoints for operators and delegators ([#1302])
- wallet: require password to switch accounts
- wallet: the wallet backend learned how to keep track of validator name, either hardcoded or by querying the status endpoint.
- wallet: new delegation and rewards UI
- wallet: show version in nav bar
- wallet: contract admin route put back
- network-statistics: a new mixnet service that aggregates and exposes anonymized data about mixnet services ([#1328])

### Fixed
86 changes: 84 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ members = [
"common/socks5/requests",
"common/task",
"common/topology",
"common/types",
"common/wasm-utils",
"explorer-api",
"gateway",
@@ -67,6 +68,7 @@ members = [
"service-providers/network-statistics",
"validator-api",
"validator-api/validator-api-requests",
"tools/ts-rs-cli"
]

default-members = [
@@ -79,4 +81,4 @@ default-members = [
"explorer-api",
]

exclude = ["explorer", "contracts", "tokenomics-py", "clients/webassembly"]
exclude = ["explorer", "contracts", "tokenomics-py", "clients/webassembly", "nym-wallet"]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -54,3 +54,7 @@ fmt-wallet:

wasm:
RUSTFLAGS='-C link-arg=-s' cargo build --manifest-path contracts/Cargo.toml --release --target wasm32-unknown-unknown

generate-typescript:
cd tools/ts-rs-cli && cargo run && cd ../..
yarn types:lint:fix
7 changes: 7 additions & 0 deletions assets/token/token-dark-testnet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/token/token-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/token/token-light-testnet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/token/token-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions common/client-libs/validator-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -58,3 +58,5 @@ nymd-client = [
"itertools",
"cosmwasm-std",
]
generate-ts = []

Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
use crate::nymd::error::NymdError;
use cosmrs::tendermint::abci;
use itertools::Itertools;
use serde::Deserialize;
use serde::{Deserialize, Serialize};

// it seems that currently validators just emit stringified events (which are also returned as part of deliverTx response)
// as theirs logs
#[derive(Debug, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct Log {
#[serde(default)]
// weird thing is that the first msg_index seems to always be undefined on the raw logs
12 changes: 11 additions & 1 deletion common/client-libs/validator-client/src/nymd/mod.rs
Original file line number Diff line number Diff line change
@@ -289,7 +289,17 @@ impl<C> NymdClient<C> {
where
C: CosmWasmClient + Sync,
{
Ok(self.client.get_block(None).await?.block.header.time)
self.get_block_timestamp(None).await
}

pub async fn get_block_timestamp(
&self,
height: Option<u32>,
) -> Result<TendermintTime, NymdError>
where
C: CosmWasmClient + Sync,
{
Ok(self.client.get_block(height).await?.block.header.time)
}

pub async fn get_current_block_height(&self) -> Result<Height, NymdError>
Original file line number Diff line number Diff line change
@@ -183,6 +183,7 @@ impl<C: CosmWasmClient + Sync + Send> VestingQueryClient for NymdClient<C> {
.map(Into::into)
}

/// Returns the total amount of delegated tokens that have vested
async fn delegated_vesting(
&self,
vesting_account_address: &str,
3 changes: 2 additions & 1 deletion common/cosmwasm-smart-contracts/mixnet-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -18,12 +18,13 @@ fixed = { version = "1.1", features = ["serde"] }
az = "1.1"
log = "0.4.14"
time = { version = "0.3.6", features = ["parsing", "formatting"] }
ts-rs = "6.1.2"

contracts-common = { path = "../contracts-common" }

[dev-dependencies]
time = { version = "0.3.5", features = ["serde", "macros"] }
ts-rs = "6.1.2"

[features]
default = []
generate-ts = []
Original file line number Diff line number Diff line change
@@ -8,11 +8,6 @@ use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::fmt::Display;

#[cfg_attr(test, derive(ts_rs::TS))]
#[cfg_attr(
test,
ts(export, export_to = "../../../nym-wallet/src/types/rust/gateway.ts")
)]
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize, JsonSchema)]
pub struct Gateway {
pub host: String,
14 changes: 3 additions & 11 deletions common/cosmwasm-smart-contracts/mixnet-contract/src/mixnode.rs
Original file line number Diff line number Diff line change
@@ -14,13 +14,10 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
use std::cmp::Ordering;
use std::fmt::Display;

#[cfg_attr(test, derive(ts_rs::TS))]
#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))]
#[cfg_attr(
test,
ts(
export,
export_to = "../../../nym-wallet/src/types/rust/rewardedsetnodestatus.ts"
)
feature = "generate-ts",
ts(export_to = "ts-packages/types/src/types/rust/RewardedSetNodeStatus.ts")
)]
#[derive(Clone, Copy, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
pub enum RewardedSetNodeStatus {
@@ -109,11 +106,6 @@ impl PendingUndelegate {
}
}

#[cfg_attr(test, derive(ts_rs::TS))]
#[cfg_attr(
test,
ts(export, export_to = "../../../nym-wallet/src/types/rust/mixnode.ts")
)]
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize, JsonSchema)]
pub struct MixNode {
pub host: String,
5 changes: 3 additions & 2 deletions common/cosmwasm-smart-contracts/vesting-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ serde = { version = "1.0", features = ["derive"] }
schemars = "0.8"
cw-storage-plus = "0.13.4"
config = { path = "../../config" }

[dev-dependencies]
ts-rs = "6.1.2"

[features]
generate-ts = []
6 changes: 3 additions & 3 deletions common/cosmwasm-smart-contracts/vesting-contract/src/lib.rs
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ pub fn one_ucoin() -> Coin {
Coin::new(1, DENOM)
}

#[cfg_attr(test, derive(ts_rs::TS))]
#[cfg_attr(feature = "generate-ts", derive(ts_rs::TS))]
#[cfg_attr(
test,
ts(export, export_to = "../../../nym-wallet/src/types/rust/period.ts")
feature = "generate-ts",
ts(export_to = "ts-packages/types/src/types/rust/Period.ts")
)]
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, JsonSchema)]
pub enum Period {
40 changes: 40 additions & 0 deletions common/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "nym-types"
version = "1.0.0"
description = "Nym common types"
authors = ["Nym Technologies SA"]
edition = "2021"
rust-version = "1.58"

[dependencies]
eyre = "0.6.5"
log = "0.4"
itertools = "0.10"
reqwest = "0.11.9"
schemars = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
strum = { version = "0.23", features = ["derive"] }
thiserror = "1.0"
url = "2.2"
ts-rs = "6.1.2"

cosmwasm-std = "1.0.0-beta8"
cosmrs = "0.7.0"

validator-client = { path = "../../common/client-libs/validator-client", features = [
"nymd-client",
] }
mixnet-contract-common = { path = "../../common/cosmwasm-smart-contracts/mixnet-contract" }
vesting-contract-common = { path = "../../common/cosmwasm-smart-contracts/vesting-contract" }
config = { path = "../../common/config" }
coconut-interface = { path = "../../common/coconut-interface" }
# Used for Type conversion, can be extracted but its a lot of work
vesting-contract = { path = "../../contracts/vesting" }

[dev-dependencies]
tempfile = "3.3.0"

[features]
default = []
generate-ts = []
Loading