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

[FunC] Deprecate method_id specifier, introduce get keyword

`get` keyword behaves exactly like `method_id` (auto-calc hash),
but it's placed on the left, similar to Tact: `get T name()`.

`method_id(n)` is still valid, considering it can't be invoked by name,
since a client will compute another hash.
It's supposed it will be still used in tests and in low-level code
(not to be called externally, but to be called after replacing c3).

`get(hash)` is invalid, this keyword does not accept anything.
This commit is contained in:
Aleksandr Kirsanov 2024-05-21 15:34:37 +03:00
parent 7afa9292c3
commit 7b8268d99f
No known key found for this signature in database
GPG key ID: B758BBAA01FFB3D3
16 changed files with 103 additions and 72 deletions

View file

@ -248,7 +248,7 @@ _ unpack_owner_info(slice cs) inline_ref {
;; Get methods
;; returns -1 for processed queries, 0 for unprocessed, 1 for unknown (forgotten)
(int, int) get_query_state(int query_id) method_id {
get (int, int) get_query_state(int query_id) {
(_, int n, _, int last_cleaned, _, cell pending_queries, _) = unpack_state();
(slice cs, var found) = pending_queries.udict_get?(64, query_id);
if (found) {
@ -263,12 +263,12 @@ _ unpack_owner_info(slice cs) inline_ref {
}
}
int processed?(int query_id) method_id {
get int processed?(int query_id) {
(int x, _) = get_query_state(query_id);
return x;
}
cell create_init_state(int wallet_id, int n, int k, cell owners_info, int spend_delay) method_id {
get cell create_init_state(int wallet_id, int n, int k, cell owners_info, int spend_delay) {
return pack_state(new_dict(), owners_info, 0, k, n, wallet_id, spend_delay);
}
@ -291,7 +291,7 @@ cell merge_list(cell a, cell b) {
}
cell get_public_keys() method_id {
get cell get_public_keys() {
(_, _, _, _, cell public_keys, _, _) = unpack_state();
return public_keys;
}