Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 1 addition & 11 deletions .github/workflows/test-with-openzeppelin-stellar-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.collect-crates.outputs.dirs) }}
experimental_spec_shaking_v2: [true, false]
defaults:
run:
working-directory: stellar-contracts/${{ matrix.working-directory }}
Expand Down Expand Up @@ -77,15 +76,6 @@ jobs:
sed -i 's|'"$crate"' = { \(.*\)version = "[^"]*"\(.*\)|'"$crate"' = { \1path = "'"$rel_path"'" \2|g' Cargo.toml
done

- name: Enable experimental_spec_shaking_v2 feature
if: matrix.experimental_spec_shaking_v2
working-directory: stellar-contracts
run: |
# Add feature to path-patched entries with existing features
sed -i '/soroban-sdk = {.*path = /s|features = \[|features = ["experimental_spec_shaking_v2", |' Cargo.toml
# Add features field to path-patched entries without features
sed -i '/soroban-sdk = {.*path = /{/features/!s| }|, features = ["experimental_spec_shaking_v2"] }|}' Cargo.toml

- name: Diff
run: (! git diff --exit-code) || (echo 'A diff is expected'; exit 1)

Expand All @@ -99,7 +89,7 @@ jobs:
- name: Set artifact name
if: steps.check-if-contract.outputs.is-a-contract == 'true'
id: artifact-name
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')${{ matrix.experimental_spec_shaking_v2 && '-spec-shaking-v2' || '' }}" | tee -a $GITHUB_OUTPUT
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')" | tee -a $GITHUB_OUTPUT

- name: Upload WASM artifacts
if: steps.check-if-contract.outputs.is-a-contract == 'true'
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/test-with-soroban-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.collect-examples.outputs.dirs) }}
experimental_spec_shaking_v2: [true, false]
defaults:
run:
working-directory: soroban-examples/${{ matrix.working-directory }}
Expand Down Expand Up @@ -93,17 +92,6 @@ jobs:
done
done

- name: Enable experimental_spec_shaking_v2 feature
if: matrix.experimental_spec_shaking_v2
working-directory: soroban-examples
run: |
find . -name Cargo.toml | while read -r file; do
# Add feature to path-patched entries with existing features
sed -i '/soroban-sdk = {.*path = /s|features = \[|features = ["experimental_spec_shaking_v2", |' "$file"
# Add features field to path-patched entries without features
sed -i '/soroban-sdk = {.*path = /{/features/!s| }|, features = ["experimental_spec_shaking_v2"] }|}' "$file"
done

- name: Diff
run: (! git diff --exit-code) || (echo 'A diff is expected'; exit 1)

Expand All @@ -115,7 +103,7 @@ jobs:

- name: Set artifact name
id: artifact-name
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')${{ matrix.experimental_spec_shaking_v2 && '-spec-shaking-v2' || '' }}" | tee -a $GITHUB_OUTPUT
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')" | tee -a $GITHUB_OUTPUT

