Skip to content

New Payment objects in blackbox execution#2285

Merged
andrei-marinica merged 6 commits intorc/v0.65from
mandos-payment
Feb 23, 2026
Merged

New Payment objects in blackbox execution#2285
andrei-marinica merged 6 commits intorc/v0.65from
mandos-payment

Conversation

@andrei-marinica
Copy link
Copy Markdown
Contributor

@andrei-marinica andrei-marinica commented Feb 12, 2026

Pull request overview

This PR updates the scenario/interaction payment plumbing to use the newer Payment / PaymentVec types when generating scenario tx-steps, replacing the legacy “full payment data” representation.

Changes:

  • Rename TxPayment::into_full_payment_data() to TxPayment::into_scenario_payments() and replace FullPaymentData with ScenarioPayments.
  • Switch scenario tx-step generation (call, transfer, deploy) to consume ScenarioPayments and build TxESDT entries from Payment.
  • Add conversions to support Payment/PaymentVec in scenario/VM paths (e.g., TxESDT: From<Payment>, MultiEsdtPayment::into_payment_vec()), plus corresponding import/usage updates.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 12, 2026

Contract comparison - from cb80fcb to 8686df9

Path                                                                                             size                  has-allocator                     has-format
fractional-nfts.wasm 8302 false without message
multisig-view.wasm 5590 false None
multisig-full.wasm 15124 false without message
multisig.wasm 13617 false without message
nft-minter.wasm 9726 false without message
ping-pong-egld.wasm 6397 false None
factorial.wasm 579 false None
nft-subscription.wasm 8725 false without message
kitty-auction.wasm 9389 false without message
kitty-genetic-alg.wasm 3494 false without message
kitty-ownership.wasm 12965 false without message
nft-storage-prepay.wasm 2609 false None
crypto-bubbles.wasm 2561 false None
esdt-transfer-with-fee.wasm 7505 false without message
seed-nft-minter.wasm 14189 false without message
adder.wasm 699 false None
bonding-curve-contract.wasm 14067 false None
proxy-pause.wasm 4165 false None
empty.wasm 244 false None
crowdfunding.wasm 3574 false None
digital-cash.wasm 9736 false None
token-release.wasm 6978 false without message
lottery-esdt.wasm 10580 false without message
rewards-distribution.wasm 9445 false without message
check-pause.wasm 1260 false None
order-book-factory.wasm 3401 false None
order-book-pair.wasm 14099 false None
crypto-zombies.wasm 9275 false without message
set-repeat.wasm 6511 false None
single-value-repeat.wasm 4253 false None
map-repeat.wasm 7363 false without message
queue-repeat.wasm 5536 false None
linked-list-repeat.wasm 6838 false without message
vec-repeat.wasm 4872 false None
str-repeat-mb-builder-cached.wasm 1109 false without message
str-repeat-mb-builder-basic.wasm 757 false None
str-repeat.wasm 2733 false without message
large-storage.wasm 1656 false None
send-tx-repeat.wasm 1292 false None
abi-tester.wasm 8607 true without message
abi-tester-ev.wasm 760 false None
exchange-features.wasm 1514 false None
use-module.wasm 32477 false without message
use-module-view.wasm 736 false None
panic-message-features.wasm 13030 false with message
panic-message-std.wasm 16073 false with message
big-float-features.wasm 6373 false without message
scenario-tester.wasm 1374 false None
forbidden-opcodes.wasm 842 false None
basic-features-small-int-bug.wasm 824 false None
basic-features.wasm 85948 false without message
basic-features-storage-bytes.wasm 541 false None
payable-features.wasm 6046 false None
std-contract.wasm 3469 true without message
forwarder-queue.wasm 12712 false without message
forwarder-queue-promises.wasm 13336 false without message
forwarder-raw.wasm 13081 false None
forwarder-raw-init-sync-call.wasm 2958 false None
forwarder-raw-init-async-call.wasm 2374 false None
forwarder-legacy.wasm 33618 false without message
recursive-caller.wasm 5163 false without message
second-contract.wasm 1158 false None
first-contract.wasm 3450 false None
proxy-test-first.wasm 5707 false without message
transfer-role-features.wasm 8605 false without message
vault.wasm 8950 false None
vault-upgrade.wasm 708 false None
forwarder.wasm 49004 false without message
proxy-test-second.wasm 2332 false without message
local-esdt-and-nft.wasm 12568 false without message
parent.wasm 1999 false None
child.wasm 3982 false without message
builtin-func-features.wasm 3828 false None
rust-snippets-generator-test.wasm 4708 false None
rust-testing-framework-tester.wasm 8552 false None
multi-contract-features-view.wasm 1113 false None
multi-contract-features.wasm 681 false None
multi-contract-alt-impl.wasm 353 false None
multi-contract-example-feature.wasm 680 false None
alloc-mem-leaking.wasm 23417 false without message
alloc-features.wasm 23260 false without message
alloc-mem-fail.wasm 17812 true without message
erc1155-user-mock.wasm 1229 false None
erc721.wasm 2232 false None
crowdfunding-erc20.wasm 4909 false without message
lottery-erc20.wasm 12886 false without message
erc1155.wasm 12016 false without message
erc1155-marketplace.wasm 10602 false without message
erc20.wasm 1887 false None
esdt-system-sc-mock.wasm 4556 false None
formatted-message-features.wasm 3613 false without message
multiversx-price-aggregator-sc.wasm 17904 false without message
multiversx-wegld-swap-sc.wasm 4265 false None

