Skip to content

Commit 6679944

Browse files
authored
Feature flag reward payments (#1154)
1 parent 592b3b3 commit 6679944

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

validator-api/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ cfg-if = "1.0"
6060

6161
[features]
6262
coconut = ["coconut-interface", "credentials", "gateway-client/coconut"]
63+
no-reward = []
6364

6465
[build-dependencies]
6566
tokio = { version = "1.4", features = ["rt-multi-thread", "macros"] }

validator-api/src/nymd_client.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,24 @@ impl<C> Client<C> {
365365
where
366366
C: SigningCosmWasmClient + Sync,
367367
{
368-
let msgs: Vec<(ExecuteMsg, _)> = nodes
368+
cfg_if::cfg_if! {
369+
if #[cfg(feature = "no-reward")] {
370+
Ok(vec![])
371+
} else {
372+
let msgs: Vec<(ExecuteMsg, _)> = nodes
369373
.iter()
370374
.map(|node| node.to_reward_execute_msg(interval_id))
371375
.zip(std::iter::repeat(Vec::new()))
372376
.collect();
373377

378+
Ok(msgs)
379+
}
380+
}
381+
374382
// let memo = format!("rewarding {} mixnodes", msgs.len());
375383

376384
// self.execute_multiple_with_retry(msgs, Default::default(), memo)
377385
// .await
378-
379-
Ok(msgs)
380386
}
381387

382388
async fn execute_multiple_with_retry<M>(

0 commit comments

Comments
 (0)