Skip to content

Commit

Permalink
Accommodate API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
greymistcube committed Jul 27, 2023
1 parent 5a4c0fe commit 0df2b13
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .Lib9c.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void Main(string[] args)
Console.WriteLine("Total elapsed\t{0}", ended - started);
}

// Copied from BlockChain<T>.SetStates().
// Copied from BlockChain.DetermineBlockStateRootHash().
private static void SetStates(
Guid chainId,
IStore store,
Expand All @@ -162,18 +162,12 @@ private static void SetStates(
bool buildStateReferences
)
{
IImmutableSet<Address> stateUpdatedAddresses = actionEvaluations
.SelectMany(a => a.OutputState.Delta.StateUpdatedAddresses)
.ToImmutableHashSet();
IImmutableSet<(Address, Currency)> updatedFungibleAssets = actionEvaluations
.SelectMany(a => a.OutputState.Delta.UpdatedFungibleAssets)
.ToImmutableHashSet();
IImmutableDictionary<KeyBytes, IValue> totalDelta = actionEvaluations.GetRawTotalDelta();

if (!stateStore.ContainsStateRoot(block.StateRootHash))
{
HashDigest<SHA256>? prevStateRootHash = store.GetStateRootHash(block.PreviousHash);
var totalDelta = GetTotalDelta(actionEvaluations, ToStateKey, ToFungibleAssetKey);
stateStore.Commit(prevStateRootHash, totalDelta);
ITrie stateRoot = stateStore.Commit(prevStateRootHash, totalDelta);
}
}

Expand Down

0 comments on commit 0df2b13

Please sign in to comment.