Skip to content

Commit

Permalink
Remove aggregator_proxy.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Jul 10, 2024
1 parent 40e4fb5 commit fa09d92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 46 deletions.
41 changes: 0 additions & 41 deletions common/fee-estimator-module/src/aggregator_proxy.rs

This file was deleted.

21 changes: 16 additions & 5 deletions common/fee-estimator-module/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#![no_std]

use multiversx_sc::imports::*;

mod aggregator_proxy;
pub use aggregator_proxy::*;
mod price_aggregator_proxy;

pub const GWEI_STRING: &[u8] = b"GWEI";

#[multiversx_sc::module]
pub trait FeeEstimatorModule {
#[only_owner]
Expand Down Expand Up @@ -68,7 +67,19 @@ pub trait FeeEstimatorModule {
let from_ticker = self.token_ticker(from).get();
let to_ticker = self.token_ticker(to).get();

let result: OptionalValue<AggregatorResultAsMultiValue<Self::Api>> = self
// let result: OptionalValue<AggregatorResultAsMultiValue<Self::Api>> = self
// .tx()
// .to(fee_estimator_sc_address)
// .typed(price_aggregator_proxy::PriceAggregatorProxy)
// .latest_price_feed_optional(from_ticker, to_ticker)
// .returns(ReturnsResult)
// .sync_call();

// result
// .into_option()
// .map(|multi_result| AggregatorResult::from(multi_result).price)

let result = self
.tx()
.to(fee_estimator_sc_address)
.typed(price_aggregator_proxy::PriceAggregatorProxy)
Expand All @@ -78,7 +89,7 @@ pub trait FeeEstimatorModule {

result
.into_option()
.map(|multi_result| AggregatorResult::from(multi_result).price)
.map(|multi_result| multi_result.into_tuple().4)
}

// storage
Expand Down

0 comments on commit fa09d92

Please sign in to comment.