Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm crate comment fix #1570

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# The root Cargo.lock is kept for dependabot.
contracts/**/Cargo.lock
!contracts/**/wasm*/Cargo.lock
contracts/**/output*/
data/**/Cargo.lock
framework/**/Cargo.lock
sdk/**/Cargo.lock
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/adder/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 2
// Async Callback (empty): 1
// Total number of exported functions: 4
// Total number of exported functions: 5

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/crypto-zombies/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 17
// Async Callback: 1
// Total number of exported functions: 19
// Total number of exported functions: 20

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/empty/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 0
// Async Callback (empty): 1
// Total number of exported functions: 2
// Total number of exported functions: 3

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/factorial/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 1
// Async Callback (empty): 1
// Total number of exported functions: 3
// Total number of exported functions: 4

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/multisig/wasm-multisig-full/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 28
// Async Callback: 1
// Total number of exported functions: 30
// Total number of exported functions: 31

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/multisig/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 20
// Async Callback: 1
// Total number of exported functions: 22
// Total number of exported functions: 23

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/ping-pong-egld/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 10
// Async Callback (empty): 1
// Total number of exported functions: 12
// Total number of exported functions: 13

#![no_std]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion contracts/feature-tests/abi-tester/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 27
// Async Callback (empty): 1
// Total number of exported functions: 29
// Total number of exported functions: 30

#![no_std]
#![allow(internal_features)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Code generated by the multiversx-sc build system. DO NOT EDIT.

# ##########################################
# ############## AUTO-GENERATED #############
# ##########################################

[package]
name = "forwarder-legacy-wasm"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]

[profile.release]
codegen-units = 1
opt-level = "z"
lto = true
debug = false
panic = "abort"
overflow-checks = false

[dependencies.forwarder-legacy]
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.49.0-alpha.3"
path = "../../../../../framework/wasm-adapter"

[workspace]
members = ["."]
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Code generated by the multiversx-sc build system. DO NOT EDIT.

////////////////////////////////////////////////////
////////////////// AUTO-GENERATED //////////////////
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 68
// Async Callback: 1
// Total number of exported functions: 70

#![no_std]
#![allow(internal_features)]
#![feature(lang_items)]

multiversx_sc_wasm_adapter::allocator!();
multiversx_sc_wasm_adapter::panic_handler!();

