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

Commit

Permalink
add feature_config to BuilderClient
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihChengLiang committed Jan 24, 2024
1 parent 8787b3c commit f9e197d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ pub struct BuilderClient<P: JsonRpcClient> {
cli: GethClient<P>,
chain_id: Word,
circuits_params: FixedCParams,
feature_config: FeatureConfig,
}

/// Get State Accesses from TxExecTraces
Expand Down Expand Up @@ -679,6 +680,23 @@ impl<P: JsonRpcClient> BuilderClient<P> {
cli: client,
chain_id: chain_id.into(),
circuits_params,
feature_config: FeatureConfig::default(),
})
}

/// Create a new BuilderClient
pub async fn new_with_features(
client: GethClient<P>,
circuits_params: FixedCParams,
feature_config: FeatureConfig,
) -> Result<Self, Error> {
let chain_id = client.get_chain_id().await?;

Ok(Self {
cli: client,
chain_id: chain_id.into(),
circuits_params,
feature_config,
})
}

Expand Down Expand Up @@ -795,7 +813,7 @@ impl<P: JsonRpcClient> BuilderClient<P> {
code_db,
block,
self.circuits_params,
FeatureConfig::default(),
self.feature_config,
);
builder.handle_block(eth_block, geth_traces)?;
Ok(builder)
Expand Down

0 comments on commit f9e197d

Please sign in to comment.