public void IssueAsync()
        {
            MultiChainTests.Mocks.Asset asset = new MultiChainTests.Mocks.Asset();
            asset.Title       = "Asset1";
            asset.Description = "An Asset added by a unit test";


            JsonRpcResponse <string> response = null;

            Task.Run(async() =>
            {
                try {
                    response = await _Client.Asset.IssueAsync(TestSettings.FromAddress, new { name = asset.Title, open = true }, 10, 1, asset);
                    await _Client.Asset.SubscribeAsync(response.Result, true);
                }
                catch (JsonRpcException ex) {
                    if (ex.Error.Code != -705)
                    {
                        throw ex;
                    }
                }
            }).GetAwaiter().GetResult();

            ResponseLogger <string> .Log(response);
        }
Exemple #2
0
        public void PrepareLockUnspentAsync()
        {
            MultiChainTests.Mocks.Asset asset = new MultiChainTests.Mocks.Asset();
            asset.Title       = "Asset2";
            asset.Description = "An Asset added by a unit test";
            _Client.Asset.IssueAsync(TestSettings.FromAddress, new { name = asset.Title, open = true }, 10, 1, asset);

            Dictionary <string, int> assetQuantities = new Dictionary <string, int>();

            assetQuantities.Add(asset.Title, 1);

            JsonRpcResponse <PrepareLockUnspentResponse> response = null;

            Task.Run(async() =>
            {
                response = await _Client.Transaction.PrepareLockUnspent(assetQuantities, true);
            }).GetAwaiter().GetResult();

            ResponseLogger <PrepareLockUnspentResponse> .Log(response);
        }