Skip to content

Commit

Permalink
Update ProposeGenesis in TestUtils to remove redundant Initialize()
Browse files Browse the repository at this point in the history
  • Loading branch information
hpatel292-seneca committed Oct 15, 2024
1 parent 940e7a4 commit 5d627e4
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions test/Libplanet.Tests/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,19 +422,18 @@ public static PreEvaluationBlock ProposeGenesis(
var txs = transactions?.ToList() ?? new List<Transaction>();
long nonce = 0;
validatorSet = validatorSet ?? ValidatorSet;
txs.AddRange(
validatorSet.Validators.Select(
validator => Transaction.Create(
nonce++,
GenesisProposer,
null,
actions: new IAction[]
{
new Initialize(
validatorSet: validatorSet,
states: ImmutableDictionary.Create<Address, IValue>()),
}.Select(x => x.PlainValue),
timestamp: DateTimeOffset.MinValue)));
txs.Add(
Transaction.Create(
nonce++,
GenesisProposer,
null,
actions: new IAction[]
{
new Initialize(
validatorSet: validatorSet,
states: ImmutableDictionary.Create<Address, IValue>()),
}.Select(x => x.PlainValue),
timestamp: DateTimeOffset.MinValue));
txs = txs.OrderBy(tx => tx.Id).ToList();

var content = new BlockContent(
Expand Down

0 comments on commit 5d627e4

Please sign in to comment.