Skip to content

Commit

Permalink
Add stateless validator impl
Browse files Browse the repository at this point in the history
  • Loading branch information
MizukiSonoko committed Jun 13, 2017
1 parent eddad4c commit f5f6919
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions core/validation/stateless/validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
#include "validator.hpp"

#include <common/datetime.hpp>
namespace validator {
namespace stateless {
using Block = iroha::protocol::Block;
bool validate(const Block& block){
// ToDo
// 鍵長がおかしい
// 要素が抜けてる
return true;
using Transaction = iroha::protocol::Transaction;
bool validate(const Transaction& tx){
return
tx.header().created_time() < common::datetime::unixtime() && // 過去に作られたTxか
tx.header().signature_size() != 0 && // 電子署名は含まれているか
tx.body().creator_pubkey().size() == 32; // 公開鍵は32byteか ToDo configurable
}
};
};
4 changes: 2 additions & 2 deletions core/validation/stateless/validator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ limitations under the License.

namespace validator {
namespace stateless {
using Block = iroha::protocol::Block;
bool validate(const Block &);
using Transaction = iroha::protocol::Transaction;
bool validate(const Transaction &);
};
};

Expand Down

0 comments on commit f5f6919

Please sign in to comment.