Skip to content

Commit

Permalink
[fix] hotfix for commands positions
Browse files Browse the repository at this point in the history
Signed-off-by: alexstroke <111361420+astrokov7@users.noreply.github.com>
Signed-off-by: Stukalov-A-M <stukalov07@gmail.com>
  • Loading branch information
alexstroke authored and Stukalov-A-M committed Feb 22, 2024
1 parent d0bf9ee commit 7f21163
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
4 changes: 2 additions & 2 deletions client/tests/integration/multisignature_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn multisignature_transactions_should_be_accepted_after_fully_signed() -> Result
let client = Client::new(client_config.clone());
let instructions = [mint_asset.clone()];
let transaction = client.build_transaction(instructions, UnlimitedMetadata::new());
//The tx signed by the first account
// The tx signed by the first account
let _ = client
.submit_transaction(&client.sign_transaction(transaction.clone()))
.expect_err("Transaction should not be added into the queue");
Expand All @@ -82,7 +82,7 @@ fn multisignature_transactions_should_be_accepted_after_fully_signed() -> Result

client_config.key_pair = key_pair_2;
let client_2 = Client::new(client_config);
//The tx signed by the second account
// The tx signed by the second account
client_2.submit_transaction(&client_2.sign_transaction(transaction))?;

thread::sleep(pipeline_time);
Expand Down
2 changes: 1 addition & 1 deletion client_cli/pytests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The variables:
```shell
CLIENT_CLI_BINARY=/path/to/iroha_client_cli
CLIENT_CLI_CONFIG=/path/to/config.toml
CLIENT_CLI_CONFIG=/path/to/client.toml
TORII_API_PORT_MIN=8080
TORII_API_PORT_MAX=8083
```
Expand Down
6 changes: 3 additions & 3 deletions client_cli/pytests/src/client_cli/client_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def domain(self, domain: str):
:return: The current ClientCli object.
:rtype: ClientCli
"""
self.command.insert(3, "domain")
self.command.insert(2, "domain")
self.command.append("--id=" + domain)
self.execute()
return self
Expand All @@ -147,7 +147,7 @@ def account(self, account: str, domain: str, key: str):
:return: The current ClientCli object.
:rtype: ClientCli
"""
self.command.insert(3, "account")
self.command.insert(2, "account")
self.command.append("--id=" + account + "@" + domain)
self.command.append("--key=ed0120" + key)
self.execute()
Expand All @@ -166,7 +166,7 @@ def asset(self, asset_definition=None, account=None, value_of_value_type=None):
:return: The current ClientCli object.
:rtype: ClientCli
"""
self.command.insert(3, "asset")
self.command.insert(2, "asset")
if asset_definition and account and value_of_value_type:
self.command.append(
"--asset-id="
Expand Down
4 changes: 4 additions & 0 deletions client_cli/pytests/src/client_cli/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def load(self, path_config_client_cli):
"""
if not os.path.exists(path_config_client_cli):
raise IOError(f"No config file found at {path_config_client_cli}")

if not os.path.isfile(path_config_client_cli):
raise IOError(f"The path is not a file: {path_config_client_cli}")

with open(path_config_client_cli, "r", encoding="utf-8") as config_file:
self._config = tomlkit.load(config_file)
self.file = path_config_client_cli
Expand Down
2 changes: 1 addition & 1 deletion client_cli/pytests/src/client_cli/iroha.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _execute_command(self, command_name: str):
:param command_name: The name of the command to execute.
:type command_name: str
"""
self.command.insert(3, command_name)
self.command.insert(2, command_name)
self.execute()

def should(self, *args, **kwargs):
Expand Down
20 changes: 3 additions & 17 deletions core/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub enum Error {
InBlockchain,
/// User reached maximum number of transactions in the queue
MaximumTransactionsPerUser,
/// The transaction is in the queue
/// The transaction is already in the queue
IsInQueue,
/// Failure during signature condition execution
SignatureCondition,
Expand Down Expand Up @@ -513,7 +513,7 @@ mod tests {
AcceptedTransaction::accept(signed_tx, &chain_id, &tx_limits)
.expect("Failed to accept Transaction.")
};
// Check that fully signed transaction pass signature check
// Check that fully signed transaction passes signature check
assert!(matches!(
fully_signed_tx.check_signature_condition(&wsv),
MustUse(true)
Expand All @@ -525,7 +525,7 @@ mod tests {
};
for key_pair in key_pairs {
let partially_signed_tx: AcceptedTransaction = get_tx(key_pair);
// Check that none of partially signed txs does not pass signature check
// Check that none of partially signed txs passes signature check
assert_eq!(
partially_signed_tx.check_signature_condition(&wsv),
MustUse(false)
Expand All @@ -535,20 +535,6 @@ mod tests {
Error::SignatureCondition
))
}
/*
// Check that transactions combined into one instead of duplicating
assert_eq!(queue.tx_len(), 1);
let mut available = queue.collect_transactions_for_block(&wsv, max_txs_in_block);
assert_eq!(available.len(), 1);
let tx_from_queue = available.pop().expect("Checked that have one transactions");
// Check that transaction from queue pass signature check
assert!(matches!(
tx_from_queue.check_signature_condition(&wsv),
MustUse(true)
));
*/
}

#[test]
Expand Down

0 comments on commit 7f21163

Please sign in to comment.