diff --git a/.github/workflows/libvmexeccapi-build.yml b/.github/workflows/libvmexeccapi-build.yml index d7f9762..16d1068 100644 --- a/.github/workflows/libvmexeccapi-build.yml +++ b/.github/workflows/libvmexeccapi-build.yml @@ -31,7 +31,11 @@ jobs: make_target: capi-osx-arm steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + default: true + toolchain: 1.77.1 - name: Add tragets run: | rustup target add aarch64-unknown-linux-gnu diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 37c026f..0bad8ba 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -12,11 +12,11 @@ jobs: name: Rust tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: default: true - toolchain: stable + toolchain: 1.77.1 - name: Run rust tests run: cargo test clippy_check: @@ -24,10 +24,10 @@ jobs: name: Clippy linter check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.77.1 components: clippy default: true - uses: actions-rs/clippy-check@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cf4b7d..f80eb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This file contains a centralizes a trace of all published crate versions, with their changes in short. +## [klever-chain-vm-executor 0.2.2] - 2024-05-22 + +- Add admin address to `managed_get_kda_token_data`. + ## [klever-chain-vm-executor 0.2.1] - 2024-04-04 - New VM hook: `managedGetSftMetadata`. diff --git a/c-api/libvmexeccapi.h b/c-api/libvmexeccapi.h index 61b57d3..9b76e06 100644 --- a/c-api/libvmexeccapi.h +++ b/c-api/libvmexeccapi.h @@ -122,7 +122,7 @@ typedef struct { void (*managed_get_back_transfers_func_ptr)(void *context, int32_t kda_transfers_value_handle, int32_t call_value_handle); void (*managed_get_kda_balance_func_ptr)(void *context, int32_t address_handle, int32_t token_id_handle, int64_t nonce, int32_t value_handle); void (*managed_get_user_kda_func_ptr)(void *context, int32_t address_handle, int32_t ticker_handle, int64_t nonce, int32_t balance_handle, int32_t frozen_handle, int32_t last_claim_handle, int32_t buckets_handle, int32_t mime_handle, int32_t metadata_handle); - void (*managed_get_kda_token_data_func_ptr)(void *context, int32_t address_handle, int32_t ticker_handle, int64_t nonce, int32_t precision_handle, int32_t id_handle, int32_t name_handle, int32_t creator_handle, int32_t logo_handle, int32_t uris_handle, int32_t initial_supply_handle, int32_t circulating_supply_handle, int32_t max_supply_handle, int32_t minted_handle, int32_t burned_handle, int32_t royalties_handle, int32_t properties_handle, int32_t attributes_handle, int32_t roles_handle, int32_t issue_date_handle); + void (*managed_get_kda_token_data_func_ptr)(void *context, int32_t address_handle, int32_t ticker_handle, int64_t nonce, int32_t precision_handle, int32_t id_handle, int32_t name_handle, int32_t creator_handle, int32_t admin_handle, int32_t logo_handle, int32_t uris_handle, int32_t initial_supply_handle, int32_t circulating_supply_handle, int32_t max_supply_handle, int32_t minted_handle, int32_t burned_handle, int32_t royalties_handle, int32_t properties_handle, int32_t attributes_handle, int32_t roles_handle, int32_t issue_date_handle); void (*managed_get_kda_roles_func_ptr)(void *context, int32_t ticker_handle, int32_t roles_handle); void (*managed_upgrade_from_source_contract_func_ptr)(void *context, int32_t dest_handle, int64_t gas, int32_t value_handle, int32_t address_handle, int32_t code_metadata_handle, int32_t arguments_handle, int32_t result_handle); void (*managed_upgrade_contract_func_ptr)(void *context, int32_t dest_handle, int64_t gas, int32_t value_handle, int32_t code_handle, int32_t code_metadata_handle, int32_t arguments_handle, int32_t result_handle); diff --git a/c-api/src/capi_vm_hook_pointers.rs b/c-api/src/capi_vm_hook_pointers.rs index e177924..61aa5c1 100644 --- a/c-api/src/capi_vm_hook_pointers.rs +++ b/c-api/src/capi_vm_hook_pointers.rs @@ -94,7 +94,7 @@ pub struct vm_exec_vm_hook_c_func_pointers { pub managed_get_back_transfers_func_ptr: extern "C" fn(context: *mut c_void, kda_transfers_value_handle: i32, call_value_handle: i32), pub managed_get_kda_balance_func_ptr: extern "C" fn(context: *mut c_void, address_handle: i32, token_id_handle: i32, nonce: i64, value_handle: i32), pub managed_get_user_kda_func_ptr: extern "C" fn(context: *mut c_void, address_handle: i32, ticker_handle: i32, nonce: i64, balance_handle: i32, frozen_handle: i32, last_claim_handle: i32, buckets_handle: i32, mime_handle: i32, metadata_handle: i32), - pub managed_get_kda_token_data_func_ptr: extern "C" fn(context: *mut c_void, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32), + pub managed_get_kda_token_data_func_ptr: extern "C" fn(context: *mut c_void, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, admin_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32), pub managed_get_kda_roles_func_ptr: extern "C" fn(context: *mut c_void, ticker_handle: i32, roles_handle: i32), pub managed_upgrade_from_source_contract_func_ptr: extern "C" fn(context: *mut c_void, dest_handle: i32, gas: i64, value_handle: i32, address_handle: i32, code_metadata_handle: i32, arguments_handle: i32, result_handle: i32), pub managed_upgrade_contract_func_ptr: extern "C" fn(context: *mut c_void, dest_handle: i32, gas: i64, value_handle: i32, code_handle: i32, code_metadata_handle: i32, arguments_handle: i32, result_handle: i32), diff --git a/c-api/src/capi_vm_hooks.rs b/c-api/src/capi_vm_hooks.rs index ac40035..4ab9d32 100644 --- a/c-api/src/capi_vm_hooks.rs +++ b/c-api/src/capi_vm_hooks.rs @@ -375,8 +375,8 @@ impl klever_chain_vm_executor::VMHooks for CapiVMHooks { (self.c_func_pointers_ptr.managed_get_user_kda_func_ptr)(self.vm_hooks_ptr, address_handle, ticker_handle, nonce, balance_handle, frozen_handle, last_claim_handle, buckets_handle, mime_handle, metadata_handle) } - fn managed_get_kda_token_data(&self, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32) { - (self.c_func_pointers_ptr.managed_get_kda_token_data_func_ptr)(self.vm_hooks_ptr, address_handle, ticker_handle, nonce, precision_handle, id_handle, name_handle, creator_handle, logo_handle, uris_handle, initial_supply_handle, circulating_supply_handle, max_supply_handle, minted_handle, burned_handle, royalties_handle, properties_handle, attributes_handle, roles_handle, issue_date_handle) + fn managed_get_kda_token_data(&self, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, admin_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32) { + (self.c_func_pointers_ptr.managed_get_kda_token_data_func_ptr)(self.vm_hooks_ptr, address_handle, ticker_handle, nonce, precision_handle, id_handle, name_handle, creator_handle, admin_handle, logo_handle, uris_handle, initial_supply_handle, circulating_supply_handle, max_supply_handle, minted_handle, burned_handle, royalties_handle, properties_handle, attributes_handle, roles_handle, issue_date_handle) } fn managed_get_kda_roles(&self, ticker_handle: i32, roles_handle: i32) { diff --git a/vm-executor-wasmer/src/wasmer_imports.rs b/vm-executor-wasmer/src/wasmer_imports.rs index 353c857..b1edb4a 100644 --- a/vm-executor-wasmer/src/wasmer_imports.rs +++ b/vm-executor-wasmer/src/wasmer_imports.rs @@ -431,8 +431,8 @@ fn wasmer_import_managed_get_user_kda(env: &VMHooksWrapper, address_handle: i32, } #[rustfmt::skip] -fn wasmer_import_managed_get_kda_token_data(env: &VMHooksWrapper, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32) { - env.vm_hooks.managed_get_kda_token_data(address_handle, ticker_handle, nonce, precision_handle, id_handle, name_handle, creator_handle, logo_handle, uris_handle, initial_supply_handle, circulating_supply_handle, max_supply_handle, minted_handle, burned_handle, royalties_handle, properties_handle, attributes_handle, roles_handle, issue_date_handle) +fn wasmer_import_managed_get_kda_token_data(env: &VMHooksWrapper, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, admin_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32) { + env.vm_hooks.managed_get_kda_token_data(address_handle, ticker_handle, nonce, precision_handle, id_handle, name_handle, creator_handle, admin_handle, logo_handle, uris_handle, initial_supply_handle, circulating_supply_handle, max_supply_handle, minted_handle, burned_handle, royalties_handle, properties_handle, attributes_handle, roles_handle, issue_date_handle) } #[rustfmt::skip] diff --git a/vm-executor/Cargo.toml b/vm-executor/Cargo.toml index 24d79ba..4a76714 100644 --- a/vm-executor/Cargo.toml +++ b/vm-executor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "klever-chain-vm-executor" -version = "0.2.1" +version = "0.2.2" edition = "2021" authors = [] diff --git a/vm-executor/src/vm_hooks.rs b/vm-executor/src/vm_hooks.rs index 4342e3b..c4f5614 100644 --- a/vm-executor/src/vm_hooks.rs +++ b/vm-executor/src/vm_hooks.rs @@ -97,7 +97,7 @@ pub trait VMHooks: core::fmt::Debug + 'static { fn managed_get_back_transfers(&self, kda_transfers_value_handle: i32, call_value_handle: i32); fn managed_get_kda_balance(&self, address_handle: i32, token_id_handle: i32, nonce: i64, value_handle: i32); fn managed_get_user_kda(&self, address_handle: i32, ticker_handle: i32, nonce: i64, balance_handle: i32, frozen_handle: i32, last_claim_handle: i32, buckets_handle: i32, mime_handle: i32, metadata_handle: i32); - fn managed_get_kda_token_data(&self, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32); + fn managed_get_kda_token_data(&self, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, admin_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32); fn managed_get_kda_roles(&self, ticker_handle: i32, roles_handle: i32); fn managed_upgrade_from_source_contract(&self, dest_handle: i32, gas: i64, value_handle: i32, address_handle: i32, code_metadata_handle: i32, arguments_handle: i32, result_handle: i32); fn managed_upgrade_contract(&self, dest_handle: i32, gas: i64, value_handle: i32, code_handle: i32, code_metadata_handle: i32, arguments_handle: i32, result_handle: i32); @@ -651,7 +651,7 @@ impl VMHooks for VMHooksDefault { println!("Called: managed_get_user_kda"); } - fn managed_get_kda_token_data(&self, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32) { + fn managed_get_kda_token_data(&self, address_handle: i32, ticker_handle: i32, nonce: i64, precision_handle: i32, id_handle: i32, name_handle: i32, creator_handle: i32, admin_handle: i32, logo_handle: i32, uris_handle: i32, initial_supply_handle: i32, circulating_supply_handle: i32, max_supply_handle: i32, minted_handle: i32, burned_handle: i32, royalties_handle: i32, properties_handle: i32, attributes_handle: i32, roles_handle: i32, issue_date_handle: i32) { println!("Called: managed_get_kda_token_data"); }