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

Commit

Permalink
fix latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAtwill committed Dec 21, 2023
1 parent 30295cd commit 88d8927
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 67 deletions.
62 changes: 31 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ipc/cli/src/commands/subnet/list_subnets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ impl CommandLineHandler for ListSubnets {

for (_, s) in ls.iter() {
println!(
"{} - status: {:?}, collateral: {} FIL, circ.supply: {} FIL, genesis: {}",
s.id, s.status, s.stake, s.circ_supply, s.genesis_epoch
"{} - collateral: {} FIL, circ.supply: {} FIL, genesis: {}",
s.id, s.stake, s.circ_supply, s.genesis_epoch
);
}

Expand Down
6 changes: 1 addition & 5 deletions ipc/provider/src/lotus/message/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use fvm_shared::clock::ChainEpoch;
use fvm_shared::econ::TokenAmount;
use fvm_shared::MethodNum;
use ipc_sdk::address::IPCAddress;
use ipc_sdk::gateway::Status;
use ipc_sdk::subnet_id::SubnetID;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -79,9 +78,6 @@ pub struct SubnetInfo {
#[serde(deserialize_with = "deserialize_token_amount_from_str")]
#[serde(serialize_with = "serialize_token_amount_to_atto")]
pub circ_supply: TokenAmount,
/// State of the Subnet (Initialized, Active, Killed)
#[serde(rename(deserialize = "Status"))]
pub status: Status,
pub genesis_epoch: ChainEpoch,
}

Expand Down Expand Up @@ -143,7 +139,7 @@ mod tests {
#[test]
fn deserialize_ipc_subnet_state() {
let raw = r#"
{"Name":"test2","ParentID":{"Parent":"/r31415926","Actor":"t00"},"IPCGatewayAddr":"f064","Consensus":3,"MinValidatorStake":"1000000000000000000","TotalStake":"10000000000000000000","Stake":{"/":"bafy2bzacebentzoqaapingrxwknlxqcusl23rqaa7cwb42u76fgvb25nxpmhq"},"Status":1,"Genesis":null,"BottomUpCheckPeriod":10,"TopDownCheckPeriod":10,"GenesisEpoch":0,"CommittedCheckpoints":{"/":"bafy2bzaceamp42wmmgr2g2ymg46euououzfyck7szknvfacqscohrvaikwfay"},"ValidatorSet":{"validators":[{"addr":"t1cp4q4lqsdhob23ysywffg2tvbmar5cshia4rweq","net_addr":"test","weight":"10000000000000000000"}],"configuration_number":1},"MinValidators":1,"PreviousExecutedCheckpoint":{"/":"bafy2bzacedkoa623kvi5gfis2yks7xxjl73vg7xwbojz4tpq63dd5jpfz757i"},"BottomUpCheckpointVoting":{"GenesisEpoch":0,"SubmissionPeriod":10,"LastVotingExecuted":0,"ExecutableEpochQueue":null,"EpochVoteSubmission":{"/":"bafy2bzaceamp42wmmgr2g2ymg46euououzfyck7szknvfacqscohrvaikwfay"},"Ratio":{"Num":2,"Denom":3}}}
{"Name":"test2","ParentID":{"Parent":"/r31415926","Actor":"t00"},"IPCGatewayAddr":"f064","Consensus":3,"MinValidatorStake":"1000000000000000000","TotalStake":"10000000000000000000","Stake":{"/":"bafy2bzacebentzoqaapingrxwknlxqcusl23rqaa7cwb42u76fgvb25nxpmhq"},"Genesis":null,"BottomUpCheckPeriod":10,"TopDownCheckPeriod":10,"GenesisEpoch":0,"CommittedCheckpoints":{"/":"bafy2bzaceamp42wmmgr2g2ymg46euououzfyck7szknvfacqscohrvaikwfay"},"ValidatorSet":{"validators":[{"addr":"t1cp4q4lqsdhob23ysywffg2tvbmar5cshia4rweq","net_addr":"test","weight":"10000000000000000000"}],"configuration_number":1},"MinValidators":1,"PreviousExecutedCheckpoint":{"/":"bafy2bzacedkoa623kvi5gfis2yks7xxjl73vg7xwbojz4tpq63dd5jpfz757i"},"BottomUpCheckpointVoting":{"GenesisEpoch":0,"SubmissionPeriod":10,"LastVotingExecuted":0,"ExecutableEpochQueue":null,"EpochVoteSubmission":{"/":"bafy2bzaceamp42wmmgr2g2ymg46euououzfyck7szknvfacqscohrvaikwfay"},"Ratio":{"Num":2,"Denom":3}}}
"#;

let r = serde_json::from_str::<IPCReadSubnetActorStateResponse>(raw);
Expand Down
2 changes: 0 additions & 2 deletions ipc/provider/src/lotus/message/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2022-2023 Protocol Labs
// SPDX-License-Identifier: MIT
use fvm_shared::address::Address;
use ipc_sdk::gateway::Status;
use std::str::FromStr;

use crate::lotus::message::deserialize::{
Expand Down Expand Up @@ -129,7 +128,6 @@ fn test_subnet_info_to_str() {
id: Default::default(),
stake: Default::default(),
circ_supply: Default::default(),
status: Status::Active,
genesis_epoch: 0,
};

Expand Down
13 changes: 3 additions & 10 deletions ipc/provider/src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use std::time::Duration;

use ethers_contract::{ContractError, EthLogDecode, LogMeta};
use ipc_actors_abis::{
gateway_getter_facet, gateway_manager_facet, gateway_messenger_facet, gateway_router_facet,
gateway_getter_facet, gateway_manager_facet, gateway_messenger_facet,
lib_gateway, lib_quorum, lib_staking_change_log, register_subnet_facet,
subnet_actor_getter_facet, subnet_actor_manager_facet,
subnet_actor_getter_facet, subnet_actor_manager_facet, bottom_up_router_facet,
};
use ipc_sdk::evm::{fil_to_eth_amount, payload_to_evm_address, subnet_id_to_evm_addresses};
use ipc_sdk::validator::from_contract_validators;
Expand Down Expand Up @@ -41,7 +41,6 @@ use ipc_sdk::checkpoint::{
BottomUpCheckpoint, BottomUpCheckpointBundle, BottomUpMsgBatch, QuorumReachedEvent, Signature,
};
use ipc_sdk::cross::CrossMsg;
use ipc_sdk::gateway::Status;
use ipc_sdk::staking::{StakingChangeRequest, ValidatorInfo, ValidatorStakingInfo};
use ipc_sdk::subnet::ConstructParams;
use ipc_sdk::subnet_id::SubnetID;
Expand Down Expand Up @@ -1070,7 +1069,7 @@ impl BottomUpCheckpointRelayer for EthSubnetManager {
}

async fn quorum_reached_events(&self, height: ChainEpoch) -> Result<Vec<QuorumReachedEvent>> {
let contract = gateway_router_facet::GatewayRouterFacet::new(
let contract = bottom_up_router_facet::BottomUpRouterFacet::new(
self.ipc_contract_info.gateway_addr,
Arc::new(self.ipc_contract_info.provider.clone()),
);
Expand Down Expand Up @@ -1350,12 +1349,6 @@ impl TryFrom<gateway_getter_facet::Subnet> for SubnetInfo {
stake: eth_to_fil_amount(&value.stake)?,
circ_supply: eth_to_fil_amount(&value.circ_supply)?,
genesis_epoch: value.genesis_epoch.as_u64() as ChainEpoch,
status: match value.status {
1 => Status::Active,
2 => Status::Inactive,
3 => Status::Killed,
_ => return Err(anyhow!("invalid status: {:}", value.status)),
},
})
}
}
Expand Down
Loading

0 comments on commit 88d8927

Please sign in to comment.