From 0b991884d6b871246531d0add3c42ecfe7ab03da Mon Sep 17 00:00:00 2001 From: Don Kackman Date: Thu, 16 Sep 2021 18:46:05 -0500 Subject: [PATCH] 0.5.17 --- docs/api/chia.dotnet.PoolInfo.html | 49 ++++++++++++++++++----- docs/api/chia.dotnet.PoolState.html | 12 +++--- docs/manifest.json | 24 +++++------ docs/xrefmap.yml | 6 +++ src/chia-dotnet.tests/Factory.cs | 2 +- src/chia-dotnet.tests/WalletProxyTests.cs | 8 ++-- src/chia-dotnet/ChiaTypes/PoolInfo.cs | 4 +- src/chia-dotnet/ChiaTypes/PoolState.cs | 9 ++++- src/chia-dotnet/PoolWallet.cs | 2 +- src/chia-dotnet/chia-dotnet.csproj | 11 ++--- 10 files changed, 86 insertions(+), 41 deletions(-) diff --git a/docs/api/chia.dotnet.PoolInfo.html b/docs/api/chia.dotnet.PoolInfo.html index 4e1816b2..26c80e09 100644 --- a/docs/api/chia.dotnet.PoolInfo.html +++ b/docs/api/chia.dotnet.PoolInfo.html @@ -114,6 +114,37 @@
Syntax
public class PoolInfo : IEquatable<PoolInfo>
+

Fields +

+ + | + Improve this Doc + + + View Source + +

POOL_PROTOCOL_VERSION

+
+
+
Declaration
+
+
public const byte POOL_PROTOCOL_VERSION = 1
+
+
Field Value
+ + + + + + + + + + + + + +
TypeDescription
Byte

Properties

@@ -121,7 +152,7 @@

Properties Improve this Doc - View Source + View Source

AuthenticationTokenTimeout

@@ -151,7 +182,7 @@
Property Value
Improve this Doc
- View Source + View Source

Description

@@ -181,7 +212,7 @@
Property Value
Improve this Doc - View Source + View Source

Fee

@@ -211,7 +242,7 @@
Property Value
Improve this Doc - View Source + View Source

LogoUri

@@ -241,7 +272,7 @@
Property Value
Improve this Doc - View Source + View Source

MinimumDifficulty

@@ -271,7 +302,7 @@
Property Value
Improve this Doc - View Source + View Source

Name

@@ -301,7 +332,7 @@
Property Value
Improve this Doc - View Source + View Source

ProtocolVersion

@@ -331,7 +362,7 @@
Property Value
Improve this Doc - View Source + View Source

RelativeLockHeight

@@ -361,7 +392,7 @@
Property Value
Improve this Doc - View Source + View Source

TargetPuzzleHash

diff --git a/docs/api/chia.dotnet.PoolState.html b/docs/api/chia.dotnet.PoolState.html index d4f9e737..47e6b640 100644 --- a/docs/api/chia.dotnet.PoolState.html +++ b/docs/api/chia.dotnet.PoolState.html @@ -126,7 +126,7 @@

Properties Improve this Doc - View Source + View Source

OwnerPubkey

@@ -157,7 +157,7 @@
Property Value
Improve this Doc - View Source + View Source

PoolUrl

@@ -187,7 +187,7 @@
Property Value
Improve this Doc - View Source + View Source

RelativeLockHeight

@@ -217,7 +217,7 @@
Property Value
Improve this Doc - View Source + View Source

State

@@ -248,7 +248,7 @@
Property Value
Improve this Doc - View Source + View Source

TargetPuzzleHash

@@ -281,7 +281,7 @@
Property Value
Improve this Doc - View Source + View Source

Version

