mirror of
https://github.com/logos-blockchain/logos-execution-zone-module.git
synced 2026-08-04 09:13:11 +00:00
chore: bump lez version
This commit is contained in:
parent
033f807a3b
commit
9ccf21b0ac
8
flake.lock
generated
8
flake.lock
generated
@ -2716,17 +2716,17 @@
|
||||
"rust-rapidsnark": "rust-rapidsnark"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782922431,
|
||||
"narHash": "sha256-loCudmjk5qD12UqgiS7lyUc2UpTDzNpH1y0e8qojkNs=",
|
||||
"lastModified": 1785414238,
|
||||
"narHash": "sha256-SNo5ZvmzB39HMgY+f0a93XoNA92e/T5Ki9Gho62COWY=",
|
||||
"owner": "logos-blockchain",
|
||||
"repo": "logos-execution-zone",
|
||||
"rev": "571f35b3849c889f893109fd2b9dad040f0a3b57",
|
||||
"rev": "f58cde1a2251c20cf418a561ad974a8c64ab2393",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "logos-blockchain",
|
||||
"repo": "logos-execution-zone",
|
||||
"rev": "571f35b3849c889f893109fd2b9dad040f0a3b57",
|
||||
"rev": "f58cde1a2251c20cf418a561ad974a8c64ab2393",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
inputs = {
|
||||
logos-module-builder.url = "github:logos-co/logos-module-builder";
|
||||
nix-bundle-lgx.url = "github:logos-co/nix-bundle-lgx";
|
||||
logos-execution-zone.url = "github:logos-blockchain/logos-execution-zone?rev=571f35b3849c889f893109fd2b9dad040f0a3b57";
|
||||
logos-execution-zone.url = "github:logos-blockchain/logos-execution-zone?rev=f58cde1a2251c20cf418a561ad974a8c64ab2393";
|
||||
};
|
||||
|
||||
outputs = inputs@{ logos-module-builder, ... }:
|
||||
|
||||
@ -924,7 +924,7 @@ std::vector<uint8_t> LEZCoreModule::token_elf() {
|
||||
|
||||
std::vector<uint8_t> LEZCoreModule::amm_elf() {
|
||||
FfiProgram ffi_program{};
|
||||
WalletFfiError error = wallet_ffi_token_elf(&ffi_program);
|
||||
WalletFfiError error = wallet_ffi_amm_elf(&ffi_program);
|
||||
if (error != SUCCESS) {
|
||||
fprintf(stderr, "amm_elf: wallet FFI error %d\n", error);
|
||||
return std::vector<uint8_t>{};
|
||||
@ -939,7 +939,7 @@ std::vector<uint8_t> LEZCoreModule::amm_elf() {
|
||||
|
||||
std::vector<uint8_t> LEZCoreModule::ata_elf() {
|
||||
FfiProgram ffi_program{};
|
||||
WalletFfiError error = wallet_ffi_token_elf(&ffi_program);
|
||||
WalletFfiError error = wallet_ffi_ata_elf(&ffi_program);
|
||||
if (error != SUCCESS) {
|
||||
fprintf(stderr, "ata_elf: wallet FFI error %d\n", error);
|
||||
return std::vector<uint8_t>{};
|
||||
@ -954,7 +954,7 @@ std::vector<uint8_t> LEZCoreModule::ata_elf() {
|
||||
|
||||
std::vector<uint8_t> LEZCoreModule::authenticated_transfer_elf() {
|
||||
FfiProgram ffi_program{};
|
||||
WalletFfiError error = wallet_ffi_token_elf(&ffi_program);
|
||||
WalletFfiError error = wallet_ffi_transfer_elf(&ffi_program);
|
||||
if (error != SUCCESS) {
|
||||
fprintf(stderr, "authenticated_transfer_elf: wallet FFI error %d\n", error);
|
||||
return std::vector<uint8_t>{};
|
||||
@ -1150,6 +1150,7 @@ std::string LEZCoreModule::send_program_deployment_transaction(
|
||||
std::string LEZCoreModule::create_new(
|
||||
const std::string& config_path,
|
||||
const std::string& storage_path,
|
||||
const std::string& statistics_path,
|
||||
const std::string& password
|
||||
) {
|
||||
if (walletHandle) {
|
||||
@ -1157,7 +1158,7 @@ std::string LEZCoreModule::create_new(
|
||||
return {};
|
||||
}
|
||||
|
||||
FfiCreateWalletOutput create_output = wallet_ffi_create_new(config_path.c_str(), storage_path.c_str(), password.c_str());
|
||||
FfiCreateWalletOutput create_output = wallet_ffi_create_new(config_path.c_str(), storage_path.c_str(), statistics_path.c_str(), password.c_str());
|
||||
if (!create_output.wallet) {
|
||||
fprintf(stderr, "create_new: wallet_ffi_create_new returned null\n");
|
||||
return {};
|
||||
@ -1181,13 +1182,13 @@ int64_t LEZCoreModule::restore_storage(const std::string& mnemonic, const std::s
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
int64_t LEZCoreModule::open(const std::string& config_path, const std::string& storage_path) {
|
||||
int64_t LEZCoreModule::open(const std::string& config_path, const std::string& storage_path, const std::string& statistics_path) {
|
||||
if (walletHandle) {
|
||||
fprintf(stderr, "open: wallet is already open\n");
|
||||
return INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
walletHandle = wallet_ffi_open(config_path.c_str(), storage_path.c_str());
|
||||
walletHandle = wallet_ffi_open(config_path.c_str(), storage_path.c_str(), statistics_path.c_str());
|
||||
if (!walletHandle) {
|
||||
fprintf(stderr, "open: wallet_ffi_open returned null\n");
|
||||
return INTERNAL_ERROR;
|
||||
|
||||
@ -30,8 +30,8 @@ public:
|
||||
std::string version() const;
|
||||
|
||||
// === Wallet Lifecycle ===
|
||||
std::string create_new(const std::string& config_path, const std::string& storage_path, const std::string& password);
|
||||
int64_t open(const std::string& config_path, const std::string& storage_path);
|
||||
std::string create_new(const std::string& config_path, const std::string& storage_path, const std::string& statistics_path, const std::string& password);
|
||||
int64_t open(const std::string& config_path, const std::string& storage_path, const std::string& statistics_path);
|
||||
int64_t save();
|
||||
|
||||
int64_t restore_storage(const std::string& mnemonic, const std::string password, uint32_t depth);
|
||||
|
||||
@ -54,7 +54,7 @@ extern "C" {
|
||||
|
||||
// === Lifecycle ===
|
||||
|
||||
FfiCreateWalletOutput wallet_ffi_create_new(const char*, const char*, const char*) {
|
||||
FfiCreateWalletOutput wallet_ffi_create_new(const char*, const char*, const char*, const char*) {
|
||||
LOGOS_CMOCK_RECORD("wallet_ffi_create_new");
|
||||
const int ok = LOGOS_CMOCK_RETURN(int, "wallet_ffi_create_new");
|
||||
const char* mnemonic_ok = LOGOS_CMOCK_RETURN_STRING("wallet_ffi_create_new");
|
||||
@ -65,7 +65,7 @@ FfiCreateWalletOutput wallet_ffi_create_new(const char*, const char*, const char
|
||||
return output;
|
||||
}
|
||||
|
||||
WalletHandle* wallet_ffi_open(const char*, const char*) {
|
||||
WalletHandle* wallet_ffi_open(const char*, const char*, const char*) {
|
||||
LOGOS_CMOCK_RECORD("wallet_ffi_open");
|
||||
const int ok = LOGOS_CMOCK_RETURN(int, "wallet_ffi_open");
|
||||
return ok ? reinterpret_cast<WalletHandle*>(&g_fakeWallet) : nullptr;
|
||||
|
||||
@ -191,8 +191,8 @@ typedef struct LabelList {
|
||||
|
||||
// === Lifecycle ===
|
||||
|
||||
FfiCreateWalletOutput wallet_ffi_create_new(const char* config_path, const char* storage_path, const char* password);
|
||||
WalletHandle* wallet_ffi_open(const char* config_path, const char* storage_path);
|
||||
FfiCreateWalletOutput wallet_ffi_create_new(const char* config_path, const char* storage_path, const char* statistics_path, const char* password);
|
||||
WalletHandle* wallet_ffi_open(const char* config_path, const char* storage_path, const char* statistics_path);
|
||||
int wallet_ffi_save(WalletHandle* handle);
|
||||
void wallet_ffi_destroy(WalletHandle* handle);
|
||||
|
||||
|
||||
@ -590,10 +590,10 @@ LOGOS_TEST(create_new_success_then_double_open_fails) {
|
||||
t.mockCFunction("wallet_ffi_create_new").returns(1); // non-null handle
|
||||
LEZCoreModule module;
|
||||
|
||||
LOGOS_ASSERT_TRUE(!module.create_new("/cfg", "/store", "pw").empty());
|
||||
LOGOS_ASSERT_TRUE(!module.create_new("/cfg", "/store", "/stats", "pw").empty());
|
||||
LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_create_new"));
|
||||
// Second attempt: already open.
|
||||
LOGOS_ASSERT_EQ(module.create_new("/cfg", "/store", "pw"), "");
|
||||
LOGOS_ASSERT_EQ(module.create_new("/cfg", "/store", "/stats", "pw"), "");
|
||||
}
|
||||
|
||||
LOGOS_TEST(create_new_null_handle_returns_internal_error) {
|
||||
@ -601,7 +601,7 @@ LOGOS_TEST(create_new_null_handle_returns_internal_error) {
|
||||
t.mockCFunction("wallet_ffi_create_new").returns(0); // null handle
|
||||
LEZCoreModule module;
|
||||
|
||||
LOGOS_ASSERT_EQ(module.create_new("/cfg", "/store", "pw"), "");
|
||||
LOGOS_ASSERT_EQ(module.create_new("/cfg", "/store", "/stats", "pw"), "");
|
||||
}
|
||||
|
||||
LOGOS_TEST(open_success) {
|
||||
@ -609,7 +609,7 @@ LOGOS_TEST(open_success) {
|
||||
t.mockCFunction("wallet_ffi_open").returns(1);
|
||||
LEZCoreModule module;
|
||||
|
||||
LOGOS_ASSERT_EQ(module.open("/cfg", "/store"), static_cast<int64_t>(SUCCESS));
|
||||
LOGOS_ASSERT_EQ(module.open("/cfg", "/store", "/stats"), static_cast<int64_t>(SUCCESS));
|
||||
LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_open"));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user