mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
TON Validation Contest: Reference solution and grader
This commit is contained in:
parent
1ee3e5d6a7
commit
d8e29f8b67
13 changed files with 6066 additions and 6 deletions
17
contest/solution/solution.cpp
Normal file
17
contest/solution/solution.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "solution.hpp"
|
||||
|
||||
#include "vm/boc.h"
|
||||
#include "block-auto.h"
|
||||
#include "contest-validate-query.hpp"
|
||||
|
||||
void run_contest_solution(ton::BlockIdExt block_id, td::BufferSlice block_data, td::BufferSlice colldated_data,
|
||||
td::Promise<td::BufferSlice> promise) {
|
||||
TRY_RESULT_PROMISE(promise, root, vm::std_boc_deserialize(block_data));
|
||||
block::gen::Block::Record rec;
|
||||
if (!block::gen::t_Block.cell_unpack(root, rec)) {
|
||||
return promise.set_error(td::Status::Error("failed to unpack block"));
|
||||
}
|
||||
TRY_RESULT_PROMISE(promise, res, vm::std_boc_serialize(rec.state_update));
|
||||
td::actor::create_actor<solution::ContestValidateQuery>(
|
||||
"validate", block_id, std::move(block_data), std::move(colldated_data), std::move(promise)).release();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue