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

updated vm

- updated func/fift
- additional checks in block validator
- docs
- tunnel prototype in ADNL
This commit is contained in:
ton 2020-03-11 14:19:31 +04:00
parent ba76f1404e
commit 54c7a4dcc3
50 changed files with 972 additions and 300 deletions

View file

@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "GenericAccount.h"
@ -96,4 +96,19 @@ td::Ref<vm::Cell> GenericAccount::create_ext_message(const block::StdAddress& ad
return res;
}
td::Result<td::Ed25519::PublicKey> GenericAccount::get_public_key(const SmartContract& sc) {
auto answer = sc.run_get_method("get_public_key");
if (!answer.success) {
return td::Status::Error("get_public_key failed");
}
auto do_get_public_key = [&]() -> td::Result<td::Ed25519::PublicKey> {
auto key = answer.stack.write().pop_int_finite();
td::SecureString bytes(32);
if (!key->export_bytes(bytes.as_mutable_slice().ubegin(), bytes.size(), false)) {
return td::Status::Error("get_public_key failed");
}
return td::Ed25519::PublicKey(std::move(bytes));
};
return TRY_VM(do_get_public_key());
}
} // namespace ton