Skip to content

Commit 10e2787

Browse files
committed
All functions wallet is ready.
Signed-off-by: Markuu-s <[email protected]>
1 parent 836ad62 commit 10e2787

File tree

5 files changed

+280
-371
lines changed

5 files changed

+280
-371
lines changed

core/api/wallet/local_wallet.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,21 @@ namespace fc::api {
7474
std::vector<Address> out;
7575
out.reserve(all.size());
7676

77-
std::string k_name_prefix = "wallet-"; // TODO not needed
77+
std::string k_name_prefix = "wallet-"; // TODO not needed
7878
for (auto &a : all) {
7979
fmt::print(encodeToString(a));
80-
if (encodeToString(a).substr(0, k_name_prefix.size())
81-
== k_name_prefix) {
82-
std::string name = encodeToString(a).erase(0, k_name_prefix.size());
83-
OUTCOME_TRY(address, primitives::address::decodeFromString(name));
84-
if (seen.find(address) != seen.end()) {
85-
continue;
86-
}
87-
seen.insert(address);
88-
89-
out.push_back(address);
80+
// if (encodeToString(a).substr(0, k_name_prefix.size())
81+
// == k_name_prefix) {
82+
// std::string name = encodeToString(a).erase(0,
83+
// k_name_prefix.size());
84+
OUTCOME_TRY(address,
85+
primitives::address::decodeFromString(encodeToString(a)));
86+
if (seen.find(address) != seen.end()) {
87+
continue;
9088
}
89+
seen.insert(address);
90+
91+
out.push_back(address);
9192
}
9293

9394
std::sort(out.begin(), out.end());
@@ -118,6 +119,10 @@ namespace fc::api {
118119
OUTCOME_TRY(has, key_store->has(address));
119120
if (has) {
120121
OUTCOME_TRY(key_store->remove(address));
122+
// OUTCOME_TRY(default_address, api->WalletDefaultAddress());
123+
// if (address == default_address) {
124+
// wallet_default_address->remove();
125+
// }
121126
return outcome::success();
122127
}
123128
return ERROR_TEXT("WalletDelete: Address does not exist");

core/cli/cli.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ namespace fc::cli {
128128
}
129129

130130
void flush() {
131-
std::vector<int> colLenghts;
132-
colLenghts.reserve(columns.size());
131+
std::vector<int> colLenghts(columns.size());
132+
// colLenghts.reserve(columns.size());
133133

134134
std::map<int, std::string> header;
135135
for (size_t i = 0; i < columns.size(); ++i) {

core/cli/example/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ target_link_libraries(cli_example
88
cli
99
rpc
1010
api_ipfs_datastore
11+
file
1112
)

0 commit comments

Comments
 (0)