forked from hyperledger/iroha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] hyperledger#2123: use Algorithm for storing digest function
Signed-off-by: Retssaze <Retssaze@GMail.Com>
- Loading branch information
Showing
41 changed files
with
2,426 additions
and
766 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#![allow(clippy::restriction)] | ||
|
||
use std::str::FromStr; | ||
|
||
use eyre::Result; | ||
use iroha_client::client; | ||
use iroha_data_model::prelude::*; | ||
use test_network::*; | ||
|
||
#[test] | ||
fn can_change_parameter_value() -> Result<()> { | ||
let (_rt, _peer, test_client) = <PeerBuilder>::new().with_port(10_800).start_with_runtime(); | ||
wait_for_genesis_committed(&vec![test_client.clone()], 0); | ||
|
||
let account_id: AccountId = "alice@wonderland".parse().expect("Valid"); | ||
let parameter = Parameter::from_str("?BlockSyncGossipPeriod=20000")?; | ||
let parameter_id = ParameterId::from_str("BlockSyncGossipPeriod")?; | ||
let param_box = SetParameterBox::new(parameter, account_id); | ||
|
||
let old_params = test_client.request(client::parameter::all())?; | ||
let param_val_old = old_params | ||
.iter() | ||
.find(|param| param.id() == ¶meter_id) | ||
.expect("Parameter should exist") | ||
.val(); | ||
|
||
test_client.submit_blocking(param_box)?; | ||
|
||
let new_params = test_client.request(client::parameter::all())?; | ||
|
||
let param_val_new = new_params | ||
.iter() | ||
.find(|param| param.id() == ¶meter_id) | ||
.expect("Parameter should exist") | ||
.val(); | ||
|
||
assert_ne!(param_val_old, param_val_new); | ||
Ok(()) | ||
} |
Oops, something went wrong.