Allowing optional fee for top-level NymdClient (#1541)

* Allowing optional fee for top-level NymdClient

* Updated changelog

* Fixed usages of said methods in validator-api
This commit is contained in:
Jędrzej Stuczyński
2022-08-17 13:27:53 +01:00
committed by GitHub
parent 728b0f4549
commit d96b7408db
3 changed files with 15 additions and 5 deletions
+9
View File
@@ -2,6 +2,15 @@
Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- validator-client: made `fee` argument optional for `execute` and `execute_multiple` ([#1541])
[#1541]: https://github.com/nymtech/nym/pull/1541
## [nym-binaries-1.0.2](https://github.com/nymtech/nym/tree/nym-binaries-1.0.2)
### Added
@@ -893,7 +893,7 @@ impl<C> NymdClient<C> {
&self,
contract_address: &AccountId,
msg: &M,
fee: Fee,
fee: Option<Fee>,
memo: impl Into<String> + Send + 'static,
funds: Vec<Coin>,
) -> Result<ExecuteResult, NymdError>
@@ -901,6 +901,7 @@ impl<C> NymdClient<C> {
C: SigningCosmWasmClient + Sync,
M: ?Sized + Serialize + Sync,
{
let fee = fee.unwrap_or(Fee::Auto(Some(self.simulated_gas_multiplier)));
self.client
.execute(self.address(), contract_address, msg, fee, memo, funds)
.await
@@ -910,7 +911,7 @@ impl<C> NymdClient<C> {
&self,
contract_address: &AccountId,
msgs: I,
fee: Fee,
fee: Option<Fee>,
memo: impl Into<String> + Send + 'static,
) -> Result<ExecuteResult, NymdError>
where
@@ -918,6 +919,7 @@ impl<C> NymdClient<C> {
I: IntoIterator<Item = (M, Vec<Coin>)> + Send,
M: Serialize,
{
let fee = fee.unwrap_or(Fee::Auto(Some(self.simulated_gas_multiplier)));
self.client
.execute_multiple(self.address(), contract_address, msgs, fee, memo)
.await
+2 -3
View File
@@ -364,15 +364,14 @@ impl<C> Client<C> {
let memo = "Performing epoch operations".to_string();
self.execute_multiple_with_retry(msgs, Default::default(), memo)
.await?;
self.execute_multiple_with_retry(msgs, None, memo).await?;
Ok(())
}
async fn execute_multiple_with_retry<M>(
&self,
msgs: Vec<(M, Vec<Coin>)>,
fee: Fee,
fee: Option<Fee>,
memo: String,
) -> Result<(), RewardingError>
where