Skip to content

Commit

Permalink
Revert "feat: allow response mismatch"
Browse files Browse the repository at this point in the history
This reverts commit 62b093d.
  • Loading branch information
LesnyRumcajs committed Mar 6, 2025
1 parent 62b093d commit 50af3a7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/tool/subcommands/api_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ pub enum ApiCommands {
#[arg(long, required = true)]
/// Folder into which test snapshots are dumped
out_dir: PathBuf,
/// Allow generating snapshot even if Lotus generated a different response. This is useful
/// when the response is not deterministic.
#[arg(long)]
allow_response_mismatch: bool,
},
DumpTests {
#[command(flatten)]
Expand Down Expand Up @@ -220,7 +216,6 @@ impl ApiCommands {
db,
chain,
out_dir,
allow_response_mismatch,
} => {
std::env::set_var("FOREST_TIPSET_CACHE_DISABLED", "1");
if !out_dir.is_dir() {
Expand All @@ -243,7 +238,6 @@ impl ApiCommands {
&test_dump,
tracking_db.clone(),
&chain,
allow_response_mismatch,
)
.await
{
Expand Down
4 changes: 1 addition & 3 deletions src/tool/subcommands/api_cmd/generate_test_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub async fn run_test_with_dump(
test_dump: &TestDump,
db: Arc<ReadOpsTrackingStore<ManyCar<ParityDb>>>,
chain: &NetworkChain,
allow_response_mismatch: bool,
) -> anyhow::Result<()> {
if chain.is_testnet() {
CurrentNetwork::set_global(Network::Testnet);
Expand All @@ -46,8 +45,7 @@ pub async fn run_test_with_dump(
let params = <$ty>::parse_params(params_raw.clone(), ParamStructure::Either)?;
let result = <$ty>::handle(ctx.clone(), params).await?;
anyhow::ensure!(
allow_response_mismatch
|| test_dump.forest_response == Ok(result.into_lotus_json_value()?),
test_dump.forest_response == Ok(result.into_lotus_json_value()?),
"Response mismatch between Forest and Lotus"
);
run = true;
Expand Down
2 changes: 1 addition & 1 deletion src/tool/subcommands/api_cmd/test_snapshots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ filecoin_ethaddresstofilecoinaddress_1740132538465536.rpcsnap.json.zst
filecoin_ethcall_1737446676693468.rpcsnap.json.zst
filecoin_ethchainid_1736937942819147.rpcsnap.json.zst
filecoin_ethfeehistory_1737446676883828.rpcsnap.json.zst
filecoin_ethgasprice_1740665223350859.rpcsnap.json.zst
filecoin_ethgasprice_1740132537695619.rpcsnap.json.zst
filecoin_ethgetbalance_1737446676695335.rpcsnap.json.zst
filecoin_ethgetbalance_1740048634848277.rpcsnap.json.zst
filecoin_ethgetblockbyhash_1740132537807408.rpcsnap.json.zst
Expand Down

0 comments on commit 50af3a7

Please sign in to comment.