-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
next release 0.9.24 & release candidates (#98)
* fixed wrong indexing bitseq updated nodetest to allow specific rpcs * Reverse and FromBitString and ToBitString moved to static utils. * fixed comment * fixed comment * fixed for versions bigger then NET2.0 #97 * added the negative number test * next release * removed old enum extension from usage
- Loading branch information
1 parent
ecb2644
commit ee8d5eb
Showing
16 changed files
with
308 additions
and
83,888 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
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,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json.Linq; | ||
using NUnit.Framework; | ||
using StreamJsonRpc; | ||
using Substrate.NetApi.Model.Rpc; | ||
using Substrate.NetApi.Model.Types.Base; | ||
using Substrate.NetApi.Model.Types.Primitive; | ||
|
||
namespace Substrate.NetApi.TestNode | ||
{ | ||
public class ModuleStateNextTest : NodeTest | ||
{ | ||
public ModuleStateNextTest() | ||
: base("wss://hydradx-rpc.dwellir.com") { } | ||
|
||
[Test] | ||
public async Task GetBlockAsyncTestAsync() | ||
{ | ||
var result = await _substrateClient.Chain.GetBlockAsync(new Hash("0x467fb6268675b96e707df72d382c14da0045ebc553edd9850414560053870b09"), CancellationToken.None); | ||
|
||
Assert.IsNotNull(result); | ||
} | ||
|
||
[Test] | ||
public async Task GetKeysPagedAtTestAsync() | ||
{ | ||
var parameters = RequestGenerator.GetStorage("System", "Number", | ||
Model.Meta.Storage.Type.Plain); | ||
|
||
var currentBlocknumber = await _substrateClient.GetStorageAsync<U32>(parameters, CancellationToken.None); | ||
|
||
var blockNumber = new BlockNumber(); | ||
blockNumber.Create(currentBlocknumber.Value); | ||
|
||
var blockHash = await _substrateClient.Chain.GetBlockHashAsync(blockNumber); | ||
|
||
var result = await _substrateClient.State.GetKeysPagedAsync(RequestGenerator.GetStorageKeyBytesHash("System", "BlockHash"), 10, null, blockHash.Bytes, CancellationToken.None); | ||
|
||
Assert.IsNotNull(result); | ||
Assert.AreEqual(10, result.Count); | ||
} | ||
|
||
[Test] | ||
[TestCase("0x467fb6268675b96e707df72d382c14da0045ebc553edd9850414560053870b09")] | ||
public async Task GetStorageAt_ShouldWorkAsync(string storageKeyHex) | ||
{ | ||
var blockHash = await GivenBlockAsync(); | ||
var storageKeys = Utils.HexToByteArray(storageKeyHex); | ||
|
||
var call_1 = await _substrateClient.State.GetStorageAsync(storageKeys, blockHash, CancellationToken.None); | ||
var call_2 = await _substrateClient.State.GetStorageAsync(storageKeys, Utils.Bytes2HexString(blockHash), CancellationToken.None); | ||
|
||
Assert.That(call_1, Is.Not.Null); | ||
Assert.That(call_2, Is.Not.Null); | ||
Assert.That(call_1, Is.EqualTo(call_2)); | ||
} | ||
|
||
} | ||
} |
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
Oops, something went wrong.