diff --git a/docs/manifest.json b/docs/manifest.json index 936c1029..3546cf2f 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -168,7 +168,7 @@ "hash": "5QDILkW3Nda5nGvTeE72oTgwFKYBcmlTictosdSAfSU=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { @@ -228,7 +228,7 @@ "hash": "YbxGPtBVUkYV3LyzQ4ffCMqCVSd/K1SIKjrrMOfyON8=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { @@ -300,7 +300,7 @@ "hash": "2WRD9NLk0vLhYMf21XEaKjkG48rXXlFjDWm0khpkIPw=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { @@ -336,7 +336,7 @@ "hash": "tIFe+zrKDaGy7LOpvmoZwyuqqfF94b3x6Ttz4+JBfg8=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { @@ -504,7 +504,7 @@ "hash": "NS7QyEhtxZ0z79e8V0Idmq90DeuK7RPE5BKh/+w8MLI=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { @@ -513,10 +513,10 @@ "output": { ".html": { "relative_path": "api/chia.dotnet.PoolInfo.html", - "hash": "vQ0GXK52S2ce2w+XgmCQ7syUNeXNYndPqDHrB3lp74o=" + "hash": "7RIXF/Mcw7EWt4MJsWqB8YMTndvTdvHI5tClmuWuOdM=" } }, - "is_incremental": true, + "is_incremental": false, "version": "" }, { @@ -540,7 +540,7 @@ "hash": "rvSGbCIY8tzWvG/1/kzfqVp5vXcV9khv2enoJJkGYbQ=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { @@ -549,7 +549,7 @@ "output": { ".html": { "relative_path": "api/chia.dotnet.PoolState.html", - "hash": "fkzgoTNCmdjPygKsiqgiyXhA61l8JJ5PAsrBZJqHGvU=" + "hash": "Gd+CUINLQYHPx8FA2MrueHPUyX8aa6HwpKRdmaicP7w=" } }, "is_incremental": false, @@ -564,7 +564,7 @@ "hash": "cJWE23noAYYSF6M2ZOxE8S4c42OF1fiJquibeBkO+Qg=" } }, - "is_incremental": true, + "is_incremental": false, "version": "" }, { @@ -612,7 +612,7 @@ "hash": "dfagD+0dhUjHE5EsSigBgL8AqqSWIq90v8umkADOvz0=" } }, - "is_incremental": true, + "is_incremental": false, "version": "" }, { @@ -732,7 +732,7 @@ "hash": "7KuM5o1uTuOVlB/P+SzYHWhipqzukHP1dpnSG5PfHwM=" } }, - "is_incremental": false, + "is_incremental": true, "version": "" }, { diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml index 482ac756..1b42f1e9 100644 --- a/docs/xrefmap.yml +++ b/docs/xrefmap.yml @@ -3959,6 +3959,12 @@ references: isSpec: "True" fullName: chia.dotnet.PoolInfo.Name nameWithType: PoolInfo.Name +- uid: chia.dotnet.PoolInfo.POOL_PROTOCOL_VERSION + name: POOL_PROTOCOL_VERSION + href: api/chia.dotnet.PoolInfo.html#chia_dotnet_PoolInfo_POOL_PROTOCOL_VERSION + commentId: F:chia.dotnet.PoolInfo.POOL_PROTOCOL_VERSION + fullName: chia.dotnet.PoolInfo.POOL_PROTOCOL_VERSION + nameWithType: PoolInfo.POOL_PROTOCOL_VERSION - uid: chia.dotnet.PoolInfo.ProtocolVersion name: ProtocolVersion href: api/chia.dotnet.PoolInfo.html#chia_dotnet_PoolInfo_ProtocolVersion diff --git a/src/chia-dotnet.tests/Factory.cs b/src/chia-dotnet.tests/Factory.cs index 08a92b78..5dfefdc6 100644 --- a/src/chia-dotnet.tests/Factory.cs +++ b/src/chia-dotnet.tests/Factory.cs @@ -8,7 +8,7 @@ namespace chia.dotnet.tests internal static class Factory { // this is the ip address of the chia node - private const string NodeHostAddress = "172.22.214.192"; + private const string NodeHostAddress = "172.25.175.129"; public static HttpRpcClient CreateDirectRpcClientFromHardcodedLocation(int port) { diff --git a/src/chia-dotnet.tests/WalletProxyTests.cs b/src/chia-dotnet.tests/WalletProxyTests.cs index ef2ba36f..f17fca27 100644 --- a/src/chia-dotnet.tests/WalletProxyTests.cs +++ b/src/chia-dotnet.tests/WalletProxyTests.cs @@ -198,7 +198,7 @@ public async Task LetsJoinAPool() RelativeLockHeight = poolInfo.RelativeLockHeight }; - using var cts = new CancellationTokenSource(300000); + using var cts = new CancellationTokenSource(30000); var (transaction, launcherId, p2SingletonHash) = await _theWallet.CreatePoolWallet(poolState, null, null, cts.Token); Console.WriteLine($"Launcher Id: {launcherId}"); @@ -209,9 +209,9 @@ public async Task LetsJoinAPool() [TestCategory("Integration")] public async Task GetPoolInfo() { - using var cts = new CancellationTokenSource(150000); + using var cts = new CancellationTokenSource(15000); - var info = await WalletProxy.GetPoolInfo(new Uri("https://na1.pool.space/"), cts.Token); + var info = await WalletProxy.GetPoolInfo(new Uri("https://testpool.xchpool.org"), cts.Token); Assert.IsNotNull(info); } @@ -219,7 +219,7 @@ public async Task GetPoolInfo() [TestMethod()] public async Task GetTrade() { - using var cts = new CancellationTokenSource(150000); + using var cts = new CancellationTokenSource(15000); var wallet = new Wallet(1, _theWallet); diff --git a/src/chia-dotnet/ChiaTypes/PoolInfo.cs b/src/chia-dotnet/ChiaTypes/PoolInfo.cs index 5d569220..612d24c4 100644 --- a/src/chia-dotnet/ChiaTypes/PoolInfo.cs +++ b/src/chia-dotnet/ChiaTypes/PoolInfo.cs @@ -4,11 +4,13 @@ namespace chia.dotnet { public record PoolInfo { + public const byte POOL_PROTOCOL_VERSION = 1; + public string Name { get; init; } = string.Empty; public Uri LogoUri { get; init; } = new Uri("http://localhost"); public ulong MinimumDifficulty { get; init; } public uint RelativeLockHeight { get; init; } - public byte ProtocolVersion { get; init; } + public byte ProtocolVersion { get; init; } = POOL_PROTOCOL_VERSION; public decimal Fee { get; init; } public string Description { get; init; } = string.Empty; public string? TargetPuzzleHash { get; init; } diff --git a/src/chia-dotnet/ChiaTypes/PoolState.cs b/src/chia-dotnet/ChiaTypes/PoolState.cs index bcdfbfbc..642d2c89 100644 --- a/src/chia-dotnet/ChiaTypes/PoolState.cs +++ b/src/chia-dotnet/ChiaTypes/PoolState.cs @@ -9,7 +9,9 @@ /// public record PoolState { - public byte Version { get; init; } + private string? poolUrl; + + public byte Version { get; init; } = PoolInfo.POOL_PROTOCOL_VERSION; /// /// PoolSingletonState /// @@ -24,7 +26,10 @@ public record PoolState /// owner_pubkey is set by the wallet, once /// public string OwnerPubkey { get; init; } = string.Empty; - public string? PoolUrl { get; init; } + + // the blockchain doesn't like it when the trailing slash is encoded into the nft (won't be able to decode and find wallet info) + public string? PoolUrl { get => poolUrl is not null ? poolUrl.TrimEnd('/') : null; init => poolUrl = value; } + public uint RelativeLockHeight { get; init; } } } diff --git a/src/chia-dotnet/PoolWallet.cs b/src/chia-dotnet/PoolWallet.cs index 4f3b64ee..61dd6376 100644 --- a/src/chia-dotnet/PoolWallet.cs +++ b/src/chia-dotnet/PoolWallet.cs @@ -53,7 +53,7 @@ public async Task JoinPool(string targetPuzzlehash, string po dynamic data = new ExpandoObject(); data.wallet_id = WalletId; data.target_puzzlehash = targetPuzzlehash; - data.pool_url = poolUrl; + data.pool_url = poolUrl.TrimEnd('/'); // the blocchain doesn't like the trailing / data.relative_lock_height = relativeLockHeight; return await WalletProxy.SendMessage("pw_join_pool", data, "transaction", cancellationToken).ConfigureAwait(false); diff --git a/src/chia-dotnet/chia-dotnet.csproj b/src/chia-dotnet/chia-dotnet.csproj index daca3449..c387773d 100644 --- a/src/chia-dotnet/chia-dotnet.csproj +++ b/src/chia-dotnet/chia-dotnet.csproj @@ -5,7 +5,7 @@ chia.dotnet true true - 0.5.16 + 0.5.17 dkackman dkackman A .net 5 client library for chia™ RPC interfaces that runs on linux and windows. @@ -16,12 +16,13 @@ https://github.com/dkackman/chia-dotnet git chia - 0.5.16 specify all datetimes as utc - - api refinements + 0.5.17 specify all datetimes as utc + - api refinements + - plotnft bug fix chia-leaf-logo-384x384.png - 0.5.16.0 - 0.5.16.0 + 0.5.17.0 + 0.5.17.0 enable