Skip to content

Commit

Permalink
Build fix due to package downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
greymistcube committed Feb 6, 2024
1 parent 6446a54 commit 2610dcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Libplanet.Net.Tests/Consensus/ConsensusContextTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ public async void NewHeightIncreasing()
Assert.Throws<InvalidHeightIncreasingException>(() => consensusContext.NewHeight(3));

await proposalMessageSent.WaitAsync();
Assert.NotNull(proposal?.BlockHash);
BlockHash proposedblockHash = Assert.IsType<BlockHash>(proposal?.BlockHash);

consensusContext.HandleMessage(new ConsensusPreCommitMsg(TestUtils.CreateVote(
TestUtils.PrivateKeys[0], 3, hash: proposal.BlockHash, flag: VoteFlag.PreCommit)));
TestUtils.PrivateKeys[0], 3, hash: proposedblockHash, flag: VoteFlag.PreCommit)));
consensusContext.HandleMessage(new ConsensusPreCommitMsg(TestUtils.CreateVote(
TestUtils.PrivateKeys[1], 3, hash: proposal.BlockHash, flag: VoteFlag.PreCommit)));
TestUtils.PrivateKeys[1], 3, hash: proposedblockHash, flag: VoteFlag.PreCommit)));
consensusContext.HandleMessage(new ConsensusPreCommitMsg(TestUtils.CreateVote(
TestUtils.PrivateKeys[2], 3, hash: proposal.BlockHash, flag: VoteFlag.PreCommit)));
TestUtils.PrivateKeys[2], 3, hash: proposedblockHash, flag: VoteFlag.PreCommit)));

// Waiting for commit.
await heightThreeStepChangedToEndCommit.WaitAsync();
Expand Down Expand Up @@ -224,7 +224,7 @@ public async void VoteSetGetOnlyProposeCommitHash()
consensusContext.NewHeight(blockChain.Tip.Index + 1);

await heightOneProposalSent.WaitAsync();
Assert.NotNull(proposal?.BlockHash);
BlockHash proposedblockHash = Assert.IsType<BlockHash>(proposal?.BlockHash);

votes.Add(TestUtils.CreateVote(
TestUtils.PrivateKeys[0],
Expand All @@ -236,7 +236,7 @@ public async void VoteSetGetOnlyProposeCommitHash()
TestUtils.PrivateKeys[x],
1,
0,
proposal.BlockHash,
proposedblockHash,
VoteFlag.PreCommit)));

foreach (var vote in votes)
Expand Down
10 changes: 5 additions & 5 deletions Libplanet.Net.Tests/Consensus/ContextProposerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,29 @@ public async void EnterPreCommitBlock()

// Wait for propose to process.
await proposalSent.WaitAsync();
Assert.NotNull(proposal?.BlockHash);
BlockHash proposedblockHash = Assert.IsType<BlockHash>(proposal?.BlockHash);

context.ProduceMessage(
new ConsensusPreVoteMsg(TestUtils.CreateVote(
TestUtils.PrivateKeys[0],
1,
hash: proposal.BlockHash,
hash: proposedblockHash,
flag: VoteFlag.PreVote)));
context.ProduceMessage(
new ConsensusPreVoteMsg(TestUtils.CreateVote(
TestUtils.PrivateKeys[2],
1,
hash: proposal.BlockHash,
hash: proposedblockHash,
flag: VoteFlag.PreVote)));
context.ProduceMessage(
new ConsensusPreVoteMsg(TestUtils.CreateVote(
TestUtils.PrivateKeys[3],
1,
hash: proposal.BlockHash,
hash: proposedblockHash,
flag: VoteFlag.PreVote)));

await Task.WhenAll(preCommitSent.WaitAsync(), stepChangedToPreCommit.WaitAsync());
Assert.Equal(proposal?.BlockHash, preCommit?.BlockHash);
Assert.Equal(proposedblockHash, preCommit?.BlockHash);
Assert.Equal(1, context.Height);
Assert.Equal(0, context.Round);
Assert.Equal(ConsensusStep.PreCommit, context.Step);
Expand Down

0 comments on commit 2610dcd

Please sign in to comment.