Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #74 from Levana-Protocol/ord-address
Browse files Browse the repository at this point in the history
Derive Ord trait for Address
  • Loading branch information
lvn-rusty-dragon authored Feb 2, 2024
2 parents 05efbfd + 926c25d commit bae49b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/cosmos/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ use crate::{
/// This value can be useful for converting addresses between different chains,
/// or for accepting a command line parameter or config value which is
/// chain-agnostic.
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]
pub struct RawAddress(RawAddressInner);

#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]
enum RawAddressInner {
Twenty { raw_address: [u8; 20] },
ThirtyTwo { raw_address: [u8; 32] },
Expand Down Expand Up @@ -141,7 +141,7 @@ impl RawAddress {
///
/// This is composed of a [RawAddress] combined with the human-readable part
/// (HRP) for the given chain. HRP is part of the bech32 standard.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Address {
raw_address: RawAddress,
hrp: AddressHrp,
Expand Down
4 changes: 2 additions & 2 deletions packages/cosmos/src/gas_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl OsmosisGasPrice {
}

/// Loads current eip base fee from Osmosis txfees module
pub async fn load_osmosis_gas_base_fee(cosmos: &Cosmos) -> Result<f64, LoadOsmosisGasPriceError> {
async fn load_osmosis_gas_base_fee(cosmos: &Cosmos) -> Result<f64, LoadOsmosisGasPriceError> {
let TxFeesInfo { eip_base_fee } = cosmos.get_osmosis_txfees_info().await?;
let base_fee: f64 = eip_base_fee.to_string().parse()?;

Expand All @@ -160,7 +160,7 @@ pub async fn load_osmosis_gas_base_fee(cosmos: &Cosmos) -> Result<f64, LoadOsmos

#[derive(thiserror::Error, Debug)]
/// Verbose error for the gas price base fee request
pub enum LoadOsmosisGasPriceError {
enum LoadOsmosisGasPriceError {
#[error(transparent)]
/// TxFees error
TxFees(#[from] crate::Error),
Expand Down

0 comments on commit bae49b7

Please sign in to comment.