Skip to content

Commit

Permalink
Merge pull request #3618 from greymistcube/chore/cleanup
Browse files Browse the repository at this point in the history
🧹 Removed unnecessary extension method
  • Loading branch information
greymistcube authored Jan 19, 2024
2 parents 1291996 + b917fb9 commit fb17f71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 33 deletions.
29 changes: 0 additions & 29 deletions Libplanet.Store/Trie/TrieExtensions.cs

This file was deleted.

12 changes: 8 additions & 4 deletions Libplanet.Tests/Fixtures/IntegerSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ public TxWithContext Sign(PrivateKey signer, params Arithmetic[] actions)
BigInteger nextState = a.Operator.ToFunc()(prev.Item1, a.Operand);
var updatedRawStates = ImmutableDictionary<KeyBytes, IValue>.Empty
.Add(rawStateKey, (Bencodex.Types.Integer)nextState);
HashDigest<SHA256> nextRootHash =
Chain.StateStore.Commit(prevTrie.Set(updatedRawStates)).Hash;
HashDigest<SHA256> nextRootHash = Chain.StateStore.Commit(
updatedRawStates.Aggregate(
prevTrie,
(trie, pair) => trie.Set(pair.Key, pair.Value))).Hash;
return (nextState, nextRootHash);
}
});
Expand All @@ -153,8 +155,10 @@ public TxWithContext Sign(PrivateKey signer, params Arithmetic[] actions)
a.Operator.ToFunc()(delta[delta.Length - 1].Item1, a.Operand);
var updatedRawStates = ImmutableDictionary<KeyBytes, IValue>.Empty
.Add(rawStateKey, (Bencodex.Types.Integer)nextState);
HashDigest<SHA256> nextRootHash =
Chain.StateStore.Commit(prevTrie.Set(updatedRawStates)).Hash;
HashDigest<SHA256> nextRootHash = Chain.StateStore.Commit(
updatedRawStates.Aggregate(
prevTrie,
(trie, pair) => trie.Set(pair.Key, pair.Value))).Hash;
return delta.Add((nextState, nextRootHash));
}
}
Expand Down

0 comments on commit fb17f71

Please sign in to comment.