Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rpc/registry/methods_reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ macro_rules! register_actor_methods {
$registry.register_method(
$code_cid,
$method as MethodNum,
|bytes| -> anyhow::Result<()> {
|bytes| -> anyhow::Result<serde_json::Value> {
if bytes.is_empty() {
Ok(())
Ok(serde_json::json!({}))
} else {
Ok(fvm_ipld_encoding::from_slice(bytes)?)
}
Expand Down
48 changes: 48 additions & 0 deletions src/tool/subcommands/api_cmd/api_compare_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,12 @@ fn state_decode_params_api_tests(tipset: &Tipset) -> anyhow::Result<Vec<RpcTest>
to_vec(&reward_update_network_params)?,
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::REWARD_ACTOR,
fil_actor_reward_state::v16::Method::ThisEpochReward as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::CreateMiner as u64,
Expand Down Expand Up @@ -2007,6 +2013,48 @@ fn state_decode_params_api_tests(tipset: &Tipset) -> anyhow::Result<Vec<RpcTest>
// to_vec(&power_miner_power_exp_params)?,
// tipset.key().into(),
// ))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::Constructor as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::OnEpochTickEnd as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::CurrentTotalPower as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::NetworkRawPowerExported as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::MinerCountExported as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::POWER_ACTOR,
fil_actor_power_state::v16::Method::MinerConsensusCountExported as u64,
vec![],
tipset.key().into(),
))?),
RpcTest::identity(StateDecodeParams::request((
Address::SYSTEM_ACTOR,
fil_actor_system_state::v16::Method::Constructor as u64,
vec![],
tipset.key().into(),
))?),
];

Ok(tests)
Expand Down
8 changes: 8 additions & 0 deletions src/tool/subcommands/api_cmd/test_snapshots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ filecoin_statedecodeparams_1753985928338431.rpcsnap.json.zst
filecoin_statedecodeparams_1753985928337192.rpcsnap.json.zst
filecoin_statedecodeparams_1753985928337443.rpcsnap.json.zst
filecoin_statedecodeparams_1753985928337618.rpcsnap.json.zst
filecoin_power_minercount_statedecodeparams_1754479441718517.rpcsnap.json.zst
filecoin_system_constructor_statedecodeparams_1754479441718641.rpcsnap.json.zst
filecoin_power_constructor_statedecodeparams_1754479441718709.rpcsnap.json.zst
filecoin_power_minerconsensuscount_statedecodeparams_1754479441718804.rpcsnap.json.zst
filecoin_power_currenttotalpower_statedecodeparams_1754479441718859.rpcsnap.json.zst
filecoin_power_onepochtickend_statedecodeparams_1754479441718920.rpcsnap.json.zst
filecoin_reward_thisepochreward_statedecodeparams_1754479441718972.rpcsnap.json.zst
filecoin_power_networkrawpower_statedecodeparams_1754479441719018.rpcsnap.json.zst
filecoin_statereplay_1743504051038215.rpcsnap.json.zst
filecoin_statesearchmsg_1741784596636715.rpcsnap.json.zst
filecoin_statesearchmsglimited_1741784596704876.rpcsnap.json.zst
Expand Down
Loading