-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from Concordium/ss/fix-issues-after-grpc-update
Made to lower invariant and fixed minor bugs after gRPC update
- Loading branch information
Showing
16 changed files
with
100 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
## Unreleased changes | ||
|
||
## 3.0.0 | ||
- Added | ||
- Add optional cancellation token parameter to all client calls. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Concordium.Sdk.Types; | ||
|
||
/// <summary> | ||
/// Information about a baker. | ||
/// </summary> | ||
/// <param name="BakerId">Account index of the account controlling the baker.</param> | ||
/// <param name="BakerElectionVerifyKey"> | ||
/// Baker's public key used to check whether they won the lottery or not. | ||
/// </param> | ||
/// <param name="BakerSignatureVerifyKey"></param> | ||
/// <param name="BakerAggregationVerifyKey"> | ||
/// Baker's public key used to check signatures on finalization records. | ||
/// This is only used if the baker has sufficient stake to participate in | ||
/// finalization. | ||
/// </param> | ||
public sealed record BakerInfo(BakerId BakerId, | ||
byte[] BakerElectionVerifyKey, | ||
byte[] BakerSignatureVerifyKey, | ||
byte[] BakerAggregationVerifyKey) | ||
{ | ||
internal static BakerInfo From(Grpc.V2.BakerInfo bakerInfo) => | ||
new( | ||
BakerId.From(bakerInfo.BakerId), | ||
bakerInfo.ElectionKey.Value.ToByteArray(), | ||
bakerInfo.SignatureKey.Value.ToByteArray(), | ||
bakerInfo.AggregationKey.Value.ToByteArray() | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Concordium.Sdk.Types; | ||
using FluentAssertions; | ||
using Xunit.Abstractions; | ||
|
||
namespace Concordium.Sdk.Tests.IntegrationTests.Client; | ||
|
||
[Trait("Category", "IntegrationTests")] | ||
public class GetAccountInfo : Tests | ||
{ | ||
public GetAccountInfo(ITestOutputHelper output) : base(output) | ||
{ } | ||
|
||
[Fact] | ||
public async Task GivenBakerZero_AtGenesisBlock_WhenGetAccountInfo_ThenReturnBakerZeroId() | ||
{ | ||
// Arrange | ||
var block = BlockHash.From("4221332d34e1694168c2a0c0b3fd0f273809612cb13d000d5c2e00e85f50f796"); | ||
var accountAddress = AccountAddress.From("48XGRnvQoG92T1AwETvW5pnJ1aRSPMKsWtGdKhTqyiNZzMk3Qn"); | ||
|
||
// Act | ||
var accountInfoAsync = await this.Client.GetAccountInfoAsync(accountAddress, new Given(block)); | ||
|
||
// Assert | ||
accountInfoAsync.Response.AccountStakingInfo.Should().NotBeNull(); | ||
accountInfoAsync.Response.AccountStakingInfo!.Should().BeOfType<AccountBaker>(); | ||
var baker = accountInfoAsync.Response.AccountStakingInfo! as AccountBaker; | ||
baker!.BakerInfo.BakerId.Id.Index.Should().Be(0); | ||
} | ||
|
||
} |