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

updated func and tonlib

This commit is contained in:
ton 2020-02-15 20:03:17 +04:00
parent 493ae2410c
commit a73d202ba2
50 changed files with 1340 additions and 271 deletions

View file

@ -51,7 +51,7 @@ ton.blockId workchain:int32 shard:int64 seqno:int32 = internal.BlockId;
ton.blockIdExt workchain:int32 shard:int64 seqno:int32 root_hash:bytes file_hash:bytes = ton.BlockIdExt;
raw.fullAccountState balance:int64 code:bytes data:bytes last_transaction_id:internal.transactionId block_id:ton.blockIdExt frozen_hash:bytes sync_utime:int53 = raw.FullAccountState;
raw.message source:string destination:string value:int64 fwd_fee:int64 ihr_fee:int64 created_lt:int64 body_hash:bytes message:bytes = raw.Message;
raw.message source:string destination:string value:int64 fwd_fee:int64 ihr_fee:int64 created_lt:int64 body_hash:bytes message:bytes is_message_encrypted:Bool = raw.Message;
raw.transaction utime:int53 data:bytes transaction_id:internal.transactionId fee:int64 storage_fee:int64 other_fee:int64 in_msg:raw.message out_msgs:vector<raw.message> = raw.Transaction;
raw.transactions transactions:vector<raw.transaction> previous_transaction_id:internal.transactionId = raw.Transactions;

Binary file not shown.

View file

@ -34,7 +34,8 @@ int TD_TL_writer_java::get_max_arity() const {
bool TD_TL_writer_java::is_built_in_simple_type(const std::string &name) const {
return name == "Bool" || name == "Int32" || name == "Int53" || name == "Int64" || name == "Double" ||
name == "String" || name == "Bytes" || name == "SecureString" || name == "SecureBytes";
name == "String" || name == "Bytes" || name == "SecureString" || name == "SecureBytes" || name == "Object" ||
name == "Function";
}
bool TD_TL_writer_java::is_built_in_complex_type(const std::string &name) const {
@ -168,6 +169,12 @@ std::string TD_TL_writer_java::gen_type_name(const tl::tl_tree_type *tree_type)
if (name == "Bytes" || name == "SecureBytes") {
return "byte[]";
}
if (name == "Object") {
return gen_base_type_class_name(0);
}
if (name == "Function") {
return gen_base_function_class_name();
}
if (name == "Vector") {
assert(t->arity == 1);

View file

@ -24,8 +24,10 @@
namespace td {
bool TD_TL_writer_jni_cpp::is_built_in_simple_type(const std::string &name) const {
assert(name != "function");
return name == "Bool" || name == "Int32" || name == "Int53" || name == "Int64" || name == "Double" ||
name == "String" || name == "Bytes" || name == "SecureString" || name == "SecureBytes";
name == "String" || name == "Bytes" || name == "SecureString" || name == "SecureBytes" || name == "Function" ||
name == "Object";
}
bool TD_TL_writer_jni_cpp::is_built_in_complex_type(const std::string &name) const {
@ -197,6 +199,7 @@ std::string TD_TL_writer_jni_cpp::gen_type_fetch(const std::string &field_name,
const tl::tl_tree_type *child = static_cast<const tl::tl_tree_type *>(tree_type->children[0]);
res = gen_vector_fetch(field_name, child, vars, parser_type);
} else {
assert(gen_main_class_name(tree_type->type) != "function");
if (field_name == "") {
return gen_main_class_name(tree_type->type) + "::fetch(env, p)";
}

View file

@ -24,7 +24,8 @@ namespace td {
bool TD_TL_writer_jni_h::is_built_in_simple_type(const std::string &name) const {
return name == "Bool" || name == "Int32" || name == "Int53" || name == "Int64" || name == "Double" ||
name == "String" || name == "Bytes" || name == "SecureString" || name == "SecureBytes";
name == "String" || name == "Bytes" || name == "SecureString" || name == "SecureBytes" || name == "Function" ||
name == "Object";
}
bool TD_TL_writer_jni_h::is_built_in_complex_type(const std::string &name) const {

View file

@ -124,6 +124,12 @@ std::string TD_TL_writer::gen_class_name(std::string name) const {
if (name == "Object") {
//assert(false);
}
if (name == "function") {
return "Function";
}
if (name == "object") {
return "Object";
}
if (name == "#") {
return "std::int32_t";
}