Skip to content

Commit

Permalink
sc round
Browse files Browse the repository at this point in the history
  • Loading branch information
alyn509 committed Oct 4, 2024
1 parent 5517ef0 commit 075bfbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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] round: u64,
#[indexed] round: usize,
);

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

self.create_new_round(token_pair, submissions, decimals);
let round = self.blockchain().get_block_round();
self.add_submission_event(&caller, &price, round);
self.create_new_round(token_pair.clone(), submissions, decimals);
let round_id = self.rounds().get(&token_pair).unwrap().len();
self.add_submission_event(&caller, &price, round_id);
}

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 round = self.blockchain().get_block_round();
self.discard_round_event(&token_pair.from.clone(), &token_pair.to.clone(), round);
let round_id = self.rounds().get(&token_pair).unwrap().len();
self.discard_round_event(&token_pair.from.clone(), &token_pair.to.clone(), round_id);
}
}

Expand Down

0 comments on commit 075bfbd

Please sign in to comment.