forked from hyperledger-iroha/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.
[feature] hyperledger-iroha#3900:
fetch_size
query parameter
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
- Loading branch information
Showing
23 changed files
with
247 additions
and
113 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,3 +1,29 @@ | ||
use iroha_client::client::{self, ClientQueryError}; | ||
use iroha_data_model::{ | ||
query::{error::QueryExecutionFail, FetchSize, MAX_FETCH_SIZE}, | ||
ValidationFail, | ||
}; | ||
use test_network::*; | ||
|
||
mod account; | ||
mod asset; | ||
mod role; | ||
|
||
#[test] | ||
fn too_big_fetch_size_is_not_allowed() { | ||
let (_rt, _peer, client) = <PeerBuilder>::new().with_port(11_130).start_with_runtime(); | ||
wait_for_genesis_committed(&[client.clone()], 0); | ||
|
||
let err = client | ||
.build_query(client::asset::all()) | ||
.with_fetch_size(FetchSize::new(Some(MAX_FETCH_SIZE.checked_add(1).unwrap()))) | ||
.execute() | ||
.expect_err("Should fail"); | ||
|
||
assert!(matches!( | ||
err, | ||
ClientQueryError::Validation(ValidationFail::QueryFailed( | ||
QueryExecutionFail::FetchSizeTooBig | ||
)) | ||
)); | ||
} |
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
Oops, something went wrong.