Skip to content

Commit

Permalink
dex(state_key): fix prefix length in prefix_with_asset
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Jan 28, 2025
1 parent 3b92361 commit 13dfa45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core/component/dex/src/state_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ pub mod lqt {
format!("dex/lqt/v1/lp/by_volume/{epoch_index:020}/")
}

pub fn prefix_with_asset(epoch_index: u64, asset: &asset::Id) -> [u8; 74] {
pub fn prefix_with_asset(epoch_index: u64, asset: &asset::Id) -> [u8; 77] {
let prefix = prefix(epoch_index);
let mut key = [0u8; 74];
key[0..42].copy_from_slice(prefix.as_bytes());
key[42..42 + 32].copy_from_slice(&asset.to_bytes());
let mut key = [0u8; 77];
key[0..45].copy_from_slice(prefix.as_bytes());
key[45..45 + 32].copy_from_slice(&asset.to_bytes());
key
}

Expand Down

0 comments on commit 13dfa45

Please sign in to comment.