multiversx_sc_wasm_adapter::endpoints! {
forwarder_legacy
(
init => init
send_egld => send_egld
echo_arguments_sync => echo_arguments_sync
echo_arguments_sync_twice => echo_arguments_sync_twice
forward_sync_accept_funds => forward_sync_accept_funds
forward_sync_accept_funds_with_fees => forward_sync_accept_funds_with_fees
forward_sync_accept_funds_then_read => forward_sync_accept_funds_then_read
forward_sync_retrieve_funds => forward_sync_retrieve_funds
forward_sync_retrieve_funds_with_accept_func => forward_sync_retrieve_funds_with_accept_func
accept_funds_func => accept_funds_func
forward_sync_accept_funds_multi_transfer => forward_sync_accept_funds_multi_transfer
echo_args_async => echo_args_async
forward_async_accept_funds => forward_async_accept_funds
forward_async_accept_funds_half_payment => forward_async_accept_funds_half_payment
forward_async_accept_funds_with_fees => forward_async_accept_funds_with_fees
forward_async_retrieve_funds => forward_async_retrieve_funds
send_funds_twice => send_funds_twice
send_async_accept_multi_transfer => send_async_accept_multi_transfer
callback_data => callback_data
callback_data_at_index => callback_data_at_index
clear_callback_data => clear_callback_data
forward_transf_exec_accept_funds => forward_transf_exec_accept_funds
forward_transf_exec_accept_single_esdt => forward_transf_exec_accept_single_esdt
forward_transf_execu_accept_funds_with_fees => forward_transf_execu_accept_funds_with_fees
forward_transf_exec_accept_funds_twice => forward_transf_exec_accept_funds_twice
forward_transf_exec_accept_funds_return_values => forward_transf_exec_accept_funds_return_values
transf_exec_multi_accept_funds => transf_exec_multi_accept_funds
transf_exec_multi_accept_funds_v2 => transf_exec_multi_accept_funds_v2
forward_transf_exec_reject_funds_multi_transfer => forward_transf_exec_reject_funds_multi_transfer
transf_exec_multi_reject_funds => transf_exec_multi_reject_funds
changeOwnerAddress => change_owner
deploy_contract => deploy_contract
deploy_two_contracts => deploy_two_contracts
deploy_vault_from_source => deploy_vault_from_source
upgradeVault => upgrade_vault
upgrade_vault_from_source => upgrade_vault_from_source
getFungibleEsdtBalance => get_fungible_esdt_balance
getCurrentNftNonce => get_current_nft_nonce
send_esdt => send_esdt
send_esdt_with_fees => send_esdt_with_fees
send_esdt_twice => send_esdt_twice
send_esdt_direct_multi_transfer => send_esdt_direct_multi_transfer
issue_fungible_token => issue_fungible_token
local_mint => local_mint
local_burn => local_burn
get_esdt_local_roles => get_esdt_local_roles
get_esdt_token_data => get_esdt_token_data
is_esdt_frozen => is_esdt_frozen
is_esdt_paused => is_esdt_paused
is_esdt_limited_transfer => is_esdt_limited_transfer
validate_token_identifier => validate_token_identifier
sft_issue => sft_issue
get_nft_balance => get_nft_balance
buy_nft => buy_nft
nft_issue => nft_issue
nft_create => nft_create
nft_create_compact => nft_create_compact
nft_add_uris => nft_add_uris
nft_update_attributes => nft_update_attributes
nft_decode_complex_attributes => nft_decode_complex_attributes
nft_add_quantity => nft_add_quantity
nft_burn => nft_burn
transfer_nft_via_async_call => transfer_nft_via_async_call
transfer_nft_and_execute => transfer_nft_and_execute
create_and_send => create_and_send
setLocalRoles => set_local_roles
unsetLocalRoles => unset_local_roles
lastIssuedToken => last_issued_token
lastErrorMessage => last_error_message
)
}

multiversx_sc_wasm_adapter::async_callback! { forwarder_legacy }
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 0
// Async Callback: 1
// Total number of exported functions: 2
// Total number of exported functions: 3

#![no_std]
#![allow(internal_features)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 3
// Async Callback (empty): 1
// Total number of exported functions: 5
// Total number of exported functions: 6

#![no_std]
#![allow(internal_features)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Upgrade: 1
// Endpoints: 0
// Async Callback (empty): 1
// Total number of exported functions: 1
// Total number of exported functions: 2

#![no_std]
#![allow(internal_features)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 15
// Async Callback (empty): 1
// Total number of exported functions: 17
// Total number of exported functions: 18

#![no_std]
#![allow(internal_features)]
Expand Down
3 changes: 2 additions & 1 deletion contracts/feature-tests/exchange-features/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 3
// Upgrade: 1
// Endpoints: 2
// Async Callback (empty): 1
// Total number of exported functions: 5

Expand Down
2 changes: 1 addition & 1 deletion contracts/feature-tests/scenario-tester/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Upgrade: 1
// Endpoints: 2
// Async Callback (empty): 1
// Total number of exported functions: 4
// Total number of exported functions: 5

#![no_std]
#![allow(internal_features)]
Expand Down
4 changes: 3 additions & 1 deletion framework/meta/src/cmd/contract/sc_config/wasm_crate_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const PREFIX_AUTO_GENERATED: &str =
";

const NUM_INIT: usize = 1;
const NUM_UPGRADE: usize = 1;
const NUM_ASYNC_CB: usize = 1;

const VER_1_71: &str = "1.71.0-nightly";
Expand Down Expand Up @@ -117,7 +118,8 @@ impl ContractVariant {
total += NUM_INIT;
}
if !self.abi.upgrade_constructors.is_empty() {
write_stat_comment(wasm_lib_file, "Upgrade:", NUM_INIT);
write_stat_comment(wasm_lib_file, "Upgrade:", NUM_UPGRADE);
total += NUM_UPGRADE;
}

write_stat_comment(wasm_lib_file, "Endpoints:", self.abi.endpoints.len());
Expand Down
Loading