⚠️ Could not download the report for the base branch. Displaying only the report for the current branch. ⚠️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the scenario/interaction payment plumbing to use the newer Payment / PaymentVec types when generating scenario tx-steps, replacing the legacy “full payment data” representation.

Changes:

  • Rename TxPayment::into_full_payment_data() to TxPayment::into_scenario_payments() and replace FullPaymentData with ScenarioPayments.
  • Switch scenario tx-step generation (call, transfer, deploy) to consume ScenarioPayments and build TxESDT entries from Payment.
  • Add conversions to support Payment/PaymentVec in scenario/VM paths (e.g., TxESDT: From<Payment>, MultiEsdtPayment::into_payment_vec()), plus corresponding import/usage updates.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
framework/scenario/src/scenario/tx_to_step/tx_to_step_transfer.rs Use into_scenario_payments() when building transfer steps.
framework/scenario/src/scenario/tx_to_step/tx_to_step_deploy.rs Use into_scenario_payments() when building deploy steps.
framework/scenario/src/scenario/tx_to_step/tx_to_step_call.rs Use into_scenario_payments() and convert Payment items into TxESDT.
framework/scenario/src/scenario/model/transaction/tx_esdt.rs Add From<Payment> to support scenario conversion.
framework/base/src/types/managed/wrapped/token/esdt_token_payment.rs Add MultiEsdtPayment::into_payment_vec() conversion.
framework/base/src/types/interaction/tx_payment/tx_payment_vec_ref.rs Update blanket AsRef<PaymentVec> impl to produce ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_triple.rs Update tuple-payment conversion to return ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_ref.rs Update single-ESDT(ref) to produce ScenarioPayments using Payment.
framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt.rs Update single-ESDT to produce ScenarioPayments using Payment.
framework/base/src/types/interaction/tx_payment/tx_payment_payment_refs.rs Update PaymentRefs conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_payment_ref.rs Update payment-ref macro impl to into_scenario_payments().
framework/base/src/types/interaction/tx_payment/tx_payment_payment_option.rs Update Option<P> payment conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_payment.rs Update Payment conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_not_payable.rs Update “no payment” marker to return ScenarioPayments::default().
framework/base/src/types/interaction/tx_payment/tx_payment_none.rs Update () payment to return ScenarioPayments::default().
framework/base/src/types/interaction/tx_payment/tx_payment_multi_transfer_marker.rs Update multi-transfer marker to return ScenarioPayments backed by PaymentVec.
framework/base/src/types/interaction/tx_payment/tx_payment_multi_esdt.rs Update multi-ESDT payment to return ScenarioPayments backed by PaymentVec.
framework/base/src/types/interaction/tx_payment/tx_payment_multi_egld_or_esdt.rs Update multi-(EGLD/ESDT) payment to return ScenarioPayments backed by PaymentVec.
framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt_refs.rs Update dual-type refs conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt.rs Update dual-type conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt_refs.rs Update dual-type refs conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt.rs Update dual-type conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment/tx_payment_egld.rs Update EGLD conversion to ScenarioPayments.
framework/base/src/types/interaction/tx_payment.rs Rename the trait API + rename the intermediate struct to ScenarioPayments and switch to PaymentVec.
framework/base/src/types/interaction/expr/test_esdt_transfer.rs Update test helper to implement into_scenario_payments().
chain/vm/src/host/context/managed_type_container/tx_managed_buffer.rs Update error message text for malformed managed-vec payment payloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +69 to 73
fn into_scenario_payments(self, _env: &Env) -> ScenarioPayments<Env::Api> {
ScenarioPayments {
egld: None,
multi_esdt: self.clone(),
multi_esdt: self.clone().into_payment_vec(),
}
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

into_scenario_payments() uses self.clone().into_payment_vec() to reinterpret MultiEgldOrEsdtPayment (which stores BigUint amounts and supports zero/no-payment entries) as PaymentVec (which semantically requires non-zero amounts). This can violate Payment’s non-zero invariant. Consider converting each element to Payment with validation/filtering instead of using into_payment_vec() here.

Copilot uses AI. Check for mistakes.
Comment thread framework/base/src/types/interaction/tx_payment.rs
@andrei-marinica andrei-marinica merged commit dd34ed2 into rc/v0.65 Feb 23, 2026
23 of 24 checks passed
@andrei-marinica andrei-marinica deleted the mandos-payment branch February 23, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants