Skip to content

Commit 1220933

Browse files
committed
feat: Merge into Spellcheck
2 parents 9a9ac24 + 0eaaed1 commit 1220933

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2784
-2353
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
### Added
3131

3232
- [#6057](https://github.com/ChainSafe/forest/issues/6057) Added `--no-progress-timeout` to `forest-cli f3 ready` subcommand to exit when F3 is stuck for the given timeout.
33+
- [#6000](https://github.com/ChainSafe/forest/pull/6000) Add support for the `Filecoin.StateDecodeParams` API methods to enable decoding actors method params.
3334

3435
### Changed
3536

Cargo.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,22 @@ educe = { version = "0.6.0", features = ["Debug"], default-features = false }
6767
enumflags2 = "0.7"
6868
ethereum-types = { version = "0.15", features = ["ethbloom"] }
6969
ez-jsonrpc-types = "0.5"
70-
fil_actor_account_state = { version = "24" }
71-
fil_actor_cron_state = { version = "24" }
72-
fil_actor_datacap_state = { version = "24" }
73-
fil_actor_eam_state = { version = "24" }
74-
fil_actor_ethaccount_state = { version = "24" }
75-
fil_actor_evm_state = { version = "24" }
76-
fil_actor_init_state = { version = "24" }
77-
fil_actor_market_state = { version = "24" }
78-
fil_actor_miner_state = { version = "24" }
79-
fil_actor_multisig_state = { version = "24" }
80-
fil_actor_paych_state = { version = "24" }
81-
fil_actor_power_state = { version = "24" }
82-
fil_actor_reward_state = { version = "24" }
83-
fil_actor_system_state = { version = "24" }
84-
fil_actor_verifreg_state = { version = "24" }
85-
fil_actors_shared = { version = "24", features = ["json"] }
70+
fil_actor_account_state = { version = "24.1.2" }
71+
fil_actor_cron_state = { version = "24.1.2" }
72+
fil_actor_datacap_state = { version = "24.1.2" }
73+
fil_actor_eam_state = { version = "24.1.2" }
74+
fil_actor_ethaccount_state = { version = "24.1.2" }
75+
fil_actor_evm_state = { version = "24.1.2" }
76+
fil_actor_init_state = { version = "24.1.2" }
77+
fil_actor_market_state = { version = "24.1.2" }
78+
fil_actor_miner_state = { version = "24.1.2" }
79+
fil_actor_multisig_state = { version = "24.1.2" }
80+
fil_actor_paych_state = { version = "24.1.2" }
81+
fil_actor_power_state = { version = "24.1.2" }
82+
fil_actor_reward_state = { version = "24.1.2" }
83+
fil_actor_system_state = { version = "24.1.2" }
84+
fil_actor_verifreg_state = { version = "24.1.2" }
85+
fil_actors_shared = { version = "24.1.2", features = ["json"] }
8686
flate2 = "1"
8787
flume = { workspace = true }
8888
fs_extra = "1"

src/lotus_json/actor_states/methods/account_constructor_params.rs

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/lotus_json/actor_states/methods/init_constructor_params.rs

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/lotus_json/actor_states/methods/init_exec4_params.rs

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/lotus_json/actor_states/methods/init_exec_params.rs

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/lotus_json/actor_states/methods/mod.rs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/lotus_json/actors/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2019-2025 ChainSafe Systems
2+
// SPDX-License-Identifier: Apache-2.0, MIT
3+
4+
use super::*;
5+
mod params;
6+
mod states;

src/lotus_json/actor_states/methods/account_authenticate_params.rs renamed to src/lotus_json/actors/params/account_params.rs

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
// Copyright 2019-2025 ChainSafe Systems
22
// SPDX-License-Identifier: Apache-2.0, MIT
3+
34
use super::*;
5+
use crate::shim::address::Address;
46
use jsonrpsee::core::Serialize;
57
use paste::paste;
68
use schemars::JsonSchema;
79
use serde::Deserialize;
810

11+
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)]
12+
#[serde(transparent)]
13+
pub struct AccountConstructorParamsLotusJson {
14+
#[schemars(with = "LotusJson<Address>")]
15+
#[serde(with = "crate::lotus_json")]
16+
pub address: Address,
17+
}
18+
919
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)]
1020
#[serde(rename_all = "PascalCase")]
1121
pub struct AuthenticateParamsLotusJson {
@@ -59,6 +69,39 @@ macro_rules! impl_account_authenticate_params {
5969
};
6070
}
6171

62-
// not added other versions because AuthenticateMessageParams is private for the rest of them
63-
impl_account_authenticate_params!(types::AuthenticateMessageParams: 15, 16);
64-
impl_account_authenticate_params!(AuthenticateMessageParams: 11, 12, 13, 14);
72+
macro_rules! impl_account_constructor_params {
73+
($type_suffix:path: $($version:literal),+) => {
74+
$(
75+
paste! {
76+
impl HasLotusJson for fil_actor_account_state::[<v $version>]::$type_suffix {
77+
type LotusJson = AccountConstructorParamsLotusJson;
78+
79+
#[cfg(test)]
80+
fn snapshots() -> Vec<(serde_json::Value, Self)> {
81+
vec![
82+
(
83+
json!("f01234"),
84+
Self {
85+
address: Address::new_id(1234).into(),
86+
},
87+
),
88+
]
89+
}
90+
91+
fn into_lotus_json(self) -> Self::LotusJson {
92+
AccountConstructorParamsLotusJson { address: self.address.into() }
93+
}
94+
95+
fn from_lotus_json(lotus_json: Self::LotusJson) -> Self {
96+
Self { address: lotus_json.address.into() }
97+
}
98+
}
99+
}
100+
)+
101+
};
102+
}
103+
104+
impl_account_constructor_params!(types::ConstructorParams: 15, 16, 17);
105+
impl_account_constructor_params!(ConstructorParams: 11, 12, 13, 14);
106+
impl_account_authenticate_params!(types::AuthenticateMessageParams: 15, 16, 17);
107+
impl_account_authenticate_params!(AuthenticateMessageParams: 9, 10, 11, 12, 13, 14);

0 commit comments

Comments
 (0)