@@ -14,7 +14,7 @@ const CAPELLA_FORK_SLOT: u64 = CAPELLA_FORK_EPOCH * SLOTS_PER_EPOCH;
14
14
/**
15
15
* Generates a merkle proof from the transaction to the beacon block root.
16
16
*/
17
- pub async fn generate_transaction_branch (
17
+ pub async fn generate_transaction_proof (
18
18
state_prover : & dyn StateProverAPI ,
19
19
block_id : & String ,
20
20
tx_index : u64 ,
@@ -35,7 +35,7 @@ pub async fn generate_transaction_branch(
35
35
/**
36
36
* Generates a merkle proof from the receipts_root to the beacon block root.
37
37
*/
38
- pub async fn generate_receipts_root_branch (
38
+ pub async fn generate_receipts_root_proof (
39
39
state_prover : & dyn StateProverAPI ,
40
40
block_id : & String ,
41
41
) -> Result < ProofResponse > {
@@ -116,7 +116,7 @@ pub async fn prove_ancestry_with_block_roots(
116
116
Ok ( ancestry_proof)
117
117
}
118
118
119
- async fn prove_historical_summaries_branch (
119
+ async fn prove_historical_summaries_proof (
120
120
state_prover : & dyn StateProverAPI ,
121
121
target_block_slot : & u64 ,
122
122
recent_block_state_id : & String ,
@@ -170,18 +170,18 @@ pub async fn prove_ancestry_with_historical_summaries(
170
170
"Target block epoch is less than CAPELLA_FORK_EPOCH"
171
171
) ) ;
172
172
}
173
- let historical_summaries_branch =
174
- prove_historical_summaries_branch ( state_prover, target_block_slot, recent_block_state_id)
173
+ let historical_summaries_proof =
174
+ prove_historical_summaries_proof ( state_prover, target_block_slot, recent_block_state_id)
175
175
. await ?;
176
176
177
177
let block_root_to_block_summary_root =
178
178
prove_block_root_to_block_summary_root ( consensus, target_block_slot) . await ?;
179
179
180
180
let res = AncestryProof :: HistoricalRoots {
181
181
block_root_proof : block_root_to_block_summary_root,
182
- block_summary_root_proof : historical_summaries_branch . witnesses ,
183
- block_summary_root : historical_summaries_branch . leaf ,
184
- block_summary_root_gindex : historical_summaries_branch . gindex as usize ,
182
+ block_summary_root_proof : historical_summaries_proof . witnesses ,
183
+ block_summary_root : historical_summaries_proof . leaf ,
184
+ block_summary_root_gindex : historical_summaries_proof . gindex as usize ,
185
185
} ;
186
186
187
187
Ok ( res)
@@ -191,8 +191,8 @@ pub async fn prove_ancestry_with_historical_summaries(
191
191
mod tests {
192
192
use crate :: eth:: consensus:: EthBeaconAPI ;
193
193
use crate :: prover:: consensus:: {
194
- generate_receipts_root_branch , generate_transaction_branch ,
195
- prove_ancestry_with_block_roots , prove_ancestry_with_historical_summaries,
194
+ generate_receipts_root_proof , generate_transaction_proof , prove_ancestry_with_block_roots ,
195
+ prove_ancestry_with_historical_summaries,
196
196
} ;
197
197
use crate :: prover:: mocks:: mock_consensus_rpc:: MockConsensusRPC ;
198
198
use crate :: prover:: mocks:: mock_state_prover:: MockStateProver ;
@@ -209,7 +209,7 @@ mod tests {
209
209
* TESTS BELOW REQUIRE NETWORK REQUESTS
210
210
*/
211
211
#[ tokio_test]
212
- async fn test_transactions_branch ( ) {
212
+ async fn test_transactions_proof ( ) {
213
213
let consensus = & MockConsensusRPC :: new ( ) ;
214
214
let state_prover = MockStateProver :: new ( ) ;
215
215
let mut block = consensus. get_beacon_block ( 7807119 ) . await . unwrap ( ) ;
@@ -220,7 +220,7 @@ mod tests {
220
220
let node = transaction. hash_tree_root ( ) . unwrap ( ) ;
221
221
222
222
let proof =
223
- generate_transaction_branch ( & state_prover, & block_root. to_string ( ) , tx_index as u64 )
223
+ generate_transaction_proof ( & state_prover, & block_root. to_string ( ) , tx_index as u64 )
224
224
. await
225
225
. unwrap ( ) ;
226
226
@@ -235,13 +235,13 @@ mod tests {
235
235
}
236
236
237
237
#[ tokio_test]
238
- async fn test_receipts_root_branch ( ) {
238
+ async fn test_receipts_root_proof ( ) {
239
239
let consensus = & MockConsensusRPC :: new ( ) ;
240
240
let state_prover = MockStateProver :: new ( ) ;
241
241
let mut block = consensus. get_beacon_block ( 7807119 ) . await . unwrap ( ) ;
242
242
let block_root = block. hash_tree_root ( ) . unwrap ( ) ;
243
243
244
- let proof = generate_receipts_root_branch ( & state_prover, & block_root. to_string ( ) )
244
+ let proof = generate_receipts_root_proof ( & state_prover, & block_root. to_string ( ) )
245
245
. await
246
246
. unwrap ( ) ;
247
247
0 commit comments