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.
Merge branch 'feature/missed-stubs' into develop
# Conflicts: # irohad/CMakeLists.txt # irohad/main/application.cpp # irohad/main/application.hpp
- Loading branch information
Showing
26 changed files
with
503 additions
and
141 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,49 @@ | ||
/** | ||
* 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_MUTABLE_FACTORY_HPP | ||
#define IROHA_MUTABLE_FACTORY_HPP | ||
|
||
#include <memory> | ||
#include "ametsuchi/mutable_storage.hpp" | ||
|
||
namespace iroha { | ||
namespace ametsuchi { | ||
|
||
class MutableFactory { | ||
public: | ||
/** | ||
* Creates a mutable storage from the current state. | ||
* Mutable storage is the only way to commit the block to the ledger. | ||
* @return Created mutable storage | ||
*/ | ||
virtual std::unique_ptr<MutableStorage> createMutableStorage() = 0; | ||
|
||
/** | ||
* Commit mutable storage to Ametsuchi. | ||
* This transforms Ametsuchi to the new state consistent with | ||
* MutableStorage. | ||
* @param mutableStorage | ||
*/ | ||
virtual void commit(std::unique_ptr<MutableStorage> mutableStorage) = 0; | ||
|
||
virtual ~MutableFactory() = default; | ||
}; | ||
|
||
} // namespace ametsuchi | ||
} // namespace iroha | ||
#endif //IROHA_MUTABLE_FACTORY_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* 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_TEMPORARY_FACTORY_HPP | ||
#define IROHA_TEMPORARY_FACTORY_HPP | ||
|
||
#include <memory> | ||
#include "ametsuchi/temporary_wsv.hpp" | ||
|
||
namespace iroha { | ||
namespace ametsuchi { | ||
|
||
class TemporaryFactory { | ||
public: | ||
/** | ||
* Creates a temporary world state view from the current state. | ||
* Temporary state will be not committed and will be erased on destructor | ||
* call. | ||
* Temporary state might be used for transaction validation. | ||
* @return Created temporary wsv | ||
*/ | ||
virtual std::unique_ptr<TemporaryWsv> createTemporaryWsv() = 0; | ||
|
||
virtual ~TemporaryFactory() = default; | ||
}; | ||
|
||
} // namespace ametsuchi | ||
} // namespace iroha | ||
#endif //IROHA_TEMPORARY_FACTORY_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* 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_STATELESS_RESPONSE_HPP | ||
#define IROHA_STATELESS_RESPONSE_HPP | ||
|
||
#include <model/transaction_response.hpp> | ||
|
||
namespace iroha { | ||
namespace model { | ||
|
||
/** | ||
* Transaction response that contains | ||
*/ | ||
struct StatelessResponse : TransactionResponse { | ||
|
||
/** | ||
* Is stateless validation passed | ||
*/ | ||
bool passed; | ||
}; | ||
} // namespace model | ||
} // namespace iroha | ||
#endif //IROHA_STATELESS_RESPONSE_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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
add_library(networking | ||
impl/network_api.cpp | ||
impl/peer_communication_service.cpp | ||
peer_communication_stub.cpp | ||
) | ||
|
||
|
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,49 @@ | ||
/** | ||
* 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_CONSENSUS_GATE_HPP | ||
#define IROHA_CONSENSUS_GATE_HPP | ||
|
||
#include <rxcpp/rx.hpp> | ||
#include <model/block.hpp> | ||
|
||
namespace iroha { | ||
namespace network { | ||
|
||
/** | ||
* Public api of consensus module | ||
*/ | ||
class ConsensusGate { | ||
public: | ||
|
||
/** | ||
* Providing data for consensus for voting | ||
*/ | ||
virtual void vote(model::Block) = 0; | ||
|
||
/** | ||
* Emit committed blocks | ||
* Note: committed block may be not satisfy for top block in ledger | ||
* because synchronization reasons | ||
*/ | ||
virtual rxcpp::observable <model::Block> on_commit() = 0; | ||
|
||
virtual ~ConsensusGate() = default; | ||
}; | ||
} // namespace network | ||
} // namespace iroha | ||
#endif //IROHA_CONSENSUS_GATE_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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.