@@ -72,7 +72,11 @@ export class BlockResultService {
72
72
merkleTreeStore : AsyncMerkleTreeStore ,
73
73
blockHashTreeStore : AsyncMerkleTreeStore ,
74
74
modifyTreeStore = true
75
- ) : Promise < BlockResult > {
75
+ ) : Promise < {
76
+ result : BlockResult ;
77
+ treeStore : CachedMerkleTreeStore ;
78
+ blockHashTreeStore : CachedMerkleTreeStore ;
79
+ } > {
76
80
const combinedDiff = createCombinedStateDiff ( block . transactions ) ;
77
81
78
82
const inMemoryStore = new CachedMerkleTreeStore ( merkleTreeStore ) ;
@@ -138,22 +142,21 @@ export class BlockResultService {
138
142
) ;
139
143
const blockHashWitness = blockHashTree . getWitness ( block . height . toBigInt ( ) ) ;
140
144
const newBlockHashRoot = blockHashTree . getRoot ( ) ;
141
- await blockHashInMemoryStore . mergeIntoParent ( ) ;
142
-
143
- if ( modifyTreeStore ) {
144
- await inMemoryStore . mergeIntoParent ( ) ;
145
- }
146
145
147
146
return {
148
- afterNetworkState : methodResult ,
149
- stateRoot : stateRoot . toBigInt ( ) ,
150
- blockHashRoot : newBlockHashRoot . toBigInt ( ) ,
151
- blockHashWitness,
152
-
153
- blockStateTransitions : stateTransitions . map ( ( st ) =>
154
- UntypedStateTransition . fromStateTransition ( st )
155
- ) ,
156
- blockHash : block . hash . toBigInt ( ) ,
147
+ result : {
148
+ afterNetworkState : methodResult ,
149
+ stateRoot : stateRoot . toBigInt ( ) ,
150
+ blockHashRoot : newBlockHashRoot . toBigInt ( ) ,
151
+ blockHashWitness,
152
+
153
+ blockStateTransitions : stateTransitions . map ( ( st ) =>
154
+ UntypedStateTransition . fromStateTransition ( st )
155
+ ) ,
156
+ blockHash : block . hash . toBigInt ( ) ,
157
+ } ,
158
+ treeStore : inMemoryStore ,
159
+ blockHashTreeStore : blockHashInMemoryStore ,
157
160
} ;
158
161
}
159
162
}
0 commit comments