Skip to content

Commit

Permalink
Merge pull request #88 from SamHSmith/iroha2-dev
Browse files Browse the repository at this point in the history
Bring dev branch up to date.
  • Loading branch information
SamHSmith authored Oct 31, 2023
2 parents 445b60c + 8467394 commit 842065f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ url = "2.4.0"

[dependencies.iroha_client]
git = "https://github.com/hyperledger/iroha.git"
branch = "iroha2-stable-rc19"
version = "2.0.0-pre-rc.19"
branch = "iroha2-dev"
version = "2.0.0-pre-rc.20"

[dependencies.iroha_data_model]
git = "https://github.com/hyperledger/iroha.git"
branch = "iroha2-stable-rc19"
version = "2.0.0-pre-rc.19"
branch = "iroha2-dev"
version = "2.0.0-pre-rc.20"

[dependencies.iroha_config]
git = "https://github.com/hyperledger/iroha.git"
branch = "iroha2-stable-rc19"
version = "2.0.0-pre-rc.19"
branch = "iroha2-dev"
version = "2.0.0-pre-rc.20"

[dependencies.iroha_crypto]
git = "https://github.com/hyperledger/iroha.git"
branch = "iroha2-stable-rc19"
version = "2.0.0-pre-rc.19"
branch = "iroha2-dev"
version = "2.0.0-pre-rc.20"

