-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ValidateKeyringPassphrase * UnlockKeyring * MigrateKeyring * IsKeyringLocked * SetKeyringPassphrase * RemoveKeyringPassphrase * GetKeyForFingerprint * CheckKeys * GetFirstPrivateKey * GetAllPrivateKeys * sspelling * DeleteKeyByFingerprint * DeleteAllKeys * AddPrivateKey * closes #34 * GetLoggedInFingerprint #34 * refine test * PrivateKeyDetails * remove AddKeyAndRestoreBackup * #35 removed skipImport * #35 remove CreateBackup * #35 add fingerprint to return * #35 replicate push_tx on wallet interface * #35 remove default backup host stuff * #35 replace references to colour with CAT * #35 replace byte type with WalletType * #35 GetAssetId * #35 AssetIdToName * #35 add memos to cat_spend * #36 update CreateOfferForIds * #36 * #36 Add TradeManager * #36 add CatInfo * #36 remove GetDiscrepenciesForOffer * #36 CheckOfferValidity * #36 GetOffer * #36 GetOfferSummary * #36 CancelOffer * #36 TakeOffer * #36 update TradeRecord * #36 GetOffersCount * #36 GetAllOffers * #35 add search options to GetTransactions * #35 add announcements to createSignedTx * #35 add memos to SendTransaction * versioning * add overload for creating cat wallet with defualt name * wallet id on AssetIdToName is nullable * catch init erros * update deps * dont require cat name on wallet creation * make fee ulong * add OfferSummary type * comments * #38 * closes #38 * correct serialziation names for peercounts * closes #39 * some comments * create cat wallet test * setname tests * get asset id test * AssetIdToName test * Add TradeManager tests and fix a couple things * spelling * missing default fee = 0 * change Factory name to be more expliciti * remove unneed success check * remove temp object in GetOffers * use named params to avoid mixups * Update README.md * align tests to test server Co-authored-by: andyraddatz <[email protected]>
- Loading branch information
1 parent
79d4e47
commit 46d9a8e
Showing
43 changed files
with
1,456 additions
and
487 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System; | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace chia.dotnet.tests | ||
{ | ||
[TestClass] | ||
[TestCategory("Integration")] | ||
//[Ignore("Needs a CAT wallet")] | ||
public class CATWalletTests | ||
{ | ||
private static CATWallet _theWallet; | ||
|
||
[ClassInitialize] | ||
public static async Task Initialize(TestContext context) | ||
{ | ||
using var cts = new CancellationTokenSource(30000); | ||
var rpcClient = Factory.CreateWebsocketClient(); | ||
await rpcClient.Connect(cts.Token); | ||
|
||
var daemon = new DaemonProxy(rpcClient, "unit_tests"); | ||
await daemon.RegisterService(); | ||
|
||
var walletProxy = new WalletProxy(rpcClient, "unit_tests"); | ||
|
||
_ = await walletProxy.LogIn(cts.Token); | ||
|
||
// IMPORTANT | ||
// SET this wallet ID to a coloroured coin wallet | ||
_theWallet = new CATWallet(2, walletProxy); | ||
} | ||
|
||
[ClassCleanup()] | ||
public static void ClassCleanup() | ||
{ | ||
_theWallet.WalletProxy.RpcClient?.Dispose(); | ||
} | ||
|
||
[TestMethod()] | ||
public async Task GetName() | ||
{ | ||
using var cts = new CancellationTokenSource(20000); | ||
|
||
var name = await _theWallet.GetName(cts.Token); | ||
|
||
Assert.IsNotNull(name); | ||
} | ||
|
||
[TestMethod()] | ||
public async Task SetName() | ||
{ | ||
using var cts = new CancellationTokenSource(20000); | ||
|
||
var originalName = await _theWallet.GetName(cts.Token); | ||
|
||
var newName = Guid.NewGuid().ToString(); | ||
await _theWallet.SetName(newName, cts.Token); | ||
|
||
var name = await _theWallet.GetName(cts.Token); | ||
|
||
Assert.AreEqual(newName, name); | ||
await _theWallet.SetName(originalName, cts.Token); | ||
} | ||
|
||
|
||
[TestMethod()] | ||
public async Task GetAssetId() | ||
{ | ||
using var cts = new CancellationTokenSource(20000); | ||
|
||
var id = await _theWallet.GetAssetId(cts.Token); | ||
|
||
Assert.IsNotNull(id); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace chia.dotnet.tests | ||
{ | ||
[TestClass] | ||
[TestCategory("Integration")] | ||
public class CrawlerProxyTests | ||
{ | ||
private static CrawlerProxy _theCrawler; | ||
|
||
[ClassInitialize] | ||
public static async Task Initialize(TestContext context) | ||
{ | ||
try | ||
{ | ||
var rpcClient = Factory.CreateDirectRpcClientFromHardcodedLocation(8561, "crawler"); | ||
|
||
await Task.CompletedTask; | ||
_theCrawler = new CrawlerProxy(rpcClient, "unit_tests"); | ||
} | ||
catch (Exception e) | ||
{ | ||
Assert.Fail(e.Message); | ||
} | ||
} | ||
|
||
[ClassCleanup()] | ||
public static void ClassCleanup() | ||
{ | ||
_theCrawler.RpcClient?.Dispose(); | ||
} | ||
|
||
[TestMethod()] | ||
public async Task GetPeerCounts() | ||
{ | ||
using var cts = new CancellationTokenSource(20000); | ||
|
||
var counts = await _theCrawler.GetPeerCounts(cts.Token); | ||
|
||
Assert.IsNotNull(counts); | ||
} | ||
|
||
[TestMethod()] | ||
public async Task GetIPs() | ||
{ | ||
using var cts = new CancellationTokenSource(20000); | ||
|
||
var ips = await _theCrawler.GetIPs(DateTime.Now - TimeSpan.FromDays(2), cancellationToken: cts.Token); | ||
|
||
Assert.IsNotNull(ips); | ||
} | ||
} | ||
} |
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.