Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Add GetPendingTransactions query to shared model #1532

Merged
merged 3 commits into from
Jul 9, 2018

Conversation

igor-egorov
Copy link
Contributor

Description of the Change

This PR adds an interface of GetPendingTransactions query to shared model.
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

Benefits

It is a starting point for further development of GetPendingTransactions feature.

Possible Drawbacks

None ?

Usage Examples or Tests

build everything and test everything, even bindings

@igor-egorov igor-egorov requested review from l4l and kamilsa July 3, 2018 13:10
@igor-egorov igor-egorov added the needs-review pr awaits review from maintainers label Jul 3, 2018
l4l
l4l previously requested changes Jul 3, 2018
:header: "Field", "Description", "Constraint", "Example"
:widths: 15, 30, 20, 15

"Transactions", "an array of transactions for given account", "Committed transactions", "{tx1, tx2…}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehm, maybe non-commited?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or "list of unsigned transactions or batches"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsigned is not really a good word here. Becuase [valid] multisig txes either signed or haven't been sent yet

#ifndef IROHA_QUERY_EXECUTION_HPP
#define IROHA_QUERY_EXECUTION_HPP

#include "ametsuchi/block_query.hpp"
#include "ametsuchi/wsv_query.hpp"
#include "builders/protobuf/builder_templates/query_response_template.hpp"
#include "builders/protobuf/builder_templates/blocks_query_template.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. This was redundant.

QueryProcessingFactory::executeGetPendingTransactions(
const shared_model::interface::GetPendingTransactions &query,
const shared_model::interface::types::AccountIdType &query_creator) {
std::vector<shared_model::proto::Transaction> txs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always empty?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is temporary unless query execution is implemented. Please leave a comment about that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty for now.

Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, haven't noticed that. Maybe you consider implementing mst? It's already implemented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok. Now we have common understanding. TODO about missing implementation is placed on a line below.

@l4l l4l added the query All that relates to the iroha querying label Jul 3, 2018
kamilsa
kamilsa previously requested changes Jul 4, 2018
:header: "Field", "Description", "Constraint", "Example"
:widths: 15, 30, 20, 15

"Transactions", "an array of transactions for given account", "Committed transactions", "{tx1, tx2…}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or "list of unsigned transactions or batches"

QueryProcessingFactory::executeGetPendingTransactions(
const shared_model::interface::GetPendingTransactions &query,
const shared_model::interface::types::AccountIdType &query_creator) {
std::vector<shared_model::proto::Transaction> txs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is temporary unless query execution is implemented. Please leave a comment about that

@igor-egorov igor-egorov dismissed stale reviews from l4l and kamilsa July 4, 2018 11:08

Requested changes were applied.

@igor-egorov igor-egorov requested review from l4l and kamilsa July 4, 2018 11:09
@@ -192,6 +182,16 @@ of signatures required to consider a transaction signed.
The default value is 1.
Each account can link additional public keys and increase own quorum number.

Role
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please revert reordering, it differs from the pr aim

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. It was an intended change. Now the topics are sorted alphabetically if no other more valuable factors involved (e.g. logical composition).

Atomic Batch
------------

All the transactions within an atomic batch should pass `stateful validation`_ for the batch to be applied to a ledger.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add sentence saying that order of transactions in atomic batch is preserved

@igor-egorov igor-egorov force-pushed the feature/query-pending-transactions branch 2 times, most recently from be27b5a to 1082bee Compare July 6, 2018 13:32
Igor Egorov added 3 commits July 6, 2018 20:08
Now the query returns empty list of transactions.
Later the behavior will be also implemented.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
@igor-egorov igor-egorov force-pushed the feature/query-pending-transactions branch from 1082bee to 5b2edbb Compare July 6, 2018 17:08
@igor-egorov igor-egorov merged commit 1dc242b into develop Jul 9, 2018
@igor-egorov igor-egorov deleted the feature/query-pending-transactions branch July 9, 2018 07:42
stinger112 pushed a commit to stinger112/iroha that referenced this pull request Jul 19, 2018
…s#1532)

This PR adds an interface of GetPendingTransactions query to shared model. 
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

It is a starting point for further development of GetPendingTransactions feature.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
l4l pushed a commit that referenced this pull request Jul 25, 2018
This PR adds an interface of GetPendingTransactions query to shared model. 
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

It is a starting point for further development of GetPendingTransactions feature.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
l4l pushed a commit that referenced this pull request Jul 25, 2018
This PR adds an interface of GetPendingTransactions query to shared model.
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

It is a starting point for further development of GetPendingTransactions feature.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
l4l pushed a commit that referenced this pull request Jul 25, 2018
This PR adds an interface of GetPendingTransactions query to shared model.
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

It is a starting point for further development of GetPendingTransactions feature.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
l4l pushed a commit that referenced this pull request Jul 25, 2018
This PR adds an interface of GetPendingTransactions query to shared model.
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

It is a starting point for further development of GetPendingTransactions feature.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
l4l pushed a commit that referenced this pull request Jul 25, 2018
This PR adds an interface of GetPendingTransactions query to shared model.
Currently, the query does NOT perform actual information retrieving (will be implemented after appearing of transactions batches support in develop branch).
Additionally, this pr provides documentation for the new query.

It is a starting point for further development of GetPendingTransactions feature.

Signed-off-by: Igor Egorov <igor@soramitsu.co.jp>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-review pr awaits review from maintainers query All that relates to the iroha querying
Development

Successfully merging this pull request may close these issues.

3 participants