Skip to content

Commit

Permalink
Update TODO info
Browse files Browse the repository at this point in the history
Add time and person, deleted unrelevant comments

Signed-off-by: Nikolay Yushkevich <[email protected]>
  • Loading branch information
neewy committed Oct 13, 2017
1 parent b539611 commit 5a35603
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 40 deletions.
2 changes: 2 additions & 0 deletions iroha-cli/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace iroha_cli {
auto pb_tx = factory.serialize(tx);
// Send to iroha:
response.status = command_client_.Torii(pb_tx);

//TODO 12/10/2017 neewy implement return of real transaction status IR-494
response.answer = TxStatus::OK;

return response;
Expand Down
2 changes: 1 addition & 1 deletion iroha-cli/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace iroha_cli {
T answer;
};

//TODO: check if we need more status codes
//TODO 13/09/17 luckychess: check if we need more status codes IR-494
enum TxStatus { OK };

CliClient(std::string target_ip, int port);
Expand Down
4 changes: 2 additions & 2 deletions iroha-cli/impl/query_response_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace iroha_cli {
auto account = response.account_response().account();
log_->info("[Account]:");
log_->info("-Id:- {}", account.account_id());
// TODO : print permissions
// TODO 06/08/17 grimadas: print permissions
log_->info("-Domain- {}", account.domain_name());
}

Expand Down Expand Up @@ -106,7 +106,7 @@ namespace iroha_cli {
std::for_each(txs.begin(), txs.end(), [this](auto tx) {
log_->info("-[tx]-");
log_->info("--[Creator Id] -- {}", tx.payload().creator_account_id());
// TODO: add other fields: tx head, tx body
// TODO 13/09/17 grimadas: add other fields: tx head, tx body
});
}

Expand Down
2 changes: 1 addition & 1 deletion iroha-cli/interactive/impl/interactive_query_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ namespace iroha_cli {
QueryParams params) {
auto asset_id = params[0];
auto query = std::make_shared<GetAssetInfo>(asset_id);
// TODO: refactor, move query meta data outside of this function
//TODO 26/09/17 grimadas: refactor, move query meta data outside of this function
generator_.setQueryMetaData(query, local_time_, creator_, counter_);
return query;
}
Expand Down
4 changes: 2 additions & 2 deletions iroha-cli/interactive/impl/interactive_transaction_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace iroha_cli {
std::shared_ptr<iroha::model::Command>
InteractiveTransactionCli::parseCreateRole(
std::vector<std::string> params) {
// TODO: implement scheme on working with permissions
// TODO grimadas: implement scheme on working with permissions
auto role = params[0];
std::vector<std::string> perms = {};
return std::make_shared<CreateRole>(role, perms);
Expand Down Expand Up @@ -343,7 +343,7 @@ namespace iroha_cli {
std::shared_ptr<iroha::model::Command>
InteractiveTransactionCli::parseSubtractAssetQuantity(
std::vector<std::string> params) {
// TODO: implement
// TODO grimadas: implement
std::cout << "Not implemented" << std::endl;
return nullptr;
}
Expand Down
8 changes: 2 additions & 6 deletions iroha-cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
#include "responses.pb.h"
#include "validators.hpp"

// ** Genesis Block and Provisioning ** //
// Reference is here (TODO: move to doc):
// https://hackmd.io/GwRmwQ2BmCFoCsAGARtOAWBIBMcAcS0GcAZjhNNPvpAKZIDGQA==

DEFINE_string(config, "", "Trusted peer's ip addresses");
// DEFINE_validator(config, &iroha_cli::validate_config);

Expand Down Expand Up @@ -146,7 +142,7 @@ int main(int argc, char *argv[]) {
output_file << jsonToString(doc);
logger->info("File saved to genesis.block");
} else if (FLAGS_interactive) {
// TODO: add login logic (e.g. password check)
// TODO 13/09/17 grimadas: add login logic (e.g. password check) IR-???
if (FLAGS_name.empty()) {
logger->error("Specify account name");
return -1;
Expand All @@ -167,7 +163,7 @@ int main(int argc, char *argv[]) {
FLAGS_name);
return EXIT_FAILURE;
}
// TODO: Init counters from Iroha, or read from disk?
// TODO 13/09/17 grimadas: Init counters from Iroha, or read from disk? IR-334
InteractiveCli interactiveCli(
FLAGS_name,
0,
Expand Down
4 changes: 2 additions & 2 deletions iroha-cli/validators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace iroha_cli {

bool validate_port(const char*, gflags::int32 port) {
// fixme port max num macro
// FIXME 25/07/17 Kitsu port max num macro
if (port > 0 && port < 65535) return 1;

std::cout<<"Port can be only in range (0, 32768)\n";
Expand All @@ -33,7 +33,7 @@ namespace iroha_cli {
std::stringstream ss(s);
std::string tmp;
while (std::getline(ss, tmp, ';')){
// fixme macro
// FIXME 25/07/17 Kitsu macro
if (tmp.size() != 32) {
printf("\"%s\" doesn't look like pubkey (size != 32)\n", tmp.c_str());
return 0;
Expand Down
4 changes: 2 additions & 2 deletions irohad/ametsuchi/impl/flat_file/flat_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace iroha::ametsuchi;

const uint32_t DIGIT_CAPACITY = 16;

// todo rework separator with platform independent approach
// TODO 19/08/17 Muratov rework separator with platform independent approach IR-495
const std::string SEPARATOR = "/";

/**
Expand Down Expand Up @@ -135,7 +135,7 @@ long file_size(const std::string &filename) {
std::unique_ptr<FlatFile> FlatFile::create(const std::string &path) {
auto log_ = logger::log("FlatFile::create()");

// todo change creating folder with system independent approach
// TODO 19/08/17 Muratov change creating folder with system independent approach IR-496
if (mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) {
if (errno != EEXIST) {
log_->error("Cannot create storage dir: {}", path);
Expand Down
4 changes: 2 additions & 2 deletions irohad/ametsuchi/index/index_mediator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ namespace iroha {
iroha::protocol::Block block;
block.ParseFromArray(blob.data(), blob.size());
ametsuchi_->insert_block_index(last_block_id_index,
std::string()); // TODO calculate hash
std::string()); // TODO 19/06/17 Lebedev: calculate hash
for (int i = 0; i < block.body().txs_size(); ++i) {
ametsuchi_->insert_tx_index(
i, std::string(), last_block_id_index); // TODO calculate hash
i, std::string(), last_block_id_index); // TODO 19/06/17 Lebedev: calculate hash
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion irohad/consensus/yac/impl/cluster_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace iroha {

model::Peer ClusterOrdering::currentLeader() {
if (index_ >= order_.size()) {
index_ = 0; // todo dangerous indexing, what if order_.size == 0?
index_ = 0; // TODO 01/08/17 Muratov: dangerous indexing, what if order_.size == 0? IR-???
}
return order_.at(index_);
}
Expand Down
2 changes: 1 addition & 1 deletion irohad/consensus/yac/impl/peer_orderer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace iroha {

nonstd::optional<ClusterOrdering> PeerOrdererImpl::getOrdering(
YacHash hash) {
// todo implement effective ordering based on hash value
// TODO 01/08/17 Muratov: implement effective ordering based on hash value IR-???
return getInitialOrdering();
}

Expand Down
4 changes: 2 additions & 2 deletions irohad/consensus/yac/impl/yac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ namespace iroha {

if (answer->reject.has_value()) {
log_->warn("reject case");
// todo work on reject case
// TODO 14/08/17 Muratov: work on reject case IR-497
}
vote_storage_.markAsProcessedState(proposal_hash);
}
closeRound();
};

void Yac::applyReject(model::Peer from, RejectMessage reject) {
// todo apply to vote storage
// TODO 01/08/17 Muratov: apply to vote storage IR-497
closeRound();
};

Expand Down
2 changes: 1 addition & 1 deletion irohad/consensus/yac/impl/yac_hash_provider_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace iroha {

YacHash YacHashProviderImpl::makeHash(const model::Block &block) const {
YacHash result;
// todo add proposal hash from block.proposal_hash
// TODO 01/08/17 Muratov: add proposal hash from block.proposal_hash IR-???
auto hex_hash = block.hash.to_hexstring();
result.proposal_hash = hex_hash;
result.block_hash = hex_hash;
Expand Down
6 changes: 3 additions & 3 deletions irohad/consensus/yac/transport/impl/network_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace iroha {
auto it = context->client_metadata().find("address");
if (it == context->client_metadata().end()) {
log_->error("Missing source address");
// TODO handle missing source address
// TODO 01/08/17 Lebedev: handle missing source address IR-???
return grpc::Status::CANCELLED;
}
auto address = std::string(it->second.data(), it->second.size());
Expand All @@ -129,7 +129,7 @@ namespace iroha {
auto it = context->client_metadata().find("address");
if (it == context->client_metadata().end()) {
log_->error("Missing source address");
// TODO handle missing source address
// TODO 01/08/17 Lebedev: handle missing source address IR-???
return grpc::Status::CANCELLED;
}
auto address = std::string(it->second.data(), it->second.size());
Expand All @@ -156,7 +156,7 @@ namespace iroha {
auto it = context->client_metadata().find("address");
if (it == context->client_metadata().end()) {
log_->error("Missing source address");
// TODO handle missing source address
// TODO 01/08/17 Lebedev: handle missing source address IR-???
return grpc::Status::CANCELLED;
}
auto address = std::string(it->second.data(), it->second.size());
Expand Down
2 changes: 1 addition & 1 deletion irohad/main/iroha_conf_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace config_members {
const char* BlockStorePath = "block_store_path";
const char* ToriiPort = "torii_port"; // TODO: Needs AddPeer.
const char* ToriiPort = "torii_port";
const char* KeyPairPath = "key_pair_path";
const char* PgOpt = "pg_opt";
const char* RedisHost = "redis_host";
Expand Down
2 changes: 1 addition & 1 deletion irohad/model/block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace iroha {
/**
* Calculated as hash(PAYLOAD field)
* NOT a part of payload
* TODO: replace by a method call
* TODO 27/09/17 luckychess: replace by a method call IR-???
*/
hash256_t hash{};

Expand Down
2 changes: 1 addition & 1 deletion irohad/model/commands/subtract_asset_quantity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef IROHA_SUBTRACT_ASSET_QUANTITY_HPP
#define IROHA_SUBTRACT_ASSET_QUANTITY_HPP

// TODO: implement in next versions
// TODO 12/07/17 grimadas: implement in next versions IR-498
// Subtract asset quantity from a given account from the system.
// Only issuer can do this

Expand Down
2 changes: 1 addition & 1 deletion irohad/model/domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace iroha {

/**
* Domain Model
* //TODO: rethink in next version, currently only default domain is used
* //TODO 12/07/17 Grimadas: rethink in next version, currently only default domain is used IR-???
*/
struct Domain {
/**
Expand Down
2 changes: 1 addition & 1 deletion irohad/model/generators/impl/command_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace iroha {
const std::string &account_id,
const std::string &asset_id,
const Amount &amount) {
// TODO: implement
// TODO 13/09/17 grimadas: implement IR-498
return nullptr;
}

Expand Down
10 changes: 5 additions & 5 deletions irohad/model/impl/query_execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ iroha::model::QueryProcessingFactory::QueryProcessingFactory(
bool iroha::model::QueryProcessingFactory::validate(
const model::GetAssetInfo& query) {
auto creator = _wsvQuery->getAccount(query.creator_account_id);
// TODO: check signatures
// TODO 26/09/17 grimadas: check signatures IR-499
return
// Creator account exits
// TODO: add permission check
Expand All @@ -45,7 +45,7 @@ bool iroha::model::QueryProcessingFactory::validate(
bool iroha::model::QueryProcessingFactory::validate(
const model::GetRoles& query) {
auto creator = _wsvQuery->getAccount(query.creator_account_id);
// TODO: check signatures
// TODO 26/09/17 grimadas: check signatures IR-499
return
// Creator account exits
// TODO: add permission check
Expand All @@ -54,7 +54,7 @@ bool iroha::model::QueryProcessingFactory::validate(

bool QueryProcessingFactory::validate(const model::GetRolePermissions& query) {
auto creator = _wsvQuery->getAccount(query.creator_account_id);
// TODO: check signatures
// TODO 26/09/17 grimadas: check signatures IR-499
return
// Creator account exits
// TODO: add permission check
Expand All @@ -64,7 +64,7 @@ bool QueryProcessingFactory::validate(const model::GetRolePermissions& query) {
bool iroha::model::QueryProcessingFactory::validate(
const model::GetAccount& query) {
auto creator = _wsvQuery->getAccount(query.creator_account_id);
// TODO: check signatures
// TODO 20/07/17 grimadas: check signatures IR-499
return
// Creator account exits
creator.has_value() &&
Expand Down Expand Up @@ -238,7 +238,7 @@ iroha::model::QueryProcessingFactory::executeGetSignatories(
std::shared_ptr<iroha::model::QueryResponse>
iroha::model::QueryProcessingFactory::execute(
std::shared_ptr<const model::Query> query) {
// TODO: change to handler map or/with templates
// TODO 26/09/17 Nasrulin: change to handler map or/with templates IR-???
if (instanceof <iroha::model::GetAccount>(query.get())) {
auto qry = std::static_pointer_cast<const iroha::model::GetAccount>(query);

Expand Down
3 changes: 1 addition & 2 deletions irohad/model/peer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ namespace std {
template<>
struct hash<iroha::model::Peer> {
std::size_t operator()(const iroha::model::Peer &obj) const {
// todo add pubkey hash combination to result
return std::hash<std::string>()(obj.address);
return std::hash<std::string>()(obj.address + obj.pubkey.to_string());
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions irohad/simulator/impl/simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ namespace iroha {
new_block.prev_hash = last_block.value().hash;
new_block.transactions = proposal.transactions;
new_block.txs_number = proposal.transactions.size();
new_block.created_ts = 0; // todo set timestamp from proposal
new_block.merkle_root.fill(0); // todo make effective impl
new_block.created_ts = 0; // TODO 14/08/17 Muratov set timestamp from proposal & for new model IR-501
new_block.merkle_root.fill(0); // TODO 14/08/17 Muratov make effective impl IR-464
new_block.hash = hash(new_block);
crypto_provider_->sign(new_block);

Expand Down

0 comments on commit 5a35603

Please sign in to comment.