Enable Loading Bids And Asks Via External Packages (#121)

This commit is contained in:
bonedaddy 2021-06-29 14:33:59 -07:00 committed by GitHub
parent 576e5d2ef2
commit 1f6d586701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -259,7 +259,7 @@ impl MarketState {
Ok(open_orders)
}
fn load_bids_mut<'a>(&self, bids: &'a AccountInfo) -> DexResult<RefMut<'a, Slab>> {
pub fn load_bids_mut<'a>(&self, bids: &'a AccountInfo) -> DexResult<RefMut<'a, Slab>> {
check_assert_eq!(&bids.key.to_aligned_bytes(), &identity(self.bids))
.map_err(|_| DexErrorCode::WrongBidsAccount)?;
let (header, buf) = strip_header::<OrderBookStateHeader, u8>(bids, false)?;
@ -268,7 +268,7 @@ impl MarketState {
Ok(RefMut::map(buf, Slab::new))
}
fn load_asks_mut<'a>(&self, asks: &'a AccountInfo) -> DexResult<RefMut<'a, Slab>> {
pub fn load_asks_mut<'a>(&self, asks: &'a AccountInfo) -> DexResult<RefMut<'a, Slab>> {
check_assert_eq!(&asks.key.to_aligned_bytes(), &identity(self.asks))
.map_err(|_| DexErrorCode::WrongAsksAccount)?;
let (header, buf) = strip_header::<OrderBookStateHeader, u8>(asks, false)?;