Skip to content

Commit

Permalink
set round in event in stead of epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
alyn509 committed Oct 4, 2024
1 parent 8a11626 commit 5517ef0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions contracts/core/price-aggregator/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ pub trait EventsModule {
&self,
#[indexed] from: &ManagedBuffer,
#[indexed] to: &ManagedBuffer,
#[indexed] epoch: u64,
#[indexed] round: u64,
);

#[event("add_submission")]
fn add_submission_event(
&self,
#[indexed] caller: &ManagedAddress,
#[indexed] price: &BigUint,
#[indexed] epoch: u64,
#[indexed] round: u64,
);
}
8 changes: 4 additions & 4 deletions contracts/core/price-aggregator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ pub trait PriceAggregator:
last_sub_time_mapper.set(current_timestamp);

self.create_new_round(token_pair, submissions, decimals);
let epoch = self.blockchain().get_block_epoch();
self.add_submission_event(&caller, &price, epoch);
let round = self.blockchain().get_block_round();
self.add_submission_event(&caller, &price, round);
}

self.oracle_status()
Expand Down Expand Up @@ -285,8 +285,8 @@ pub trait PriceAggregator:
.push(&price_feed);
self.emit_new_round_event(&token_pair, &price_feed);
} else {
let epoch = self.blockchain().get_block_epoch();
self.discard_round_event(&token_pair.from.clone(), &token_pair.to.clone(), epoch);
let round = self.blockchain().get_block_round();
self.discard_round_event(&token_pair.from.clone(), &token_pair.to.clone(), round);
}
}

Expand Down

0 comments on commit 5517ef0

Please sign in to comment.