From f33defc645f6f4e576029263a2aaadc25152fad0 Mon Sep 17 00:00:00 2001 From: Drazen Urch Date: Thu, 16 Sep 2021 17:36:24 +0200 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 976dd7aae2e7ee6c8a0fdbe368f393b1c26ad704 Author: Drazen Urch Date: Wed Sep 15 17:28:49 2021 +0200 Add block_height method to Delegation (#778) Co-authored-by: Drazen Urch commit 0d21f4e937b1222820260a426c02b10d420963aa Merge: e84af4f6 1403449a Author: Fouad Date: Wed Sep 15 12:41:29 2021 +0100 Merge pull request #776 from nymtech/update/re-enable-bonding re-enable bonding commit 1403449ad51ec2cba19997af88e60f1435512171 Author: fmtabbara Date: Tue Sep 14 16:00:21 2021 +0100 enable bonding commit e84af4f6018772feb4896b31702f2d33ee4c1fb1 Author: Drazen Urch Date: Tue Sep 14 15:15:26 2021 +0200 Migrate legacy delegation data (#771) * Skip ReadOnlyBucket deserialization errors * empty migration * clippy * cargo schema * Drop invalid delegation data * Dont drop old data * Add todo * Unify on type param * gateways are different * cargo fmt Co-authored-by: Drazen Urch commit 26b032c15c7c8ec8f1442f23d2416bafce65323a Merge: e1ddaff0 cba36253 Author: Mark Sinclair Date: Tue Sep 14 10:09:14 2021 +0100 Merge pull request #774 from nymtech/feature/explorer-api-delegations Explorer-api: add API resource to show the delegations for each mix node commit cba3625394dae3f736dab23018df5fcc3c9a4f5d Author: Mark Sinclair Date: Mon Sep 13 10:33:41 2021 +0100 explorer-api: add API resource to show the delegations for each mix node commit e1ddaff04d5077969dd0dbb1e645653035aa8e23 Merge: 0b9c03ca 66ab5de4 Author: Fouad Date: Fri Sep 10 17:17:14 2021 +0100 Merge pull request #772 from nymtech/update/disable-bonding add app alert commit 66ab5de442de91a50556117b62ef028b6b249f6f Author: fmtabbara Date: Fri Sep 10 16:16:58 2021 +0100 add app alert commit 0b9c03ca900a834856efa37706dafac7685b5f79 Author: Dave Hrycyszyn Date: Fri Sep 10 11:23:21 2021 +0300 Adding deps for building the Tauri wallet under Ubuntu (#770) commit c9dce0c1da29a99b1c483009a0658b2236c3a4e8 Author: Bogdan-Ștefan Neacşu Date: Thu Sep 9 11:21:45 2021 +0200 Feature/consumable bandwidth (#766) * Set actual value for bandwidth Also put it as a public attribute, such that it can be actively used by the credential consumer * Switch from sending Attribute structs to sending the actual attribute bytes over the wire * Add atomic bandwidth value to gateway * Consume bandwidth based on the mix packet size * Use Bandwidth struct for specific functionality * Move bandwidth code outside the dependency path of wasm client * Use u64 instead of AtomicU64, as the handling is not parallel commit e00e77db15c2c18699c58bf771940c16f63a610f Author: Bogdan-Ștefan Neacşu Date: Wed Sep 8 15:07:24 2021 +0200 Feature/bond blockstamp (#760) * Add block_height to MixNode/GatewayBond * Reward based on blockstamp of bonded node or of delegation * Add specific tests * Add migration code * Apply doc nit commit 1074449f91a1978e2d03f190c5854ae162bae907 Merge: 08276e6e 9a3d824a Author: Fouad Date: Tue Sep 7 23:45:10 2021 +0100 Merge pull request #767 from nymtech/update/remove-app-alert remove alert commit 08276e6e427679f1b437e370a66dd1140631b429 Author: Bogdan-Ștefan Neacşu Date: Tue Sep 7 16:33:30 2021 +0200 Remove migration code (#759) commit 9a3d824a4a451d4906219607f4a7bcd27dbbeba4 Author: fmtabbara Date: Mon Sep 6 20:39:24 2021 +0100 remove alert commit 2789ee8f18768bf7fd9b26a63ee928b286996049 Author: Bogdan-Ștefan Neacşu Date: Fri Sep 3 15:30:45 2021 +0300 Update coconut-rs and use hash_to_scalar from there (#765) Failed tests are due to some nightly issue, not related to this PR commit a7ba643c354da7ec40ecfb1b0fcae46b9f57f0e2 Merge: 28be53ee c42f3c68 Author: Fouad Date: Fri Sep 3 09:14:50 2021 +0100 Merge pull request #762 from nymtech/feature/app-alert add app alert banner commit 28be53eefb9a1a6950b0b84e8117c6829df93c37 Author: Bogdan-Ștefan Neacşu Date: Thu Sep 2 18:26:40 2021 +0300 Add block_height in the Delegation structure as well (#757) commit 219c45a352584ab7f9efb957107a671a4e19d13e Author: Jędrzej Stuczyński Date: Thu Sep 2 15:48:29 2021 +0100 Updated cosmos-sdk (#761) * Updated cosmos-sdk * Re-exposing more things commit 1a3b83752e0f5e4eed5515ba0b90f3551c1f0a81 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Sep 2 15:45:56 2021 +0100 Bump next from 11.1.0 to 11.1.1 in /wallet-web (#758) Bumps [next](https://github.com/vercel/next.js) from 11.1.0 to 11.1.1. - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v11.1.0...v11.1.1) --- updated-dependencies: - dependency-name: next dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit c42f3c684425d0e718ca55adacbe5afa99502603 Author: fmtabbara Date: Thu Sep 2 12:29:47 2021 +0100 add app alert banner commit a5d3ba390029818fcaa7c640a0c6eb6ec7916a96 Merge: 92e13a5d cdf0d443 Author: Mark Sinclair Date: Tue Aug 31 15:59:11 2021 +0100 Merge pull request #755 from nymtech/bugfix/explorer-api-ping Explorer API: port test now split out address resolution and add units tests commit cdf0d443411618e0952c35bfb5972fc82023cdfa Author: Mark Sinclair Date: Tue Aug 31 14:37:28 2021 +0100 explorer-api: turned down logging from `error` to `warn` commit 92f976a45d2d05c1250d6351392a3acc4eb1c01f Author: Mark Sinclair Date: Fri Aug 27 11:34:21 2021 +0100 explorer-api: sanitize hostname before running checks to avoid leading or trailing spaces that are known to exist in the current test net commit 2bc858cde351cb299c8986fd1045da6d832acbdb Author: Mark Sinclair Date: Fri Aug 27 09:32:26 2021 +0100 explorer-api: port test: split out address resolution and add units tests commit 92e13a5d005d3093717c77332cb5837cec4cfd34 Author: Bogdan-Ștefan Neacşu Date: Tue Aug 31 14:51:15 2021 +0300 Feature/add blockstamp (#756) * Add RawDelegationData * Fix current tests for the new stored data * Added migration commit. Will be reverted after doing the migration * New tests for block height * Use current blockstamp instead of 24h old one * Put _alot_ of migration stuff in the migrate function scope commit 122f5d9f2e5c1ced96e3b9ba0c74ef8b7dbde2c7 Author: Bogdan-Ștefan Neacşu Date: Mon Aug 30 10:27:20 2021 +0300 Feature/cred after handshake (#745) * Call perform_initial_authentication instead of register in clients * Refactor the register/authenticate functions a bit * Introduce Bandwidth request type * Add encryption layer to cred * Remove cred pass and check from handshake * Replaced unreachable! with error * Changed decrypt_tagged signature to not take mutable ownership of data * Put handle_bandwidth work inside a function * Add check before unwrap * Remove unnecessary async * Decouple bandwidth credential from authentication * Use new_error for ServerResponse:Error * Send a fresh IV each time the BandwidthCredential request is sent * Remove unwrap of bincode::serialize * Add comment regarding Bandwidth response * Remove _mut from naming * Leave Debug trait alone, as the initial error doesn't reproduce anymore * Pass iv as Vec instead of base58 string * Renamed AuthenticationIV to IV, as it is now used for more the just authentication * Did some IV refactorization commit 982ee0266c92628909ea0b5691b2abd31950f084 Author: Bogdan-Ștefan Neacşu Date: Fri Aug 27 16:02:34 2021 +0300 Feature/get own delegations (#748) * Introduce reverse delegation bucket * Add client command * Fix clippy error * Added tests in queries * Add tests in transactions * Migration code. Will be reverted after it's called on testnet * Replace unwrap with expect * Move some test code in the right file... ... to remove unnecessary auxiliary function. * Reduce the scope to migration auxiliary functions * Rename everything from [node]reverse to reverse[node] * Fix fmt commit 5f42a9bd052aebc496d639be4cb2aeadc4a575cb Author: Jędrzej Stuczyński Date: Fri Aug 27 13:52:18 2021 +0100 NetworkMonitorBuilder - starting the monitor after rocket has launched (#754) * NetworkMonitorBuilder - starting the monitor after rocket has launched * Removed unused import commit 1811df9ddb696279e2fc4cb58eeb9df55f2b1843 Author: Jędrzej Stuczyński Date: Fri Aug 27 13:52:10 2021 +0100 Enabled validators api argument (#753) commit 6bdfe7f8954177240894945dee86926eb3df08ab Author: Jędrzej Stuczyński Date: Thu Aug 26 11:21:01 2021 +0100 Correctly bounding nominator of uptime calculation (#752) commit c6b286a1dba0dd1a1a1df021cc4e8e45873eed15 Author: Jędrzej Stuczyński Date: Wed Aug 25 14:50:57 2021 +0100 Fixed argument parsing for ipv6 'good' topology (#751) commit b3568a26f57faaffe7b8d20ab90cb4cb456eae5e Author: Bogdan-Ștefan Neacşu Date: Tue Aug 24 11:25:05 2021 +0300 Revert "Migration commit, will be reverted after the testnet contract is updated" (#749) This reverts commit 38d868bcce3738c00d0f60bbc40373efd3cf7c6e. commit 15ae0f521e46336c0e8518e9b749dde9d702077a Author: Jędrzej Stuczyński Date: Mon Aug 23 10:26:51 2021 +0100 Feature/more reliable uptime calculation (#747) * New database table holding monitor run info * SQL interface for new table * Updated uptime calculation to instead rely on number of monitor test runs commit 2923d4b8725f04a0097461852862cf348b0998da Author: Bogdan-Ștefan Neacşu Date: Thu Aug 19 22:03:07 2021 +0300 Update template toml key (#746) --- tauri-wallet/src-tauri/src/coin.rs | 48 +++++++++++++++--------------- tauri-wallet/src-tauri/src/main.rs | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tauri-wallet/src-tauri/src/coin.rs b/tauri-wallet/src-tauri/src/coin.rs index 11a365f6b8..3b035768e7 100644 --- a/tauri-wallet/src-tauri/src/coin.rs +++ b/tauri-wallet/src-tauri/src/coin.rs @@ -11,7 +11,7 @@ use std::fmt; use std::ops::{Add, Sub}; use std::str::FromStr; use ts_rs::TS; -use validator_client::nymd::{GasPrice, CosmosCoin}; +use validator_client::nymd::{CosmosCoin, GasPrice}; use crate::format_err; @@ -96,25 +96,25 @@ impl Add for Coin { // Allows adding minor and major denominations, output will have the LHS denom. impl Sub for Coin { - type Output = Self; - - fn sub(self, rhs: Self) -> Self { - let denom = self.denom.clone(); - let lhs = self.to_minor(); - let rhs = rhs.to_minor(); - let lhs_amount = lhs.amount.parse::().unwrap(); - let rhs_amount = rhs.amount.parse::().unwrap(); - let amount = lhs_amount - rhs_amount; - let coin = Coin { - amount: amount.to_string(), - denom: Denom::Minor, - }; - match denom { - Denom::Major => coin.to_major(), - Denom::Minor => coin, - } + type Output = Self; + + fn sub(self, rhs: Self) -> Self { + let denom = self.denom.clone(); + let lhs = self.to_minor(); + let rhs = rhs.to_minor(); + let lhs_amount = lhs.amount.parse::().unwrap(); + let rhs_amount = rhs.amount.parse::().unwrap(); + let amount = lhs_amount - rhs_amount; + let coin = Coin { + amount: amount.to_string(), + denom: Denom::Minor, + }; + match denom { + Denom::Major => coin.to_major(), + Denom::Minor => coin, } } +} impl Coin { pub fn major(amount: T) -> Coin { @@ -273,7 +273,7 @@ mod test { "1000000000000000", "10000000000000000", "100000000000000000", - "1000000000000000000" + "1000000000000000000", ] } @@ -333,10 +333,10 @@ mod test { #[test] fn test_add() { - assert_eq!(Coin::minor("1") + Coin::minor("1"), Coin::minor("2")); - assert_eq!(Coin::major("1") + Coin::major("1"), Coin::major("2")); - assert_eq!(Coin::minor("1") + Coin::major("1"), Coin::minor("1000001")); - assert_eq!(Coin::major("1") + Coin::minor("1"), Coin::major("1.000001")); + assert_eq!(Coin::minor("1") + Coin::minor("1"), Coin::minor("2")); + assert_eq!(Coin::major("1") + Coin::major("1"), Coin::major("2")); + assert_eq!(Coin::minor("1") + Coin::major("1"), Coin::minor("1000001")); + assert_eq!(Coin::major("1") + Coin::minor("1"), Coin::major("1.000001")); } #[test] @@ -345,5 +345,5 @@ mod test { assert_eq!(Coin::major("1") - Coin::major("1"), Coin::major("0")); assert_eq!(Coin::minor("1") - Coin::major("1"), Coin::minor("-999999")); assert_eq!(Coin::major("1") - Coin::minor("1"), Coin::major("0.999999")); -} + } } diff --git a/tauri-wallet/src-tauri/src/main.rs b/tauri-wallet/src-tauri/src/main.rs index d1b201d33c..ee4e20f5f2 100644 --- a/tauri-wallet/src-tauri/src/main.rs +++ b/tauri-wallet/src-tauri/src/main.rs @@ -16,7 +16,7 @@ use tendermint_rpc::endpoint::broadcast::tx_commit::Response; use tokio::sync::RwLock; use ts_rs::{export, TS}; use validator_client::nymd::fee_helpers::Operation; -use validator_client::nymd::{NymdClient, SigningNymdClient, AccountId, CosmosCoin}; +use validator_client::nymd::{AccountId, CosmosCoin, NymdClient, SigningNymdClient}; mod coin; mod config;