[dependencies.iroha_primitives]
git = "https://github.com/hyperledger/iroha.git"
branch = "iroha2-stable-rc19"
version = "2.0.0-pre-rc.19"
branch = "iroha2-dev"
version = "2.0.0-pre-rc.20"
22 changes: 11 additions & 11 deletions src/async_client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ impl Client {
#[allow(dead_code)]
pub async fn submit(
&self,
instruction: impl Into<InstructionBox> + Debug,
instruction: impl Into<InstructionExpr> + Debug,
) -> Result<HashOf<TransactionPayload>> {
let isi = instruction.into();
self.submit_all([isi]).await
}

pub async fn submit_all(
&self,
instructions: impl IntoIterator<Item = InstructionBox>,
instructions: impl IntoIterator<Item = InstructionExpr>,
) -> Result<HashOf<TransactionPayload>> {
self.submit_all_with_metadata(instructions, UnlimitedMetadata::new())
.await
Expand All @@ -41,15 +41,15 @@ impl Client {
#[allow(dead_code)]
pub async fn submit_with_metadata(
&self,
instruction: InstructionBox,
instruction: InstructionExpr,
metadata: UnlimitedMetadata,
) -> Result<HashOf<TransactionPayload>> {
self.submit_all_with_metadata([instruction], metadata).await
}

pub async fn submit_all_with_metadata(
&self,
instructions: impl IntoIterator<Item = InstructionBox>,
instructions: impl IntoIterator<Item = InstructionExpr>,
metadata: UnlimitedMetadata,
) -> Result<HashOf<TransactionPayload>> {
self.submit_transaction(
Expand All @@ -61,30 +61,30 @@ impl Client {

pub async fn submit_transaction(
&self,
transaction: VersionedSignedTransaction,
transaction: SignedTransaction,
) -> Result<HashOf<TransactionPayload>> {
self.iroha_client.submit_transaction(&transaction)
}

#[allow(dead_code)]
pub async fn submit_blocking(
&self,
instruction: impl Into<InstructionBox>,
instruction: impl Into<InstructionExpr>,
) -> Result<SubmitBlockingStatus> {
self.submit_all_blocking(vec![instruction.into()]).await
}

pub async fn submit_all_blocking(
&self,
instructions: impl IntoIterator<Item = InstructionBox>,
instructions: impl IntoIterator<Item = InstructionExpr>,
) -> Result<SubmitBlockingStatus> {
self.submit_all_blocking_with_metadata(instructions, UnlimitedMetadata::new())
.await
}

pub async fn submit_all_blocking_with_metadata(
&self,
instructions: impl IntoIterator<Item = InstructionBox>,
instructions: impl IntoIterator<Item = InstructionExpr>,
metadata: UnlimitedMetadata,
) -> Result<SubmitBlockingStatus> {
let transaction = self
Expand All @@ -95,7 +95,7 @@ impl Client {

pub async fn submit_transaction_blocking(
&self,
transaction: VersionedSignedTransaction,
transaction: SignedTransaction,
) -> Result<SubmitBlockingStatus> {
let iroha_client = self.iroha_client.clone();
let (event_sender, mut event_receiver) = mpsc::unbounded_channel();
Expand All @@ -121,7 +121,7 @@ impl Client {
}
PipelineStatus::Committed => {
return event_sender
.send(SubmitBlockingStatus::Committed(hash.transmute()))
.send(SubmitBlockingStatus::Committed(hash))
.expect("Failed to send the transaction through event channel.")
}
}
Expand All @@ -146,7 +146,7 @@ impl Client {

#[derive(Debug)]
pub enum SubmitBlockingStatus {
Committed(HashOf<VersionedSignedTransaction>),
Committed(HashOf<SignedTransaction>),
Rejected(PipelineRejectionReason),
Unknown,
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use hyper::{
};
use iroha_client::client::Client;
use iroha_config::client::Configuration;
use iroha_data_model::{isi::InstructionBox, prelude::*};
use iroha_data_model::{isi::InstructionExpr, prelude::*};
use std::{
collections::HashMap,
fs::File,
Expand Down Expand Up @@ -233,7 +233,7 @@ fn submit_empty_transactions(
}
let start_time = Instant::now();
client
.submit_all(Vec::<InstructionBox>::new().into_iter())
.submit_all(Vec::<InstructionExpr>::new().into_iter())
.expect("Failed to submit empty ISI");
status
.write()
Expand Down
40 changes: 20 additions & 20 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn make_instruction_by_operation(
test_account_id: AccountId,
test_domain_id: DomainId,
index: usize,
) -> Vec<InstructionBox> {
) -> Vec<InstructionExpr> {
match op {
Operation::RegisterAccount => {
let new_account_name = Name::from_str(format!("alice{}", index).as_str())
Expand All @@ -22,13 +22,13 @@ fn make_instruction_by_operation(
let (public_key, _) = KeyPair::generate()
.expect("Failed to create a new key pair")
.into();
vec![RegisterBox::new(Account::new(new_account_id, [public_key])).into()]
vec![RegisterExpr::new(Account::new(new_account_id, [public_key])).into()]
}
Operation::RegisterDomain => {
let new_domain_name = Name::from_str(format!("wonderland{}", index).as_str())
.expect("Failed to create a new domain name");
let new_domain_id: DomainId = DomainId::new(new_domain_name);
vec![RegisterBox::new(Domain::new(new_domain_id)).into()]
vec![RegisterExpr::new(Domain::new(new_domain_id)).into()]
}
Operation::RegisterAssetQuantity => {
let new_asset_name = Name::from_str(format!("rose_quantity{}", index).as_str())
Expand All @@ -45,8 +45,8 @@ fn make_instruction_by_operation(
AssetValue::Quantity(random()),
);
vec![
RegisterBox::new(new_asset_definition).into(),
RegisterBox::new(new_asset).into(),
RegisterExpr::new(new_asset_definition).into(),
RegisterExpr::new(new_asset).into(),
]
}
Operation::RegisterAssetBigQuantity => {
Expand All @@ -64,8 +64,8 @@ fn make_instruction_by_operation(
AssetValue::BigQuantity(random()),
);
vec![
RegisterBox::new(new_asset_definition).into(),
RegisterBox::new(new_asset).into(),
RegisterExpr::new(new_asset_definition).into(),
RegisterExpr::new(new_asset).into(),
]
}
Operation::RegisterAssetFixed => {
Expand All @@ -82,8 +82,8 @@ fn make_instruction_by_operation(
AssetValue::Fixed(Fixed::try_from(random::<f64>()).expect("Valid fixed num")),
);
vec![
RegisterBox::new(new_asset_definition).into(),
RegisterBox::new(new_asset).into(),
RegisterExpr::new(new_asset_definition).into(),
RegisterExpr::new(new_asset).into(),
]
}
Operation::RegisterAssetStore => {
Expand All @@ -109,8 +109,8 @@ fn make_instruction_by_operation(
AssetValue::Store(store),
);
vec![
RegisterBox::new(new_asset_definition).into(),
RegisterBox::new(new_asset).into(),
RegisterExpr::new(new_asset_definition).into(),
RegisterExpr::new(new_asset).into(),
]
}
Operation::TransferAsset => {
Expand Down Expand Up @@ -144,11 +144,11 @@ fn make_instruction_by_operation(
Asset::new(new_recipient_asset_id.clone(), AssetValue::Quantity(0));

vec![
RegisterBox::new(new_asset_definition).into(),
RegisterBox::new(new_sender_asset).into(),
RegisterBox::new(new_recipient_account).into(),
RegisterBox::new(new_recipient_asset).into(),
TransferBox::new(
RegisterExpr::new(new_asset_definition).into(),
RegisterExpr::new(new_sender_asset).into(),
RegisterExpr::new(new_recipient_account).into(),
RegisterExpr::new(new_recipient_asset).into(),
TransferExpr::new(
IdBox::AssetId(new_sender_asset_id),
1_u32,
IdBox::AssetId(new_recipient_asset_id),
Expand Down Expand Up @@ -176,10 +176,10 @@ fn make_instruction_by_operation(
let new_account = Account::new(new_account_id, [public_key]);

vec![
RegisterBox::new(new_asset_definition).into(),
RegisterBox::new(new_asset).into(),
RegisterBox::new(new_account).into(),
MintBox::new(1_u32, IdBox::AssetId(new_asset_id)).into(),
RegisterExpr::new(new_asset_definition).into(),
RegisterExpr::new(new_asset).into(),
RegisterExpr::new(new_account).into(),
MintExpr::new(1_u32, IdBox::AssetId(new_asset_id)).into(),
]
}
}
Expand Down

0 comments on commit 842065f

Please sign in to comment.