- name: Upload WASM artifacts
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions soroban-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ark-bls12-381 = { version = "0.5", default-features = false, features = ["curve"
ark-ff = { version = "0.5", default-features = false }

[features]
default = ["experimental_spec_shaking_v2"]
alloc = []
testutils = ["soroban-sdk-macros/testutils", "soroban-env-host/testutils", "soroban-ledger-snapshot/testutils", "dep:ed25519-dalek", "dep:arbitrary", "dep:derive_arbitrary", "dep:ctor", "dep:soroban-ledger-snapshot"]
experimental_spec_shaking_v2 = ["soroban-sdk-macros/experimental_spec_shaking_v2"]
Expand Down
15 changes: 11 additions & 4 deletions soroban-sdk/src/_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@
//! [`Address::from_payload`][crate::Address::from_payload]) that are easy to
//! misuse. Use with care.
//!
//! ## `experimental_spec_shaking_v2`
//! ## `experimental_spec_shaking_v2` (default)
//!
//! Enables v2 spec shaking, an improved mechanism for controlling which type,
//! event, and function definitions appear in a contract's spec.
//! event, and function definitions appear in a contract's spec. This feature is
//! enabled by default.
//!
//! ### Spec Shaking v1 (default, no feature flag)
//! This feature is no longer experimental. It was previously introduced as an
//! experimental opt-in feature and is now being rolled out as the default. The
//! original feature name `experimental_spec_shaking_v2` is preserved for
//! backwards compatibility. The feature is expected to be removed in v27, at
//! which point spec shaking v2 will be always on.
//!
//! ### Spec Shaking v1 (disabled by default, use `default-features = false`)
//!
//! - Lib imports (via `contractimport!`): exported
//! - Wasm imports (via `contractimport!`): not exported
Expand All @@ -40,7 +47,7 @@
//! - All events: exported
//! - All functions: exported
//!
//! ### Spec Shaking v2 (this feature)
//! ### Spec Shaking v2 (default)
//!
//! - Everything exported (types, events, functions, imports)
//! - Unused entries shaken out using dead code / spec elimination
Expand Down
5 changes: 5 additions & 0 deletions tests-expanded/test_account_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ impl Error {
*b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01"
}
}
impl soroban_sdk::SpecShakingMarker for Error {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {}
}
impl TryFrom<soroban_sdk::Error> for Error {
type Error = soroban_sdk::Error;
#[inline(always)]
Expand Down
10 changes: 10 additions & 0 deletions tests-expanded/test_account_wasm32v1-none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ impl Error {
*b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01"
}
}
impl soroban_sdk::SpecShakingMarker for Error {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
{
static MARKER: [u8; 14usize] = *b"SpEcV1\xa8\x1f\xc4#\x9c\x8f\xeb\x88";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl TryFrom<soroban_sdk::Error> for Error {
type Error = soroban_sdk::Error;
#[inline(always)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ mod test {
mod test_with_wasm {
use soroban_sdk::{Env, String};
mod contract {
pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x11\x03`\x02~~\x01~`\x00\x01~`\x02\x7f\x7f\x01~\x02\x07\x01\x01b\x01i\x00\x00\x03\x04\x03\x01\x02\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x90\x80\xc0\x00\x0b\x078\x06\x06memory\x02\x00\x04exec\x00\x01\x05exec2\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n>\x03\x10\x00A\x80\x80\xc0\x80\x00A\x07\x10\x82\x80\x80\x80\x00\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x80\x80\x80\x80\x00\x0b\x10\x00A\x87\x80\xc0\x80\x00A\x08\x10\x82\x80\x80\x80\x00\x0b\x0b\x18\x01\x00A\x80\x80\xc0\x00\x0b\x0fdefaultdefault2\x00K\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04exec\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05exec2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00+\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00";
pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x11\x03`\x02~~\x01~`\x00\x01~`\x02\x7f\x7f\x01~\x02\x07\x01\x01b\x01i\x00\x00\x03\x04\x03\x01\x02\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x90\x80\xc0\x00\x0b\x078\x06\x06memory\x02\x00\x04exec\x00\x01\x05exec2\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n>\x03\x10\x00A\x80\x80\xc0\x80\x00A\x07\x10\x82\x80\x80\x80\x00\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x80\x80\x80\x80\x00\x0b\x10\x00A\x87\x80\xc0\x80\x00A\x08\x10\x82\x80\x80\x80\x00\x0b\x0b\x18\x01\x00A\x80\x80\xc0\x00\x0b\x0fdefaultdefault2\x00K\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04exec\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05exec2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00";
pub trait Contract {
fn exec(env: soroban_sdk::Env) -> soroban_sdk::String;
fn exec2(env: soroban_sdk::Env) -> soroban_sdk::String;
Expand Down
10 changes: 10 additions & 0 deletions tests-expanded/test_auth_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,11 @@ mod test_a {
*b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07Decline\0\0\0\0\x01"
}
}
impl soroban_sdk::SpecShakingMarker for Error {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {}
}
impl TryFrom<soroban_sdk::Error> for Error {
type Error = soroban_sdk::Error;
#[inline(always)]
Expand Down Expand Up @@ -2601,6 +2606,11 @@ mod test_b {
*b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07Decline\0\0\0\0\x01"
}
}
impl soroban_sdk::SpecShakingMarker for Error {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {}
}
impl TryFrom<soroban_sdk::Error> for Error {
type Error = soroban_sdk::Error;
#[inline(always)]
Expand Down
11 changes: 11 additions & 0 deletions tests-expanded/test_bls_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ impl DummyProof {
*b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nDummyProof\0\0\0\0\0\x05\0\0\0\0\0\0\0\x02fp\0\0\0\0\x03\xee\0\0\00\0\0\0\0\0\0\0\x03fp2\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02fr\0\0\0\0\0\x0c\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xee\0\0\0\xc0"
}
}
impl soroban_sdk::SpecShakingMarker for DummyProof {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<Bls12381Fp as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Bls12381Fp2 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Fr as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Bls12381G1Affine as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Bls12381G2Affine as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for DummyProof {
type Error = soroban_sdk::ConversionError;
fn try_from_val(
Expand Down
15 changes: 15 additions & 0 deletions tests-expanded/test_bls_wasm32v1-none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ impl DummyProof {
*b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nDummyProof\0\0\0\0\0\x05\0\0\0\0\0\0\0\x02fp\0\0\0\0\x03\xee\0\0\00\0\0\0\0\0\0\0\x03fp2\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02fr\0\0\0\0\0\x0c\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xee\0\0\0\xc0"
}
}
impl soroban_sdk::SpecShakingMarker for DummyProof {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<Bls12381Fp as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Bls12381Fp2 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Fr as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Bls12381G1Affine as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Bls12381G2Affine as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
{
static MARKER: [u8; 14usize] = *b"SpEcV1\x85W\0A\xdc~\xb7\"";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for DummyProof {
type Error = soroban_sdk::ConversionError;
fn try_from_val(
Expand Down
8 changes: 8 additions & 0 deletions tests-expanded/test_bn254_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ impl MockProof {
*b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tMockProof\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0\x80"
}
}
impl soroban_sdk::SpecShakingMarker for MockProof {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<Vec<Bn254G1Affine> as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Vec<Bn254G2Affine> as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MockProof {
type Error = soroban_sdk::ConversionError;
fn try_from_val(
Expand Down
12 changes: 12 additions & 0 deletions tests-expanded/test_bn254_wasm32v1-none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ impl MockProof {
*b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tMockProof\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0\x80"
}
}
impl soroban_sdk::SpecShakingMarker for MockProof {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<Vec<Bn254G1Affine> as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<Vec<Bn254G2Affine> as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
{
static MARKER: [u8; 14usize] = *b"SpEcV1:\x81\xa6\xa0\x9e\xe7\xa7\x1f";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MockProof {
type Error = soroban_sdk::ConversionError;
fn try_from_val(
Expand Down
7 changes: 7 additions & 0 deletions tests-expanded/test_constructor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ impl DataKey {
*b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07DataKey\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\nPersistent\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x04Temp\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x08Instance\0\0\0\x01\0\0\0\x04"
}
}
impl soroban_sdk::SpecShakingMarker for DataKey {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<u32 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for DataKey {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down
11 changes: 11 additions & 0 deletions tests-expanded/test_constructor_wasm32v1-none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ impl DataKey {
*b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07DataKey\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\nPersistent\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x04Temp\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x08Instance\0\0\0\x01\0\0\0\x04"
}
}
impl soroban_sdk::SpecShakingMarker for DataKey {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<u32 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
{
static MARKER: [u8; 14usize] = *b"SpEcV1\x14\x94}~\xec\x15\x94\x84";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for DataKey {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down
21 changes: 21 additions & 0 deletions tests-expanded/test_contracttrait_trait_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ impl MyStruct {
*b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08MyStruct\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07"
}
}
impl soroban_sdk::SpecShakingMarker for MyStruct {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<i64 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<i64 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MyStruct {
type Error = soroban_sdk::ConversionError;
fn try_from_val(
Expand Down Expand Up @@ -465,6 +473,11 @@ impl MyEnumUnit {
*b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nMyEnumUnit\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x02"
}
}
impl soroban_sdk::SpecShakingMarker for MyEnumUnit {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MyEnumUnit {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down Expand Up @@ -810,6 +823,14 @@ impl MyEnumVariants {
*b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04VarA\0\0\0\x01\0\0\0\0\0\0\0\x04VarB\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\0\0\0\0\0\x04VarC\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0"
}
}
impl soroban_sdk::SpecShakingMarker for MyEnumVariants {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<MyStruct as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<MyEnumUnit as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MyEnumVariants {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down
34 changes: 34 additions & 0 deletions tests-expanded/test_contracttrait_trait_wasm32v1-none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ impl MyStruct {
*b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08MyStruct\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07"
}
}
impl soroban_sdk::SpecShakingMarker for MyStruct {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<i64 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<i64 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
{
static MARKER: [u8; 14usize] = *b"SpEcV1\x08\xd4\xa7b\xae1|\xdd";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MyStruct {
type Error = soroban_sdk::ConversionError;
fn try_from_val(
Expand Down Expand Up @@ -157,6 +169,16 @@ impl MyEnumUnit {
*b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nMyEnumUnit\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x02"
}
}
impl soroban_sdk::SpecShakingMarker for MyEnumUnit {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
{
static MARKER: [u8; 14usize] = *b"SpEcV12E\x1b4\x1c\x83\xab\xeb";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MyEnumUnit {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down Expand Up @@ -268,6 +290,18 @@ impl MyEnumVariants {
*b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04VarA\0\0\0\x01\0\0\0\0\0\0\0\x04VarB\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\0\0\0\0\0\x04VarC\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0"
}
}
impl soroban_sdk::SpecShakingMarker for MyEnumVariants {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {
<MyStruct as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
<MyEnumUnit as soroban_sdk::SpecShakingMarker>::spec_shaking_marker();
{
static MARKER: [u8; 14usize] = *b"SpEcV1\xceHo\xd4mpUm";
let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) };
}
}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for MyEnumVariants {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down
10 changes: 10 additions & 0 deletions tests-expanded/test_errors_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ impl Flag {
*b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04Flag\0\0\0\x05\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01C\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01D\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\x01E\0\0\0\0\0\0\x04"
}
}
impl soroban_sdk::SpecShakingMarker for Flag {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {}
}
impl soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val> for Flag {
type Error = soroban_sdk::ConversionError;
#[inline(always)]
Expand Down Expand Up @@ -505,6 +510,11 @@ impl Error {
*b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07AnError\0\0\0\0\x01"
}
}
impl soroban_sdk::SpecShakingMarker for Error {
#[doc(hidden)]
#[inline(always)]
fn spec_shaking_marker() {}
}
impl TryFrom<soroban_sdk::Error> for Error {
type Error = soroban_sdk::Error;
#[inline(always)]
Expand Down
Loading
Loading