Skip to content

Commit

Permalink
fix function order in GetBytes trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred0327 committed Nov 2, 2023
1 parent 6630527 commit 71dbb38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions types/src/basic_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ basic_type!(
);

pub trait GetBytes {
/// the length of encoded bytes
fn bytes_len(&self) -> usize;

/// Encodes the data as the byte sequence.
fn get_bytes(&self) -> Vec<u8>;

Expand All @@ -109,6 +106,9 @@ pub trait GetBytes {
hash_input.resize(RESCUE_HASH_INPUT_BYTES, 0);
rescue_hash_orders(&hash_input)
}

/// the length of encoded bytes
fn bytes_len(&self) -> usize;
}

impl GetBytes for AccountId {
Expand Down
4 changes: 1 addition & 3 deletions types/src/contract/prices.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::basic_types::pad::pad_front;
use crate::basic_types::{GetBytes, PairId, TokenId};
use crate::params::{
CONTRACT_PRICE_BYTES, MARGIN_PRICE_BYTES, PRICE_BIT_WIDTH,
};
use crate::params::{CONTRACT_PRICE_BYTES, MARGIN_PRICE_BYTES, PRICE_BIT_WIDTH};
use crate::prelude::validator::*;
use num::BigUint;
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 71dbb38

Please sign in to comment.