diff --git a/NineChronicles.Headless.Executable.Tests/Commands/TxCommandTest.cs b/NineChronicles.Headless.Executable.Tests/Commands/TxCommandTest.cs index 1704478f8..dc09855de 100644 --- a/NineChronicles.Headless.Executable.Tests/Commands/TxCommandTest.cs +++ b/NineChronicles.Headless.Executable.Tests/Commands/TxCommandTest.cs @@ -73,18 +73,9 @@ public void Sign_Stake(bool gas) } [Theory] - [InlineData(null, null, false)] - [InlineData(0, null, true)] - [InlineData(ClaimStakeReward2.ObsoletedIndex - 1, null, false)] - [InlineData(ClaimStakeReward2.ObsoletedIndex, null, true)] - [InlineData(ClaimStakeReward2.ObsoletedIndex + 1, null, false)] - [InlineData(long.MaxValue, null, true)] - [InlineData(null, 1, false)] - [InlineData(null, 2, true)] - [InlineData(null, 3, false)] - [InlineData(null, 4, true)] - [InlineData(null, 5, false)] - public void Sign_ClaimStakeReward(long? blockIndex, int? actionVersion, bool gas) + [InlineData(true)] + [InlineData(false)] + public void Sign_ClaimStakeReward(bool gas) { var filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); var actionCommand = new ActionCommand(_console); diff --git a/NineChronicles.Headless.Tests/GraphQLTestUtils.cs b/NineChronicles.Headless.Tests/GraphQLTestUtils.cs index e113ac220..88707debf 100644 --- a/NineChronicles.Headless.Tests/GraphQLTestUtils.cs +++ b/NineChronicles.Headless.Tests/GraphQLTestUtils.cs @@ -88,7 +88,7 @@ public static Task ExecuteQueryAsync( var graphType = (IObjectGraphType)serviceProvider.GetService(typeof(TObjectGraphType))!; return ExecuteQueryAsync(graphType, query, userContext, source); } - + public static Task ExecuteQueryAsync( IObjectGraphType graphType, string query, diff --git a/NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs b/NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs index e993818c0..5503d6fb5 100644 --- a/NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs +++ b/NineChronicles.Headless.Tests/GraphTypes/StandaloneQueryTest.cs @@ -623,7 +623,7 @@ public async Task GoldBalance() }, data ); - + worldState = worldState.MintAsset(new ActionContext(), userAddress, Currencies.Crystal * 10); stateRootHash = worldState.Trie.Hash; tip = new Domain.Model.BlockChain.Block( @@ -813,7 +813,7 @@ public async Task MonsterCollectionStatus_MonsterCollectionState_Null(bool miner { StandaloneContextFx.NineChroniclesNodeService.MinerPrivateKey = null; } - + // FIXME: Remove the above lines after removing `StandaloneContext` dependency. var worldState = new World(MockUtil.MockModernWorldState) .SetLegacyState(Addresses.GoldCurrency, new GoldCurrencyState(Currencies.Crystal).Serialize()) @@ -949,7 +949,7 @@ public async Task ActivationKeyNonce_ThrowError_WithInvalidFormatCode(string cod Assert.Single(queryResult.Errors!); Assert.Equal(msg, queryResult.Errors!.First().Message); } - + [Theory] [InlineData("9330b3287bd2bbc38770c69ae7cd380350c60a1dff9ec41254f3048d5b3eb01c/44C889Af1e1e90213Cff5d69C9086c34ecCb60B0", "invitationCode is invalid.")] public async Task ActivationKeyNonce_ThrowError_WithOutdatedCode(string code, string msg) @@ -998,7 +998,7 @@ public async Task Balance() StateRootHash: stateRootHash, Transactions: ImmutableArray.Empty ); - + BlockChainRepository.Setup(repo => repo.GetTip()) .Returns(tip); WorldStateRepository.Setup(repo => repo.GetWorldState(stateRootHash)) diff --git a/NineChronicles.Headless/GraphQLService.cs b/NineChronicles.Headless/GraphQLService.cs index 9104fdbfa..c68027eb6 100644 --- a/NineChronicles.Headless/GraphQLService.cs +++ b/NineChronicles.Headless/GraphQLService.cs @@ -161,7 +161,7 @@ public void ConfigureServices(IServiceCollection services) } services.AddTransient(); - + // Repositories services.AddSingleton(); services.AddSingleton(); diff --git a/NineChronicles.Headless/Repositories/BlockChain/BlockChainRepository.cs b/NineChronicles.Headless/Repositories/BlockChain/BlockChainRepository.cs index a97f61961..dcf0b5486 100644 --- a/NineChronicles.Headless/Repositories/BlockChain/BlockChainRepository.cs +++ b/NineChronicles.Headless/Repositories/BlockChain/BlockChainRepository.cs @@ -79,7 +79,7 @@ private Block FetchBlock(BlockHash blockHash) { return Convert(_blockChain[blockHash]); } - + private Block FetchBlock(long index) { return Convert(_blockChain[index]);