Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAtwill committed Oct 17, 2023
1 parent a3efa28 commit 3c164be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
6 changes: 2 additions & 4 deletions ipc/sdk/src/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub struct BottomUpCheckpoint {
/// By not including cross messages here directly, we can be compatible with IPLD Resolver based
/// approach where the messages are fetched with Bitswap and provided by Fendermint, or the full-fat
/// approach we need with Lotus, where the messages are part of the relayed transaction.
pub cross_messages_hash: Vec<u8>
pub cross_messages_hash: Vec<u8>,
}

/// Validators tracks all the validator in the subnet. It is useful in handling top-down checkpoints.
Expand All @@ -82,6 +82,4 @@ impl Validators {
}

#[cfg(test)]
mod tests {

}
mod tests {}
21 changes: 9 additions & 12 deletions ipc/sdk/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
//! Type conversion for IPC Agent struct with solidity contract struct
use crate::address::IPCAddress;
use crate::checkpoint::BottomUpCheckpoint;
use crate::cross::{CrossMsg, StorableMsg};
use crate::staking::StakingChange;
use crate::staking::StakingChangeRequest;
use crate::subnet_id::SubnetID;
use crate::checkpoint::BottomUpCheckpoint;
use crate::{eth_to_fil_amount, ethers_address_to_fil_address};
use fvm_shared::clock::ChainEpoch;
use anyhow::anyhow;
use ethers::types::U256;
use fvm_ipld_encoding::RawBytes;
use fvm_shared::address::{Address, Payload};
use fvm_shared::clock::ChainEpoch;
use fvm_shared::econ::TokenAmount;
use fvm_shared::MethodNum;
use ipc_actors_abis::{
Expand Down Expand Up @@ -173,21 +173,18 @@ macro_rules! bottom_up_type_conversion {
type Error = anyhow::Error;

fn try_from(value: $module::BottomUpCheckpoint) -> Result<Self, Self::Error> {
Ok(
BottomUpCheckpoint {
subnet_id: SubnetID::try_from(value.subnet_id)?,
block_height: value.block_height as ChainEpoch,
block_hash: value.block_hash.to_vec(),
next_configuration_number: value.next_configuration_number,
cross_messages_hash: value.cross_messages_hash.to_vec(),
}
)
Ok(BottomUpCheckpoint {
subnet_id: SubnetID::try_from(value.subnet_id)?,
block_height: value.block_height as ChainEpoch,
block_hash: value.block_hash.to_vec(),
next_configuration_number: value.next_configuration_number,
cross_messages_hash: value.cross_messages_hash.to_vec(),
})
}
}
};
}


base_type_conversion!(gateway_router_facet);
base_type_conversion!(subnet_actor_getter_facet);
base_type_conversion!(gateway_manager_facet);
Expand Down

0 comments on commit 3c164be

Please sign in to comment.