Skip to content

Commit

Permalink
Apply dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal committed Sep 11, 2024
1 parent e92b5e6 commit d365ccb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
15 changes: 3 additions & 12 deletions NineChronicles.Headless.Executable.Tests/Commands/TxCommandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NineChronicles.Headless.Tests/GraphQLTestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static Task<ExecutionResult> ExecuteQueryAsync<TObjectGraphType>(
var graphType = (IObjectGraphType)serviceProvider.GetService(typeof(TObjectGraphType))!;
return ExecuteQueryAsync(graphType, query, userContext, source);
}

public static Task<ExecutionResult> ExecuteQueryAsync(
IObjectGraphType graphType,
string query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -998,7 +998,7 @@ public async Task Balance()
StateRootHash: stateRootHash,
Transactions: ImmutableArray<Transaction>.Empty
);

BlockChainRepository.Setup(repo => repo.GetTip())
.Returns(tip);
WorldStateRepository.Setup(repo => repo.GetWorldState(stateRootHash))
Expand Down
2 changes: 1 addition & 1 deletion NineChronicles.Headless/GraphQLService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void ConfigureServices(IServiceCollection services)
}

services.AddTransient<LocalAuthenticationMiddleware>();

// Repositories
services.AddSingleton<IWorldStateRepository, WorldStateRepository>();
services.AddSingleton<IBlockChainRepository, BlockChainRepository>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private Block FetchBlock(BlockHash blockHash)
{
return Convert(_blockChain[blockHash]);
}

private Block FetchBlock(long index)
{
return Convert(_blockChain[index]);
Expand Down

0 comments on commit d365ccb

Please sign in to comment.