forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate MutableState to TemporaryWSV and MutableStorage
- Loading branch information
Showing
6 changed files
with
163 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved. | ||
* http://soramitsu.co.jp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef IROHA_BLOCK_QUERY_HPP | ||
#define IROHA_BLOCK_QUERY_HPP | ||
|
||
namespace iroha { | ||
|
||
namespace ametsuchi { | ||
|
||
class BlockQuery { | ||
public: | ||
/** | ||
* Get all transactions of an account. | ||
* @param pub_key - account's first public key | ||
* @return observable of DAO Transaction | ||
*/ | ||
virtual rxcpp::observable<iroha::dao::Transaction> | ||
get_account_transactions(iroha::crypto::ed25519::pubkey_t pub_key) = 0; | ||
|
||
/** | ||
* Get all transactions with a certain asset | ||
* @param asset_full_name - full name of an asset, i.e. name#domain | ||
* @return observable of DAO Transaction | ||
*/ | ||
virtual rxcpp::observable<iroha::dao::Transaction> get_asset_transactions( | ||
std::string asset_full_name) = 0; | ||
|
||
/** | ||
* Get all transactions of a certain wallet | ||
* @param wallet_id - unique wallet | ||
* @return observable of DAO Transaction | ||
*/ | ||
virtual rxcpp::observable<iroha::dao::Transaction> | ||
get_wallet_transactions(std::string wallet_id) = 0; | ||
}; | ||
|
||
} // namespace ametsuchi | ||
|
||
} // namespace iroha | ||
|
||
#endif // IROHA_BLOCK_QUERY_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved. | ||
* http://soramitsu.co.jp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef IROHA_COMMANDEXECUTOR_HPP | ||
#define IROHA_COMMANDEXECUTOR_HPP | ||
|
||
namespace iroha { | ||
|
||
namespace ametsuchi { | ||
|
||
class CommandExecutor { | ||
virtual void execute(dao::Command command) = 0; | ||
}; | ||
|
||
} // namespace ametsuchi | ||
|
||
}// namespace iroha | ||
|
||
#endif //IROHA_COMMANDEXECUTOR_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved. | ||
* http://soramitsu.co.jp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef IROHA_MUTABLESTORAGE_HPP | ||
#define IROHA_MUTABLESTORAGE_HPP | ||
|
||
#include <ametsuchi/command_executor.hpp> | ||
|
||
namespace iroha { | ||
namespace ametsuchi { | ||
|
||
class MutableStorage : public WSVQuery, public BlockQuery { | ||
virtual bool apply( | ||
dao::Block block, | ||
std::function<void(dao::Block, CommandExecutor, WSVQuery)> | ||
function) = 0; | ||
}; | ||
|
||
} // namespace ametsuchi | ||
} // namespace iroha | ||
|
||
#endif // IROHA_MUTABLESTORAGE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters