Skip to content

Commit

Permalink
Added getters for addresses
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Baltariu <[email protected]>
  • Loading branch information
andreiblt1304 committed Oct 18, 2024
1 parent 1fefe88 commit f11d6b4
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions esdt-safe/interactor/src/interactor_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ impl State {
.as_ref()
.expect("no known contract, deploy first")
}

pub fn get_header_verifier_address(&self) -> Address {
self.header_verifier_address.clone().unwrap().to_address()
}

pub fn get_fee_market_address(&self) -> Address {
self.fee_market_address.clone().unwrap().to_address()
}
}

impl Drop for State {
Expand Down Expand Up @@ -920,7 +928,7 @@ impl ContractInteract {
println!("Result: {response:?}");
}

async fn setup_operation(&mut self) -> Operation<StaticApi> {
async fn setup_operation(&mut self, has_transfer_data: bool) -> Operation<StaticApi> {

Check warning on line 931 in esdt-safe/interactor/src/interactor_main.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unused variable: `has_transfer_data`

Check warning on line 931 in esdt-safe/interactor/src/interactor_main.rs

View workflow job for this annotation

GitHub Actions / Contracts / Test Coverage

unused variable: `has_transfer_data`

Check warning on line 931 in esdt-safe/interactor/src/interactor_main.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused variable: `has_transfer_data`

Check warning on line 931 in esdt-safe/interactor/src/interactor_main.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] esdt-safe/interactor/src/interactor_main.rs#L931

warning: unused variable: `has_transfer_data` --> esdt-safe/interactor/src/interactor_main.rs:931:41 | 931 | async fn setup_operation(&mut self, has_transfer_data: bool) -> Operation<StaticApi> { | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_transfer_data` | = note: `#[warn(unused_variables)]` on by default
Raw output
esdt-safe/interactor/src/interactor_main.rs:931:41:w:warning: unused variable: `has_transfer_data`
   --> esdt-safe/interactor/src/interactor_main.rs:931:41
    |
931 |     async fn setup_operation(&mut self, has_transfer_data: bool) -> Operation<StaticApi> {
    |                                         ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_transfer_data`
    |
    = note: `#[warn(unused_variables)]` on by default


__END__

Check warning on line 931 in esdt-safe/interactor/src/interactor_main.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] esdt-safe/interactor/src/interactor_main.rs#L931

warning: unused variable: `has_transfer_data` --> esdt-safe/interactor/src/interactor_main.rs:931:41 | 931 | async fn setup_operation(&mut self, has_transfer_data: bool) -> Operation<StaticApi> { | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_transfer_data` | = note: `#[warn(unused_variables)]` on by default
Raw output
esdt-safe/interactor/src/interactor_main.rs:931:41:w:warning: unused variable: `has_transfer_data`
   --> esdt-safe/interactor/src/interactor_main.rs:931:41
    |
931 |     async fn setup_operation(&mut self, has_transfer_data: bool) -> Operation<StaticApi> {
    |                                         ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_transfer_data`
    |
    = note: `#[warn(unused_variables)]` on by default


__END__
let to = managed_address!(&self.state.fee_market_address.clone().unwrap().to_address());
let payments_tuple = self.setup_payments().await;
let (tokens, data) = payments_tuple;
Expand All @@ -941,25 +949,25 @@ impl ContractInteract {

managed_operation_hashes.push(managed_operation_hash);

if let Some(header_verifier_address) = self.state.header_verifier_address.clone() {
let response = self
.interactor
.tx()
.from(&self.wallet_address)
.to(header_verifier_address)
.typed(header_verifier_proxy::HeaderverifierProxy)
.register_bridge_operations(
bls_signature,
managed_hash_of_hashes,
managed_operation_hashes,
)
.returns(ReturnsResult)
.prepare_async()
.run()
.await;

println!("Result: {response:?}");
}
let header_verifier_address = self.state.get_header_verifier_address();

let response = self
.interactor
.tx()
.from(&self.wallet_address)
.to(header_verifier_address)
.typed(header_verifier_proxy::HeaderverifierProxy)
.register_bridge_operations(
bls_signature,
managed_hash_of_hashes,
managed_operation_hashes,
)
.returns(ReturnsResult)
.prepare_async()
.run()
.await;

println!("Result: {response:?}");
}

async fn setup_payments(
Expand Down

0 comments on commit f11d6b4

Please sign in to comment.