mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated liteserver
- new methods for liteserver/liteclient - added ADNL/DHT client-only work mode - fixed crash in ADNL
This commit is contained in:
parent
acf16718e6
commit
53ec9684bd
70 changed files with 816 additions and 322 deletions
|
|
@ -39,3 +39,9 @@
|
|||
int seqno() method_id {
|
||||
return get_data().begin_parse().preload_uint(32);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var cs = get_data().begin_parse();
|
||||
cs~load_uint(64);
|
||||
return cs.preload_uint(256);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,3 +63,9 @@ int processed?(int query_id) method_id {
|
|||
(_, var found) = old_queries.udict_get?(64, query_id);
|
||||
return found ? true : - (query_id <= last_cleaned);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var cs = get_data().begin_parse();
|
||||
cs~load_uint(32 + 64);
|
||||
return cs.preload_uint(256);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ def? $2 { @' $2 } { "new-wallet" } cond constant file-base
|
|||
|
||||
// Create new advanced wallet; code adapted from `auto/wallet-code.fif`
|
||||
<{ SETCP0 DUP IFNOTRET // return if recv_internal
|
||||
DUP 85143 INT EQUAL IFJMP:<{ // "seqno" get-method
|
||||
DROP c4 PUSHCTR CTOS 32 PLDU // cnt
|
||||
DUP 85143 INT EQUAL OVER 78748 INT EQUAL OR IFJMP:<{ // "seqno" and "get_public_key" get-methods
|
||||
1 INT AND c4 PUSHCTR CTOS 32 LDU 256 PLDU CONDSEL // cnt or pubk
|
||||
}>
|
||||
INC 32 THROWIF // fail unless recv_external
|
||||
9 PUSHPOW2 LDSLICEX DUP 32 LDU 32 LDU // signature in_msg msg_seqno valid_until cs
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ $3 "new-wallet" replace-if-null =: file-base
|
|||
|
||||
// Create new advanced wallet; code adapted from `auto/wallet3-code.fif`
|
||||
<{ SETCP0 DUP IFNOTRET // return if recv_internal
|
||||
DUP 85143 INT EQUAL IFJMP:<{ // "seqno" get-method
|
||||
DROP c4 PUSHCTR CTOS 32 PLDU // cnt
|
||||
DUP 85143 INT EQUAL OVER 78748 INT EQUAL OR IFJMP:<{ // "seqno" and "get_public_key" get-methods
|
||||
1 INT AND c4 PUSHCTR CTOS 32 LDU 32 LDU NIP 256 PLDU CONDSEL // cnt or pubk
|
||||
}>
|
||||
INC 32 THROWIF // fail unless recv_external
|
||||
9 PUSHPOW2 LDSLICEX DUP 32 LDU 32 LDU 32 LDU // signature in_msg subwallet_id valid_until msg_seqno cs
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ def? $2 { @' $2 } { "new-wallet" } cond constant file-base
|
|||
|
||||
// Create new simple wallet
|
||||
<{ SETCP0 DUP IFNOTRET // return if recv_internal
|
||||
DUP 85143 INT EQUAL IFJMP:<{ // "seqno" get-method
|
||||
DROP c4 PUSHCTR CTOS 32 PLDU // cnt
|
||||
DUP 85143 INT EQUAL OVER 78748 INT EQUAL OR IFJMP:<{ // "seqno" and "get_public_key" get-methods
|
||||
1 INT AND c4 PUSHCTR CTOS 32 LDU 256 PLDU CONDSEL // cnt or pubk
|
||||
}>
|
||||
INC 32 THROWIF // fail unless recv_external
|
||||
512 INT LDSLICEX DUP 32 PLDU // sign cs cnt
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ int seqno() method_id {
|
|||
return get_data().begin_parse().preload_uint(32);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var cs = get_data().begin_parse();
|
||||
cs~load_uint(32);
|
||||
return cs.preload_uint(256);
|
||||
}
|
||||
|
||||
int balance() method_id {
|
||||
return restricted?() ? 0 : get_balance().first();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@ int seqno() method_id {
|
|||
return get_data().begin_parse().preload_uint(32);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var cs = get_data().begin_parse();
|
||||
cs~load_uint(32);
|
||||
return cs.preload_uint(256);
|
||||
}
|
||||
|
||||
int balance() method_id {
|
||||
var ds = get_data().begin_parse().skip_bits(32 + 256);
|
||||
var rdict = ds~load_dict();
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ int seqno() method_id {
|
|||
return get_data().begin_parse().preload_uint(32);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var (seqno, public_key) = load_state();
|
||||
return public_key;
|
||||
}
|
||||
|
||||
cell create_init_state(int public_key) method_id {
|
||||
return create_state(0, public_key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,3 +29,9 @@
|
|||
int seqno() method_id {
|
||||
return get_data().begin_parse().preload_uint(32);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var cs = get_data().begin_parse();
|
||||
cs~load_uint(32);
|
||||
return cs.preload_uint(256);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,3 +33,9 @@
|
|||
int seqno() method_id {
|
||||
return get_data().begin_parse().preload_uint(32);
|
||||
}
|
||||
|
||||
int get_public_key() method_id {
|
||||
var cs = get_data().begin_parse();
|
||||
cs~load_uint(64);
|
||||
return cs.preload_uint(256);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue