Skip to content

Commit

Permalink
Add pot accounts to checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauthamastro committed Mar 21, 2024
1 parent 6642502 commit 103f435
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pallets/ocex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1889,12 +1889,15 @@ pub mod pallet {
/// Fetch checkpoint for recovery
pub fn fetch_checkpoint() -> Result<ObCheckpointRaw, DispatchError> {
log::debug!(target:"ocex", "fetch_checkpoint called");
let account_ids =
let mut account_ids =
<Accounts<T>>::iter().fold(vec![], |mut ids_accum, (acc, acc_info)| {
ids_accum.push((acc.clone(), acc_info.proxies));
ids_accum
});

// Add pot account to it
account_ids.push((Self::get_pot_account(), Default::default()));

let mut balances: BTreeMap<AccountAsset, Decimal> = BTreeMap::new();
let mut q_scores_uptime_map = BTreeMap::new();
let mut maker_volume_map = BTreeMap::new();
Expand Down
1 change: 1 addition & 0 deletions pallets/ocex/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ impl<T: Config> Pallet<T> {
)?;
}

// Restore total maker volume
for ((epoch, pair), total_maker_volume) in &checkpoint.total_maker_volume_map {
crate::lmp::update_total_maker_volume(state, *epoch, *pair, *total_maker_volume)?;
}
Expand Down
2 changes: 1 addition & 1 deletion runtimes/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 337,
spec_version: 338,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion scripts/get_balance_rpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ curl -H "Content-Type: application/json" -d '{
"jsonrpc":"2.0",
"id":1,
"method":"ob_getBalance",
"params":["esntiQCvLG55kFN3cqJjQoA1VeBrx9oiorDobuejDta7xcokf",{"asset":"3496813586714279103986568049643838918"}]
"params":["esr4dJBv5123tkiA3beRZ3TrHbppJ6PdPxo2xHN4rmZJGDQJo",{"asset":"3496813586714279103986568049643838918"}]
}' http://localhost:9944

0 comments on commit 103f435

Please sign in to comment.