Skip to content

Commit d66cd0c

Browse files
Added handle for kda admin address (#3)
* Added handle for kda admin address * fixed rust toolchain 1.77.1 * set build toolchain * bump version --------- Co-authored-by: Fernando Sobreira <[email protected]>
1 parent 9898ecd commit d66cd0c

File tree

9 files changed

+22
-14
lines changed

9 files changed

+22
-14
lines changed

.github/workflows/libvmexeccapi-build.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ jobs:
3131
make_target: capi-osx-arm
3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
35+
- uses: actions-rs/toolchain@v1
36+
with:
37+
default: true
38+
toolchain: 1.77.1
3539
- name: Add tragets
3640
run: |
3741
rustup target add aarch64-unknown-linux-gnu

.github/workflows/rust-ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ jobs:
1212
name: Rust tests
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- uses: actions-rs/toolchain@v1
1717
with:
1818
default: true
19-
toolchain: stable
19+
toolchain: 1.77.1
2020
- name: Run rust tests
2121
run: cargo test
2222
clippy_check:
2323
permissions: write-all
2424
name: Clippy linter check
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
- uses: actions-rs/toolchain@v1
2929
with:
30-
toolchain: stable
30+
toolchain: 1.77.1
3131
components: clippy
3232
default: true
3333
- uses: actions-rs/clippy-check@v1

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This file contains a centralizes a trace of all published crate versions, with their changes in short.
44

5+
## [klever-chain-vm-executor 0.2.2] - 2024-05-22
6+
7+
- Add admin address to `managed_get_kda_token_data`.
8+
59
## [klever-chain-vm-executor 0.2.1] - 2024-04-04
610

711
- New VM hook: `managedGetSftMetadata`.

c-api/libvmexeccapi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ typedef struct {
122122
void (*managed_get_back_transfers_func_ptr)(void *context, int32_t kda_transfers_value_handle, int32_t call_value_handle);
123123
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);
124124
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);
125-
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);
125+
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);
126126
void (*managed_get_kda_roles_func_ptr)(void *context, int32_t ticker_handle, int32_t roles_handle);
127127
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);
128128
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);

c-api/src/capi_vm_hook_pointers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub struct vm_exec_vm_hook_c_func_pointers {
9494
pub managed_get_back_transfers_func_ptr: extern "C" fn(context: *mut c_void, kda_transfers_value_handle: i32, call_value_handle: i32),
9595
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),
9696
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),
97-
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),
97+
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),
9898
pub managed_get_kda_roles_func_ptr: extern "C" fn(context: *mut c_void, ticker_handle: i32, roles_handle: i32),
9999
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),
100100
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),

c-api/src/capi_vm_hooks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ impl klever_chain_vm_executor::VMHooks for CapiVMHooks {
375375
(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)
376376
}
377377

378-
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) {
379-
(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)
378+
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) {
379+
(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)
380380
}
381381

382382
fn managed_get_kda_roles(&self, ticker_handle: i32, roles_handle: i32) {

vm-executor-wasmer/src/wasmer_imports.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ fn wasmer_import_managed_get_user_kda(env: &VMHooksWrapper, address_handle: i32,
431431
}
432432

433433
#[rustfmt::skip]
434-
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) {
435-
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)
434+
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) {
435+
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)
436436
}
437437

438438
#[rustfmt::skip]

vm-executor/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "klever-chain-vm-executor"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55

66
authors = []

vm-executor/src/vm_hooks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait VMHooks: core::fmt::Debug + 'static {
9797
fn managed_get_back_transfers(&self, kda_transfers_value_handle: i32, call_value_handle: i32);
9898
fn managed_get_kda_balance(&self, address_handle: i32, token_id_handle: i32, nonce: i64, value_handle: i32);
9999
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);
100-
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);
100+
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);
101101
fn managed_get_kda_roles(&self, ticker_handle: i32, roles_handle: i32);
102102
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);
103103
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 {
651651
println!("Called: managed_get_user_kda");
652652
}
653653

654-
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) {
654+
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) {
655655
println!("Called: managed_get_kda_token_data");
656656
}
657657

0 commit comments

Comments
 (0)