Skip to content

Commit

Permalink
Byte with u64
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Oct 16, 2023
1 parent b075b42 commit 6460ab2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ jobs:
CHAIN_COMMAND_PATHS: gaiad,${{ matrix.chain.command }}
ACCOUNT_PREFIXES: cosmos,${{ matrix.chain.account_prefix }}
run: |
nix shell .#gaia9 .#${{ matrix.chain.package }} -c cargo \
nix shell .#gaia12 .#${{ matrix.chain.package }} -c cargo \
test -p ibc-integration-test --features interchain-security --no-fail-fast -- \
--nocapture --test-threads=1 interchain_security::
Expand Down
17 changes: 16 additions & 1 deletion crates/relayer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub mod proof_specs;
pub mod types;

use alloc::collections::BTreeMap;
use byte_unit::Byte;
use core::{
cmp::Ordering,
fmt::{Display, Error as FmtError, Formatter},
Expand Down Expand Up @@ -43,6 +42,22 @@ pub use error::Error;

pub use filter::PacketFilter;

// TODO: Use Byte with u64. `toml::to_string_pretty` failed
// since the Byte is u128 because Namada is using byte-unit with u128.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Byte(u64);
impl Byte {
#[inline]
pub const fn from_bytes(bytes: u64) -> Byte {
Byte(bytes)
}

#[inline]
pub const fn get_bytes(&self) -> u64 {
self.0
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GasPrice {
pub price: f64,
Expand Down

0 comments on commit 6460ab2

Please sign in to comment.