Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Jan 19, 2024
1 parent 424c1c6 commit 130422d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions dan_layer/transaction/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Transaction {
}

/// Returns all substates addresses referenced by this transaction
pub fn to_referenced_substates(&self) -> Result<HashSet<SubstateAddress>, IndexedValueError> {
pub fn to_referenced_substates(&self) -> Result<HashSet<SubstateId>, IndexedValueError> {
let all_instructions = self.instructions().iter().chain(self.fee_instructions());

let mut substates = HashSet::new();
Expand All @@ -195,14 +195,14 @@ impl Transaction {
args,
..
} => {
substates.insert(SubstateAddress::Component(*component_address));
substates.insert(SubstateId::Component(*component_address));
for arg in args.iter().filter_map(|a| a.as_literal_bytes()) {
let value = IndexedValue::from_raw(arg)?;
substates.extend(value.referenced_substates());
}
},
Instruction::ClaimBurn { claim } => {
substates.insert(SubstateAddress::UnclaimedConfidentialOutput(claim.output_address));
substates.insert(SubstateId::UnclaimedConfidentialOutput(claim.output_address));
},
_ => {},
}
Expand Down
14 changes: 7 additions & 7 deletions utilities/tariswap_test_bench/src/tariswap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: BSD-3-Clause

use log::info;
use tari_dan_common_types::ShardId;
use tari_dan_common_types::SubstateAddress;
use tari_dan_wallet_sdk::{apis::key_manager::TRANSACTION_BRANCH, models::Account};
use tari_template_lib::{
args,
Expand Down Expand Up @@ -68,8 +68,8 @@ impl Runner {
let transaction = Transaction::builder()
.with_input_refs(vec![
// Use resources as input refs to allow concurrent access.
ShardId::from_address(&faucet.resource_address.into(), 0),
ShardId::from_address(&XTR2.into(), 0),
SubstateAddress::from_address(&faucet.resource_address.into(), 0),
SubstateAddress::from_address(&XTR2.into(), 0),
])
.fee_transaction_pay_from_component(account.address.as_component_address().unwrap(), Amount(1000))
.call_method(account.address.as_component_address().unwrap(), "withdraw", args![
Expand Down Expand Up @@ -123,8 +123,8 @@ impl Runner {
let transaction = Transaction::builder()
// Use resources as input refs to allow concurrent access.
.with_input_refs(vec![
ShardId::from_address(&faucet.resource_address.into(), 0),
ShardId::from_address(&XTR2.into(), 0),
SubstateAddress::from_address(&faucet.resource_address.into(), 0),
SubstateAddress::from_address(&XTR2.into(), 0),
])
.fee_transaction_pay_from_component(account.address.as_component_address().unwrap(), Amount(1000))
.call_method(tariswap.component_address, "get_pool_balance", args![ XTR2, ])
Expand Down Expand Up @@ -171,8 +171,8 @@ impl Runner {
let transaction = Transaction::builder()
// Use resources as input refs to allow concurrent access.
.with_input_refs(vec![
ShardId::from_address(&faucet.resource_address.into(), 0),
ShardId::from_address(&XTR2.into(), 0),
SubstateAddress::from_address(&faucet.resource_address.into(), 0),
SubstateAddress::from_address(&XTR2.into(), 0),
])
.fee_transaction_pay_from_component(account.address.as_component_address().unwrap(), Amount(1000))
.call_method(tariswap.component_address, "get_pool_balance", args![XTR2])
Expand Down

0 comments on commit 130422d

Please sign in to comment.