From c189090a6ba5f379a13035558253c8660b9c406e Mon Sep 17 00:00:00 2001 From: Aleksandr Karbyshev Date: Fri, 8 Mar 2024 02:00:40 +0100 Subject: [PATCH] Remove partial_application crate --- Cargo.lock | 7 ------- Cargo.toml | 1 - crates/sdk/src/wallet/mod.rs | 25 +++++++++++-------------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 101cdb62d8c..7f042d57363 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4609,7 +4609,6 @@ dependencies = [ "orion", "owo-colors", "parse_duration", - "partial_application", "paste", "proptest", "prost 0.12.3", @@ -5363,12 +5362,6 @@ dependencies = [ "regex", ] -[[package]] -name = "partial_application" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f926567968c32d22274b8eb721210363e54dcd8d2c960dd8533aa3be78143081" - [[package]] name = "password-hash" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index 79143ba559b..f969b263088 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -124,7 +124,6 @@ num-rational = "0.4.1" num-traits = "0.2.14" once_cell = "1.8.0" orion = "0.16.0" -partial_application = "0.2.1" paste = "1.0.9" pretty_assertions = "1.4.0" primitive-types = "0.12.1" diff --git a/crates/sdk/src/wallet/mod.rs b/crates/sdk/src/wallet/mod.rs index c591c170e66..4a6424949a8 100644 --- a/crates/sdk/src/wallet/mod.rs +++ b/crates/sdk/src/wallet/mod.rs @@ -17,7 +17,6 @@ use namada_core::key::*; use namada_core::masp::{ ExtendedSpendingKey, ExtendedViewingKey, PaymentAddress, }; -use partial_application::partial; pub use pre_genesis::gen_key_to_store; use rand::CryptoRng; use rand_core::RngCore; @@ -419,11 +418,9 @@ impl Wallet { address: Address, keys: ValidatorKeys, ) -> Result<(), LoadStoreError> { - self.utils.clone().update_store( - partial!(Store::add_validator_data => _, - address, - keys), - ) + self.utils + .clone() + .update_store(|store| store.add_validator_data(address, keys)) } /// XXX does not make sense in the current context -- REMOVE? @@ -451,13 +448,13 @@ impl Wallet { validator_alias: Alias, other: pre_genesis::ValidatorWallet, ) -> Result<(), LoadStoreError> { - self.utils.clone().update_store( - partial!(Store::extend_from_pre_genesis_validator => _, + self.utils.clone().update_store(|store| { + store.extend_from_pre_genesis_validator( validator_address, validator_alias, - other - ), - ) + other, + ) + }) } /// Gets all addresses given a vp_type @@ -477,9 +474,9 @@ impl Wallet { vp_type: AddressVpType, address: Address, ) -> Result<(), LoadStoreError> { - self.utils.clone().update_store( - partial!(Store::add_vp_type_to_address => _, vp_type, address), - ) + self.utils.clone().update_store(|store| { + store.add_vp_type_to_address(vp_type, address) + }) } /// Get addresses with tokens VP type keyed and ordered by their aliases.