1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

integrating the existing state of TON Storage / TON Payments / CPS Fift development branches

This commit is contained in:
ton 2020-05-27 22:10:46 +04:00
parent 040df63c98
commit 4e2624459b
153 changed files with 10760 additions and 1695 deletions

37
storage/TorrentMeta.h Normal file
View file

@ -0,0 +1,37 @@
#pragma once
#include "TorrentHeader.h"
#include "TorrentInfo.h"
#include "td/utils/optional.h"
namespace ton {
//
// torrent_file#6a7181e0 flags:(## 32) info_boc_size:uint32
// root_proof_boc_size:flags.0?uint32
// info_boc:(info_boc_size * [uint8])
// root_proof_boc:flags.0?(root_proof_boc_size * [uint8])
// header:flags.1?TorrentHeader = TorrentMeta;
//
struct TorrentMeta {
TorrentMeta() = default;
explicit TorrentMeta(TorrentInfo info, td::Ref<vm::Cell> root_proof = {}, td::optional<TorrentHeader> header = {})
: info(std::move(info)), root_proof(std::move(root_proof)), header(std::move(header)) {
}
TorrentInfo info;
td::Ref<vm::Cell> root_proof;
td::optional<TorrentHeader> header;
static td::Result<TorrentMeta> deserialize(td::Slice data);
std::string serialize() const;
static constexpr td::uint64 type = 0x6a7181e0;
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
};
} // namespace ton