diff --git a/src/Features/Blockcore.Features.BlockStore/Api/Controllers/BlockStoreController.cs b/src/Features/Blockcore.Features.BlockStore/Api/Controllers/BlockStoreController.cs index a8b4712b0..b70c859e5 100644 --- a/src/Features/Blockcore.Features.BlockStore/Api/Controllers/BlockStoreController.cs +++ b/src/Features/Blockcore.Features.BlockStore/Api/Controllers/BlockStoreController.cs @@ -59,7 +59,7 @@ public BlockStoreController( ChainIndexer chainIndexer, IAddressIndexer addressIndexer, IUtxoIndexer utxoIndexer, - IStakeChain stakeChain) + IStakeChain stakeChain = null) { Guard.NotNull(network, nameof(network)); Guard.NotNull(loggerFactory, nameof(loggerFactory)); diff --git a/src/Features/Blockcore.Features.BlockStore/Api/Models/BlockStoreRouteEndPoint.cs b/src/Features/Blockcore.Features.BlockStore/Api/Models/BlockStoreRouteEndPoint.cs index a48dbb10e..d7aee3784 100644 --- a/src/Features/Blockcore.Features.BlockStore/Api/Models/BlockStoreRouteEndPoint.cs +++ b/src/Features/Blockcore.Features.BlockStore/Api/Models/BlockStoreRouteEndPoint.cs @@ -6,7 +6,7 @@ public static class BlockStoreRouteEndPoint public const string GetVerboseAddressesBalances = "getverboseaddressesbalances"; public const string GetAddressIndexerTip = "addressindexertip"; public const string GetBlock = "block"; - public const string GetBlockCount = "GetBlockCount"; + public const string GetBlockCount = "getblockcount"; public const string GetUtxoSet = "getutxoset"; } -} +} \ No newline at end of file diff --git a/src/Features/Blockcore.Features.Wallet/Database/WalletStore.cs b/src/Features/Blockcore.Features.Wallet/Database/WalletStore.cs index 4ac615325..abf77132b 100644 --- a/src/Features/Blockcore.Features.Wallet/Database/WalletStore.cs +++ b/src/Features/Blockcore.Features.Wallet/Database/WalletStore.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using Blockcore.Configuration; using Blockcore.Consensus.ScriptInfo; using Blockcore.Consensus.TransactionInfo; @@ -45,15 +46,16 @@ public WalletStore(Network network, DataFolder dataFolder, Types.Wallet wallet) } BsonMapper mapper = this.Create(); - + LiteDB.FileMode fileMode = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? LiteDB.FileMode.Exclusive : LiteDB.FileMode.Shared; + if (!File.Exists(dbPath)) { - this.db = new LiteDatabase(new ConnectionString() { Filename = dbPath }, mapper: mapper); + this.db = new LiteDatabase(new ConnectionString() { Filename = dbPath, Mode = fileMode }, mapper: mapper); } else { // Only perform this check if the database file already exists. - this.db = new LiteDatabase(new ConnectionString() { Filename = dbPath }, mapper: mapper); + this.db = new LiteDatabase(new ConnectionString() { Filename = dbPath, Mode = fileMode }, mapper: mapper); // Attempt to access the user version, this will crash if the loaded database is V5 and we use V4 packages. try @@ -68,7 +70,7 @@ public WalletStore(Network network, DataFolder dataFolder, Types.Wallet wallet) File.Move(dbPath, dbBackupPath); // Re-create the database object after we renamed the file. - this.db = new LiteDatabase(new ConnectionString() { Filename = dbPath }, mapper: mapper); + this.db = new LiteDatabase(new ConnectionString() { Filename = dbPath, Mode = fileMode }, mapper: mapper); } } @@ -166,7 +168,6 @@ public IEnumerable GetAccountHistory(int accountIndex, bool e .OrderByDescending(x => x.SpendingDetails.CreationTime) .ToList(); - Query historyUnSpentQuery = Query.EQ("AccountIndex", new BsonValue(accountIndex)); if (excludeColdStake) { @@ -387,4 +388,4 @@ public void Dispose() this.db?.Dispose(); } } -} +} \ No newline at end of file diff --git a/src/Tests/Blockcore.IntegrationTests.Common/Blockcore.IntegrationTests.Common.csproj b/src/Tests/Blockcore.IntegrationTests.Common/Blockcore.IntegrationTests.Common.csproj index 31645a2ca..24d827e07 100644 --- a/src/Tests/Blockcore.IntegrationTests.Common/Blockcore.IntegrationTests.Common.csproj +++ b/src/Tests/Blockcore.IntegrationTests.Common/Blockcore.IntegrationTests.Common.csproj @@ -82,6 +82,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + diff --git a/src/Tests/Blockcore.IntegrationTests.Common/ReadyData/wallet-data-table.json b/src/Tests/Blockcore.IntegrationTests.Common/ReadyData/wallet-data-table.json new file mode 100644 index 000000000..08e48d620 --- /dev/null +++ b/src/Tests/Blockcore.IntegrationTests.Common/ReadyData/wallet-data-table.json @@ -0,0 +1,9 @@ +[ + { + "Id": "Key", + "EncryptedSeed": "6PYVfbtgR2vvkEtjCGFSq6v2nRoZMc2X1yPo5jG9TmGfCdQaoP8cR3iVLf", + "WalletName": "wallet-with-funds", + "WalletTip": "612591-d79c85e49d4024adb6f5d0a4e84aabac7a12f5964d41d3f16af3dedef22a2ad7", + "BlockLocator": [ "d79c85e49d4024adb6f5d0a4e84aabac7a12f5964d41d3f16af3dedef22a2ad7", "4b879668ea35a9dc1d0dee41263b8016cefb1ad61675a81a196f105a605f6253", "bba5ab001f7062f83b03d80879be19cdaa986830dc8dec8a4a1e562ab147e70b", "2e1a140297f7eaa1bed438c212a96b21c7d9c04769453a2c9cc268df98aa8ed9", "493bd83839f93cbcc889815262a3f3e54103dccb260051048e23b5604afcdcb0", "f11e1a27ca52006fd47d51a706648ea7b5a9f192a61710d0e82c835828abef5f", "580f36fa1c57bf64f11df5fbe239c022097f637e64ac5bbc3c3899435d0071a0", "f62357b1d4672f4eb6b1f963adb0ead2b307102cae5387732b642e8564400c6d", "9870ae47fcc2738ca011cb74d61f67f9da07b7438ff3d09dc6fa02917e13a48d", "63b4aba410a3b3c527eabe38412166d89f0e098d19a3bd052c70b155ebd0d0f5", "7b2d2fe5d7c4c4dd01c7d456bb288a684f3a901b0d12453cb77d199d609f710f", "feec721ef1f80e5e012eed5afe9ca78cde43f3494b08aca7f49ec15cf1737171", "d7345f76239eaaa5323d6e1fe7900e26909d4007a06a09b7f8a5010c9e318326", "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", "b7911ba105301945ccf59ae3b78921a8e7198ee82d6ec25e9b7a754a7ac1002e", "e9c38e323f466535b8bc6835c90bf260f360d5736ddd42e9cf64b0ac221f679b", "b2f5ee550f209aa5f7ce6f4422763e7ef79f3386f745b70939bda2da5a76bf6b", "5a90d268ba726930203c9adc2537e7f962b22452edc97146d0e6d8d179c84e54", "eafd04ba3a794d9a1c12269796e9b8c4ac7449bb7ea7cf9e206b14a3fc279ef9", "a9c671439827cb12a5295949bbfe601eab867c0370c91044dd385f64275ac84f", "a43d26bb6f835a520af7dd45a6c526557b9b5885faeabe64c932a5a7bca9769f", "0e15cd950c3b11c9f2a9c202a604b767fc7831da0dd1ea92c327a5406fac7040", "8af05078c9ec117b47406ab37c78ff770df562cdd605455e0f0718f8b9d0e5c0", "3c5292dd49bd3a004c355583c418c23793a713fac520cf14d29dfc598325186b", "33cc2264bf832b1eb27684bb9b64e83e7356a8b1571feae9f520dbb6deb3c6be", "180c94c93bd809a7d485114f5836e838902cd46ce0f613284c90be7a5846e816", "a2ec04f0f3544be538f483b8ae30043154d4e84a6cc63fd3aa3b12b749afbf27", "462091fa4e345b8d3b8985a363a555abdd5826a94d5ef201fadddeeadef2e9aa", "70d26875349c222a1c8b48c85ac382d8c10cdd594df773550ef45f551a68f901", "86f4b8458194221f5a94f00b5b396a24a9c12e97a42e92e29879c17a64941888", "00000e246d7b73b88c9ab55f2e5e94d9e22d471def3df5ea448f5576b1d156b9" ] + } +] \ No newline at end of file diff --git a/src/Tests/Blockcore.IntegrationTests.Common/ReadyData/wallet-transactions-table.json b/src/Tests/Blockcore.IntegrationTests.Common/ReadyData/wallet-transactions-table.json new file mode 100644 index 000000000..14a627e5e --- /dev/null +++ b/src/Tests/Blockcore.IntegrationTests.Common/ReadyData/wallet-transactions-table.json @@ -0,0 +1,524 @@ +[ + { + "OutPoint": "385ed3fd641f2c33f7c03b9698e69ff03beea90f1e1e0a5943b1a0f4fd29ed97-0", + "Address": "TFspxD1w7SxgYanNDGKkgcFj3ihqK1ktAJ", + "Id": "385ed3fd641f2c33f7c03b9698e69ff03beea90f1e1e0a5943b1a0f4fd29ed97", + "Amount": 2499999997700, + "Index": 0, + "BlockHeight": 72, + "BlockHash": "def1f8b45271a030782cf5106ec38fccbed10dd7a07810cd43ba19c4eb9b935c", + "CreationTime": "1540231296", + "ScriptPubKey": "76a91440cc44e95b9f502cd44893891c19a826494d702f88ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "385ed3fd641f2c33f7c03b9698e69ff03beea90f1e1e0a5943b1a0f4fd29ed97-1", + "Address": "TJkod1GniJG1CA55CrmxNi5emaYNTWwLnj", + "Id": "385ed3fd641f2c33f7c03b9698e69ff03beea90f1e1e0a5943b1a0f4fd29ed97", + "Amount": 2500000000000, + "Index": 1, + "BlockHeight": 72, + "BlockHash": "def1f8b45271a030782cf5106ec38fccbed10dd7a07810cd43ba19c4eb9b935c", + "CreationTime": "1540231296", + "ScriptPubKey": "76a91460609fa94fa6668c62c68baf8dcbc31eeb15240488ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "3ae2ca48712670395b14c616f5c0224359866b53244511409ed0248ea73a49be-1", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "3ae2ca48712670395b14c616f5c0224359866b53244511409ed0248ea73a49be", + "Amount": 100000000000000, + "Index": 1, + "BlockHeight": 94, + "BlockHash": "27247426eab0a915513a4d8e06e6117548dc79eb722d1b347f11790679a5b824", + "CreationTime": "1540232544", + "ScriptPubKey": "76a914149cb2d2735d7d52bd64d73f6a523d4d9130bbc888ac", + "IsPropagated": true, + "SpendingDetails": { + "TransactionId": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Payments": [], + "BlockHeight": 116, + "IsCoinStake": true, + "CreationTime": "1540234352" + }, + "AccountIndex": 0 + }, + { + "OutPoint": "3ccdfdce538eabe4d18efd2ee8fdc2554dc95cae6ce082aa4b5c7b9074b2e0a3-1", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "3ccdfdce538eabe4d18efd2ee8fdc2554dc95cae6ce082aa4b5c7b9074b2e0a3", + "Amount": 10000000000000, + "Index": 1, + "BlockHeight": 10, + "BlockHash": "54ea867ad7c0ee923b4d8f11a6c68edcc5a01b50e8cf3afb493c46df7391dc67", + "CreationTime": "1540211312", + "ScriptPubKey": "76a914a70b19d97a01e0bea6a7beeaea4b9c78b995a07588ac", + "IsPropagated": true, + "SpendingDetails": { + "TransactionId": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Payments": [], + "BlockHeight": 105, + "IsCoinStake": true, + "CreationTime": "1540233728" + }, + "AccountIndex": 0 + }, + { + "OutPoint": "4f1766c2dca4bb96bb7282b4eef113c0956f1ad50ba1a205bec50c7770cac2d5-1", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "4f1766c2dca4bb96bb7282b4eef113c0956f1ad50ba1a205bec50c7770cac2d5", + "Amount": 150000000000, + "Index": 1, + "BlockHeight": 36, + "BlockHash": "935b98019c1f687cd196adfa37ef6cc4e49201243a56600a3dc87c35ab2f5936", + "CreationTime": "1540229600", + "ScriptPubKey": "76a914a70b19d97a01e0bea6a7beeaea4b9c78b995a07588ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "7b690b85b1589f6519b484a10ef0a782d661476d22278ad95de8d91caa52c20f-0", + "Address": "TQJphNZMvQqcCUD4tD59AX3co4d6v5wEBM", + "Id": "7b690b85b1589f6519b484a10ef0a782d661476d22278ad95de8d91caa52c20f", + "Amount": 100000000000, + "Index": 0, + "CreationTime": "1540236867", + "ScriptPubKey": "76a9149d477602f7db6373421ada2dd54da6c6f777abbe88ac", + "IsPropagated": false, + "AccountIndex": 0 + }, + { + "OutPoint": "8b2e57f8959272d357682ede444244d9831cb47e9c936ea9452657a5633a53b5-0", + "Address": "TMwfNfwRD4gzCqimgUiBSdioyPmV3X6HLC", + "Id": "8b2e57f8959272d357682ede444244d9831cb47e9c936ea9452657a5633a53b5", + "Amount": 39999997700, + "Index": 0, + "BlockHeight": 74, + "BlockHash": "d97bada993f477915b02937ac6e08f1c4634d1a5ae456d683cc7236437226801", + "CreationTime": "1540231472", + "ScriptPubKey": "76a9148356b13788b5160d66f2332d12bc30f61cea92cc88ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-1", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 1, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-2", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 2, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-3", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 3, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-4", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 4, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-5", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 5, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-6", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 6, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-7", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 7, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44-8", + "Address": "TRCT9QP3ipb6zCvW15yKoEtaU418UaKVE2", + "Id": "9ba03170f7a9e65d19a92e948cb9c7aab832992cad5178e248d1761710167d44", + "Amount": 1250012500000, + "IsCoinStake": true, + "Index": 8, + "BlockHeight": 105, + "BlockHash": "c91adbcd12cdbd80914fd45ca99930892b4ef65d2b42384f1798e496c3c2b785", + "CreationTime": "1540233728", + "ScriptPubKey": "2103a49886750794318c6f2da737d4835367890760b0616d59f6852d6404f968007aac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "a40cf5f3c20cf265f5e1a360c7c984688b191993792e7a9cd6227c952b840710-1", + "Address": "TSPZFwU7Drs6mZAvJwvcJkRhZpitRPpRLj", + "Id": "a40cf5f3c20cf265f5e1a360c7c984688b191993792e7a9cd6227c952b840710", + "Amount": 19000000000000, + "Index": 1, + "BlockHeight": 100, + "BlockHash": "f5ddd61dba71e07ccb3188c09862c4872752584fa3fa6980858a1cae62944223", + "CreationTime": "1540233520", + "ScriptPubKey": "76a914b41ce7ab15efd7ed46bcf5d0c77dee9e2951abb188ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-1", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 1, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-2", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 2, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-3", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 3, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-4", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 4, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-5", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 5, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-6", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 6, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-7", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 7, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf-8", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Amount": 1000012500000, + "IsCoinStake": true, + "Index": 8, + "BlockHeight": 120, + "BlockHash": "a1afdab1e03cda7055678ca3cef5fc7a0f9d06bc0fcafc6700ffae77bceea452", + "CreationTime": "1540234384", + "ScriptPubKey": "2103a22da24b8922d4cec261c204316fc8ff250d716b17f52f4e78629d344cf031f9ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "bfc1e9b8cafbcb3976b42f57f4f1da2342e79ac1600ac02acdbdb6c94132395b-1", + "Address": "TB4LrSQxvubrEQR87RtypAadr9vvCnZAgN", + "Id": "bfc1e9b8cafbcb3976b42f57f4f1da2342e79ac1600ac02acdbdb6c94132395b", + "Amount": 8000000000000, + "Index": 1, + "BlockHeight": 50, + "BlockHash": "7c983c6f134aff71c2a2444fc7062c43cc198138ad74b90c31970a12b336ac0c", + "CreationTime": "1540228624", + "ScriptPubKey": "76a9140bf0c274bc9fa6878e737e07b8ba7bff6ba1707988ac", + "IsPropagated": true, + "SpendingDetails": { + "TransactionId": "b5a111b97dd3764d45e3a4a014433fef2200c212434c08a3106930196bd366cf", + "Payments": [], + "BlockHeight": 120, + "IsCoinStake": true, + "CreationTime": "1540234384" + }, + "AccountIndex": 0 + }, + { + "OutPoint": "c59004311a96d43ba30294d0b833a9d1ab1fc0210880b6ea3c7a620511394459-1", + "Address": "TJ7JpLHqhP4t8kNtAs7X8G1scNAxsPiRcY", + "Id": "c59004311a96d43ba30294d0b833a9d1ab1fc0210880b6ea3c7a620511394459", + "Amount": 5000000000000, + "Index": 1, + "BlockHeight": 31, + "BlockHash": "4467e3a935aa5ea8c53e38f54b1de3432eb49cb3fdddfa8270b5b5378060294d", + "CreationTime": "1540227680", + "ScriptPubKey": "76a9145949302a4e6ce82ca539262d04a652857e0338bb88ac", + "IsPropagated": true, + "SpendingDetails": { + "TransactionId": "385ed3fd641f2c33f7c03b9698e69ff03beea90f1e1e0a5943b1a0f4fd29ed97", + "Payments": [ + { + "DestinationScriptPubKey": "76a91460609fa94fa6668c62c68baf8dcbc31eeb15240488ac", + "DestinationAddress": "TJkod1GniJG1CA55CrmxNi5emaYNTWwLnj", + "Amount": 2500000000000 + } + ], + "BlockHeight": 72, + "CreationTime": "1540231296" + }, + "AccountIndex": 0 + }, + { + "OutPoint": "e92f84829f90f62be193c03a1c32f5d4b2fc4edcf8c96a8b7fd5176c47d14cd1-0", + "Address": "TKGmMkUwYiB2ezdNeKgn5rTEAVSBErxkbH", + "Id": "e92f84829f90f62be193c03a1c32f5d4b2fc4edcf8c96a8b7fd5176c47d14cd1", + "Amount": 700000000000, + "Index": 0, + "BlockHeight": 36, + "BlockHash": "935b98019c1f687cd196adfa37ef6cc4e49201243a56600a3dc87c35ab2f5936", + "CreationTime": "1540229600", + "ScriptPubKey": "76a914660b36a541f8b4a9d6c31e3a3c5938955b399d0f88ac", + "IsPropagated": true, + "SpendingDetails": { + "TransactionId": "8b2e57f8959272d357682ede444244d9831cb47e9c936ea9452657a5633a53b5", + "Payments": [ + { + "DestinationScriptPubKey": "76a914022fb220001308fd03e7465c6f1306b4917b45e188ac", + "DestinationAddress": "TAAmVQSfLRQhnqcC7R4EhrknAiW3Zvfkoy", + "Amount": 660000000000 + } + ], + "BlockHeight": 74, + "CreationTime": "1540231472" + }, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-1", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 1, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-2", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 2, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-3", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 3, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-4", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 4, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-5", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 5, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-6", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 6, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-7", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 7, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + }, + { + "OutPoint": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49-8", + "Address": "TBrCEVwwp3pqxUfAV6yqQ1TCMFYkp4e5HC", + "Id": "ecffe31056399a844b0608fa84bc0b62201bd36d051cf150c04f87dce55a0a49", + "Amount": 12500012500000, + "IsCoinStake": true, + "Index": 8, + "BlockHeight": 116, + "BlockHash": "3a6c249d7fcfd46b1d160e18d94a3135c573b5d5ff5d16ac23d23eafaea65af6", + "CreationTime": "1540234352", + "ScriptPubKey": "210367aefe5232c0f1217511c4ae08ea970f166f66e7bc014813564c95a9df514f87ac", + "IsPropagated": true, + "AccountIndex": 0 + } +] \ No newline at end of file diff --git a/src/Tests/Blockcore.IntegrationTests/Blockcore.IntegrationTests.csproj b/src/Tests/Blockcore.IntegrationTests/Blockcore.IntegrationTests.csproj index 198d2bf38..cc245dffb 100644 --- a/src/Tests/Blockcore.IntegrationTests/Blockcore.IntegrationTests.csproj +++ b/src/Tests/Blockcore.IntegrationTests/Blockcore.IntegrationTests.csproj @@ -74,6 +74,9 @@ Always + + PreserveNewest + Always @@ -84,4 +87,8 @@ PreserveNewest + + + + \ No newline at end of file diff --git a/src/Tests/Blockcore.IntegrationTests/GenerateChain.cs b/src/Tests/Blockcore.IntegrationTests/GenerateChain.cs index a48991197..57cb97309 100644 --- a/src/Tests/Blockcore.IntegrationTests/GenerateChain.cs +++ b/src/Tests/Blockcore.IntegrationTests/GenerateChain.cs @@ -1,6 +1,13 @@ -using System.IO; +using System; +using System.Collections.Generic; +using System.IO; using System.IO.Compression; using System.Linq; +using Blockcore.Configuration; +using Blockcore.Consensus.ScriptInfo; +using Blockcore.Consensus.TransactionInfo; +using Blockcore.Features.Wallet.Database; +using Blockcore.Features.Wallet.Types; using Blockcore.IntegrationTests.Common; using Blockcore.IntegrationTests.Common.EnvironmentMockUpHelpers; using Blockcore.IntegrationTests.Common.Extensions; @@ -8,7 +15,11 @@ using Blockcore.Networks.Bitcoin; using Blockcore.Networks.Stratis; using Blockcore.Tests.Common; +using Blockcore.Utilities; +using Blockcore.Utilities.JsonConverters; using NBitcoin; +using NBitcoin.DataEncoders; +using Newtonsoft.Json; using Xunit; namespace Blockcore.IntegrationTests @@ -20,6 +31,7 @@ public class GenerateChain private const string MinerMnemonic = "elevator slight dad hair table forum maze feed trim ignore field mystery"; private const string ListenerMnemonic = "seminar cool use bleak drink section rent bid language obey skin round"; private const string DataPath = @"..\..\..\..\Blockcore.IntegrationTests.Common\ReadyData"; + private const string WalletOutputDataPath = @"..\..\..\..\\Blockcore.IntegrationTests\Wallet\Data"; public GenerateChain() { @@ -62,6 +74,92 @@ public void CreateBitcoinBlockchainDataWith150Blocks() this.GenerateBitcoinBlockchainData(new BitcoinRegTest(), 150, true, true, true); } + [Fact(Skip = SkipTestMessage)] + public void CreateWalletData() + { + string walltName = "wallet-with-funds"; + string path = Path.Combine(WalletOutputDataPath + @"\txdb", walltName + ".db"); + + if (File.Exists(path)) + { + File.Delete(path); + } + + var network = new BitcoinRegTest(); + var folder = new DataFolder(WalletOutputDataPath); + var wallet = new Features.Wallet.Types.Wallet() { Name = walltName }; + + var walletStore = new WalletStore(network, folder, wallet); + + string dataPath = Path.Combine(DataPath, "wallet-data-table.json"); + + var dataTable = JsonConvert.DeserializeObject(File.ReadAllText(dataPath))[0]; + + WalletData walletData = new WalletData + { + Key = dataTable.Id, + WalletName = dataTable.WalletName, + EncryptedSeed = dataTable.EncryptedSeed, + WalletTip = new HashHeightPair(uint256.Parse(dataTable.WalletTip.Split("-")[1]), + int.Parse(dataTable.WalletTip.Split("-")[0])), + BlockLocator = dataTable.BlockLocator.Select(uint256.Parse).ToList() + }; + walletStore.SetData(walletData); + + dataPath = Path.Combine(DataPath, "wallet-transactions-table.json"); + + var transactionsTable = JsonConvert.DeserializeObject(File.ReadAllText(dataPath)); + foreach (var item in transactionsTable) + { + var trx = new TransactionOutputData + { + OutPoint = new OutPoint(uint256.Parse(item.OutPoint.Split("-")[0]), + int.Parse(item.OutPoint.Split("-")[1])), + Address = item.Address, + Id = uint256.Parse(item.Id), + Amount = new Money(item.Amount), + Index = item.Index, + BlockHeight = item.BlockHeight, + BlockHash = item.BlockHash != null ? uint256.Parse(item.BlockHash) : null, + CreationTime = DateTimeOffset.FromUnixTimeSeconds(long.Parse(item.CreationTime)), + ScriptPubKey = new Script(Encoders.Hex.DecodeData(item.ScriptPubKey)), + IsPropagated = item.IsPropagated, + AccountIndex = item.AccountIndex, + IsCoinStake = item.IsCoinStake, + IsCoinBase = item.IsCoinBase, + IsColdCoinStake = item.IsColdCoinStake, + }; + + if (item.SpendingDetails != null) + { + trx.SpendingDetails = new Features.Wallet.Database.SpendingDetails + { + BlockHeight = item.SpendingDetails.BlockHeight, + IsCoinStake = item.SpendingDetails.IsCoinStake, + CreationTime = DateTimeOffset.FromUnixTimeSeconds(long.Parse(item.SpendingDetails.CreationTime)), + TransactionId = uint256.Parse(item.SpendingDetails.TransactionId) + }; + + if (item.SpendingDetails.Payments != null) + { + foreach (PaymentDetails spendingDetailsPayment in item.SpendingDetails.Payments) + { + trx.SpendingDetails.Payments.Add(new Features.Wallet.Database.PaymentDetails + { + Amount = new Money(spendingDetailsPayment.Amount), + DestinationAddress = spendingDetailsPayment.DestinationAddress, + DestinationScriptPubKey = new Script(Encoders.Hex.DecodeData(spendingDetailsPayment.DestinationScriptPubKey)), + OutputIndex = spendingDetailsPayment.OutputIndex, + PayToSelf = spendingDetailsPayment.PayToSelf + }); + } + } + } + + walletStore.InsertOrUpdate(trx); + } + } + private void GenerateStratisBlockchainData(Network network, int blockCount, bool saveMinerFolderWithWallet, bool saveListenerFolderWithSyncedEmptyWallet, bool saveFolderWithoutWallet) { string dataFolderPath, listenerFolderPath; @@ -178,4 +276,84 @@ private static void ZipDataFolder(string folderToZip, string zipFileName, string ZipFile.CreateFromDirectory(Path.GetFullPath(folderToZip), zipPath); } } + + public class WalletDataItem + { + public string Id { get; set; } + + public string EncryptedSeed { get; set; } + + public string WalletName { get; set; } + + public string WalletTip { get; set; } + + public ICollection BlockLocator { get; set; } + } + + public class TransactionDataItem + { + public string OutPoint { get; set; } + + public string Address { get; set; } + + public int AccountIndex { get; set; } + + public string Id { get; set; } + + public long Amount { get; set; } + + public bool? IsCoinBase { get; set; } + + public bool? IsCoinStake { get; set; } + public bool? IsColdCoinStake { get; set; } + + public int Index { get; set; } + + public int? BlockHeight { get; set; } + + public string BlockHash { get; set; } + + public int? BlockIndex { get; set; } + + public string CreationTime { get; set; } + + public string ScriptPubKey { get; set; } + + public bool? IsPropagated { get; set; } + + public SpendingDetails SpendingDetails { get; set; } + } + + public class PaymentDetails + { + public string DestinationScriptPubKey { get; set; } + + public string DestinationAddress { get; set; } + + public int? OutputIndex { get; set; } + + public long Amount { get; set; } + + public bool? PayToSelf { get; set; } + } + + public class SpendingDetails + { + public SpendingDetails() + { + this.Payments = new List(); + } + + public string TransactionId { get; set; } + + public ICollection Payments { get; set; } + + public int? BlockHeight { get; set; } + + public int? BlockIndex { get; set; } + + public bool? IsCoinStake { get; set; } + + public string CreationTime { get; set; } + } } \ No newline at end of file diff --git a/src/Tests/Blockcore.IntegrationTests/Wallet/Data/txdb/wallet-with-funds.db b/src/Tests/Blockcore.IntegrationTests/Wallet/Data/txdb/wallet-with-funds.db new file mode 100644 index 000000000..f7142b131 Binary files /dev/null and b/src/Tests/Blockcore.IntegrationTests/Wallet/Data/txdb/wallet-with-funds.db differ diff --git a/src/Tests/Blockcore.IntegrationTests/Wallet/Data/wallet-with-funds.db b/src/Tests/Blockcore.IntegrationTests/Wallet/Data/wallet-with-funds.db deleted file mode 100644 index 182bc31ac..000000000 Binary files a/src/Tests/Blockcore.IntegrationTests/Wallet/Data/wallet-with-funds.db and /dev/null differ diff --git a/src/Tests/Blockcore.IntegrationTests/Wallet/WalletOperationsTests.cs b/src/Tests/Blockcore.IntegrationTests/Wallet/WalletOperationsTests.cs index 9fc17321d..8b2654f47 100644 --- a/src/Tests/Blockcore.IntegrationTests/Wallet/WalletOperationsTests.cs +++ b/src/Tests/Blockcore.IntegrationTests/Wallet/WalletOperationsTests.cs @@ -63,7 +63,7 @@ public WalletOperationsFixture() this.WalletWithFundsFilePath = Path.Combine(walletsFolderPath, filename); File.Copy(Path.Combine("Wallet", "Data", filename), this.WalletWithFundsFilePath, true); Directory.CreateDirectory(dbWalletsFolderPath); - File.Copy(Path.Combine("Wallet", "Data", dbfilename), Path.Combine(dbWalletsFolderPath, dbfilename), true); + File.Copy(Path.Combine("Wallet", "Data", "txdb", dbfilename), Path.Combine(dbWalletsFolderPath, dbfilename), true); var result = $"http://localhost:{stratisNode.ApiPort}/api".AppendPathSegment("wallet/load").PostJsonAsync(new WalletLoadRequest { diff --git a/src/Tests/Blockcore.IntegrationTests/Wallet/WalletPostOperationsTests.cs b/src/Tests/Blockcore.IntegrationTests/Wallet/WalletPostOperationsTests.cs index ef61e55ee..ec22f96f8 100644 --- a/src/Tests/Blockcore.IntegrationTests/Wallet/WalletPostOperationsTests.cs +++ b/src/Tests/Blockcore.IntegrationTests/Wallet/WalletPostOperationsTests.cs @@ -50,7 +50,7 @@ private void AddAndLoadWalletFileToWalletFolder(CoreNode node) this.walletFilePath = Path.Combine(walletsFolderPath, filename); File.Copy(Path.Combine("Wallet", "Data", filename), this.walletFilePath, true); Directory.CreateDirectory(dbWalletsFolderPath); - File.Copy(Path.Combine("Wallet", "Data", dbfilename), Path.Combine(dbWalletsFolderPath, dbfilename), true); + File.Copy(Path.Combine("Wallet", "Data", "txdb", dbfilename), Path.Combine(dbWalletsFolderPath, dbfilename), true); var result = $"http://localhost:{node.ApiPort}/api".AppendPathSegment("wallet/load").PostJsonAsync(new WalletLoadRequest {