From 6446a54e8658dd319dd34918ce1d931d20a4268d Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 7 Feb 2024 01:13:13 +0900 Subject: [PATCH 1/2] Downgraded xunit packages --- Libplanet.Action.Tests/Libplanet.Action.Tests.csproj | 2 +- Libplanet.Analyzers.Tests/Libplanet.Analyzers.Tests.csproj | 2 +- .../Libplanet.Crypto.Secp256k1.Tests.csproj | 2 +- .../Libplanet.Explorer.Cocona.Tests.csproj | 2 +- Libplanet.Explorer.Tests/Libplanet.Explorer.Tests.csproj | 2 +- .../Libplanet.Extensions.Cocona.Tests.csproj | 2 +- Libplanet.Net.Tests/Libplanet.Net.Tests.csproj | 6 +++--- .../Libplanet.RocksDBStore.Tests.csproj | 2 +- Libplanet.Stun.Tests/Libplanet.Stun.Tests.csproj | 2 +- Libplanet.Tests/Libplanet.Tests.csproj | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Libplanet.Action.Tests/Libplanet.Action.Tests.csproj b/Libplanet.Action.Tests/Libplanet.Action.Tests.csproj index ea283a64fec..465b8edd3c9 100644 --- a/Libplanet.Action.Tests/Libplanet.Action.Tests.csproj +++ b/Libplanet.Action.Tests/Libplanet.Action.Tests.csproj @@ -41,7 +41,7 @@ - + diff --git a/Libplanet.Analyzers.Tests/Libplanet.Analyzers.Tests.csproj b/Libplanet.Analyzers.Tests/Libplanet.Analyzers.Tests.csproj index 0aba3f8bb4c..cd2e3a44210 100644 --- a/Libplanet.Analyzers.Tests/Libplanet.Analyzers.Tests.csproj +++ b/Libplanet.Analyzers.Tests/Libplanet.Analyzers.Tests.csproj @@ -50,7 +50,7 @@ - + diff --git a/Libplanet.Crypto.Secp256k1.Tests/Libplanet.Crypto.Secp256k1.Tests.csproj b/Libplanet.Crypto.Secp256k1.Tests/Libplanet.Crypto.Secp256k1.Tests.csproj index 251ac751788..2d6b15a1b25 100644 --- a/Libplanet.Crypto.Secp256k1.Tests/Libplanet.Crypto.Secp256k1.Tests.csproj +++ b/Libplanet.Crypto.Secp256k1.Tests/Libplanet.Crypto.Secp256k1.Tests.csproj @@ -43,7 +43,7 @@ - + diff --git a/Libplanet.Explorer.Cocona.Tests/Libplanet.Explorer.Cocona.Tests.csproj b/Libplanet.Explorer.Cocona.Tests/Libplanet.Explorer.Cocona.Tests.csproj index 1593206124a..81119d91945 100644 --- a/Libplanet.Explorer.Cocona.Tests/Libplanet.Explorer.Cocona.Tests.csproj +++ b/Libplanet.Explorer.Cocona.Tests/Libplanet.Explorer.Cocona.Tests.csproj @@ -42,7 +42,7 @@ - + diff --git a/Libplanet.Explorer.Tests/Libplanet.Explorer.Tests.csproj b/Libplanet.Explorer.Tests/Libplanet.Explorer.Tests.csproj index ea07709157b..39a98eda76c 100644 --- a/Libplanet.Explorer.Tests/Libplanet.Explorer.Tests.csproj +++ b/Libplanet.Explorer.Tests/Libplanet.Explorer.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/Libplanet.Extensions.Cocona.Tests/Libplanet.Extensions.Cocona.Tests.csproj b/Libplanet.Extensions.Cocona.Tests/Libplanet.Extensions.Cocona.Tests.csproj index 1bc39a9f7f1..b0b0eee40f1 100644 --- a/Libplanet.Extensions.Cocona.Tests/Libplanet.Extensions.Cocona.Tests.csproj +++ b/Libplanet.Extensions.Cocona.Tests/Libplanet.Extensions.Cocona.Tests.csproj @@ -43,7 +43,7 @@ - + diff --git a/Libplanet.Net.Tests/Libplanet.Net.Tests.csproj b/Libplanet.Net.Tests/Libplanet.Net.Tests.csproj index 6999531e25e..3798337c912 100644 --- a/Libplanet.Net.Tests/Libplanet.Net.Tests.csproj +++ b/Libplanet.Net.Tests/Libplanet.Net.Tests.csproj @@ -34,9 +34,9 @@ runtime; build; native; contentfiles; analyzers - - - + + + diff --git a/Libplanet.RocksDBStore.Tests/Libplanet.RocksDBStore.Tests.csproj b/Libplanet.RocksDBStore.Tests/Libplanet.RocksDBStore.Tests.csproj index 66ac7c8a626..9ce87827170 100644 --- a/Libplanet.RocksDBStore.Tests/Libplanet.RocksDBStore.Tests.csproj +++ b/Libplanet.RocksDBStore.Tests/Libplanet.RocksDBStore.Tests.csproj @@ -41,7 +41,7 @@ - + diff --git a/Libplanet.Stun.Tests/Libplanet.Stun.Tests.csproj b/Libplanet.Stun.Tests/Libplanet.Stun.Tests.csproj index 5deb7097289..2b0702e2ed3 100644 --- a/Libplanet.Stun.Tests/Libplanet.Stun.Tests.csproj +++ b/Libplanet.Stun.Tests/Libplanet.Stun.Tests.csproj @@ -34,7 +34,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Libplanet.Tests/Libplanet.Tests.csproj b/Libplanet.Tests/Libplanet.Tests.csproj index 540601326f7..2fc5451be0a 100644 --- a/Libplanet.Tests/Libplanet.Tests.csproj +++ b/Libplanet.Tests/Libplanet.Tests.csproj @@ -44,7 +44,7 @@ - + From 2610dcd684e0d9dbec592eb2682c74a1bd9b5188 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 7 Feb 2024 01:50:20 +0900 Subject: [PATCH 2/2] Build fix due to package downgrade --- .../Consensus/ConsensusContextTest.cs | 12 ++++++------ Libplanet.Net.Tests/Consensus/ContextProposerTest.cs | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Libplanet.Net.Tests/Consensus/ConsensusContextTest.cs b/Libplanet.Net.Tests/Consensus/ConsensusContextTest.cs index 97bc84ff827..6068a2703cc 100644 --- a/Libplanet.Net.Tests/Consensus/ConsensusContextTest.cs +++ b/Libplanet.Net.Tests/Consensus/ConsensusContextTest.cs @@ -89,14 +89,14 @@ public async void NewHeightIncreasing() Assert.Throws(() => consensusContext.NewHeight(3)); await proposalMessageSent.WaitAsync(); - Assert.NotNull(proposal?.BlockHash); + BlockHash proposedblockHash = Assert.IsType(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(); @@ -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(proposal?.BlockHash); votes.Add(TestUtils.CreateVote( TestUtils.PrivateKeys[0], @@ -236,7 +236,7 @@ public async void VoteSetGetOnlyProposeCommitHash() TestUtils.PrivateKeys[x], 1, 0, - proposal.BlockHash, + proposedblockHash, VoteFlag.PreCommit))); foreach (var vote in votes) diff --git a/Libplanet.Net.Tests/Consensus/ContextProposerTest.cs b/Libplanet.Net.Tests/Consensus/ContextProposerTest.cs index 43a733e047f..84057b46f6c 100644 --- a/Libplanet.Net.Tests/Consensus/ContextProposerTest.cs +++ b/Libplanet.Net.Tests/Consensus/ContextProposerTest.cs @@ -106,29 +106,29 @@ public async void EnterPreCommitBlock() // Wait for propose to process. await proposalSent.WaitAsync(); - Assert.NotNull(proposal?.BlockHash); + BlockHash proposedblockHash = Assert.IsType(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);