mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add checks for external messages
This commit is contained in:
parent
69d0472510
commit
3384d204d2
11 changed files with 396 additions and 119 deletions
|
@ -18,9 +18,11 @@
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "interfaces/validator-manager.h"
|
||||
#include "validator/interfaces/external-message.h"
|
||||
#include "auto/tl/ton_api.h"
|
||||
#include "adnl/utils.hpp"
|
||||
#include "block/transaction.h"
|
||||
|
||||
namespace ton {
|
||||
|
||||
|
@ -31,6 +33,8 @@ class ExtMessageQ : public ExtMessage {
|
|||
AccountIdPrefixFull addr_prefix_;
|
||||
td::BufferSlice data_;
|
||||
Hash hash_;
|
||||
ton::WorkchainId wc_;
|
||||
ton::StdSmcAddress addr_;
|
||||
|
||||
public:
|
||||
static constexpr unsigned max_ext_msg_size = 65535;
|
||||
|
@ -47,8 +51,23 @@ class ExtMessageQ : public ExtMessage {
|
|||
Hash hash() const override {
|
||||
return hash_;
|
||||
}
|
||||
ExtMessageQ(td::BufferSlice data, td::Ref<vm::Cell> root, AccountIdPrefixFull shard);
|
||||
ton::WorkchainId wc() const override {
|
||||
return wc_;
|
||||
}
|
||||
|
||||
ton::StdSmcAddress addr() const override {
|
||||
return addr_;
|
||||
}
|
||||
|
||||
ExtMessageQ(td::BufferSlice data, td::Ref<vm::Cell> root, AccountIdPrefixFull shard, ton::WorkchainId wc, ton::StdSmcAddress addr);
|
||||
static td::Result<td::Ref<ExtMessageQ>> create_ext_message(td::BufferSlice data);
|
||||
static void run_message(td::BufferSlice data, td::actor::ActorId<ton::validator::ValidatorManager> manager,
|
||||
td::Promise<td::Unit> promise);
|
||||
static bool run_message_on_account(ton::WorkchainId wc,
|
||||
block::Account* acc,
|
||||
UnixTime utime, LogicalTime lt,
|
||||
td::Ref<vm::Cell> msg_root,
|
||||
std::unique_ptr<block::ConfigInfo> config);
|
||||
};
|
||||
|
||||
} // namespace validator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue