Skip to content

Commit 4319e05

Browse files
committed
Bump soroban-test-wasms
1 parent c63507c commit 4319e05

File tree

8 files changed

+47
-18
lines changed

8 files changed

+47
-18
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ optional = true
130130
# supported host, since test material usually just grows over time.
131131

132132
[dependencies.soroban-test-wasms]
133-
version = "=23.0.0"
133+
version = "=23.0.2"
134134
git = "https://github.com/stellar/rs-soroban-env"
135-
rev = "688bc34e6cd15c71742139e625268c7f30f55a92"
135+
rev = "30249f0549141dbe7fdce84b6401a4235dbad64f"
136136

137137
[dependencies.soroban-synth-wasm]
138138
version = "=23.0.0"

src/rust/src/bridge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub(crate) mod rust_bridge {
206206
fn get_test_wasm_complex() -> Result<RustBuf>;
207207
fn get_test_wasm_loadgen() -> Result<RustBuf>;
208208
fn get_test_wasm_err() -> Result<RustBuf>;
209-
fn get_test_contract_sac_transfer() -> Result<RustBuf>;
209+
fn get_test_contract_sac_transfer(protocol_version: u32) -> Result<RustBuf>;
210210
fn get_write_bytes() -> Result<RustBuf>;
211211
fn get_invoke_contract_wasm() -> Result<RustBuf>;
212212

src/rust/src/soroban_test_wasm.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ pub(crate) fn get_test_wasm_loadgen() -> Result<RustBuf, Box<dyn std::error::Err
4040
})
4141
}
4242

43-
pub(crate) fn get_test_contract_sac_transfer() -> Result<RustBuf, Box<dyn std::error::Error>> {
43+
pub(crate) fn get_test_contract_sac_transfer(
44+
protocol_version: u32,
45+
) -> Result<RustBuf, Box<dyn std::error::Error>> {
46+
let wasm_bytes = if protocol_version >= 23 {
47+
soroban_test_wasms::CONTRACT_SAC_TRANSFER_CONTRACT_P23
48+
} else {
49+
soroban_test_wasms::CONTRACT_SAC_TRANSFER_CONTRACT
50+
};
4451
Ok(RustBuf {
45-
data: soroban_test_wasms::CONTRACT_SAC_TRANSFER_CONTRACT
46-
.iter()
47-
.cloned()
48-
.collect(),
52+
data: wasm_bytes.iter().cloned().collect(),
4953
})
5054
}
5155

src/simulation/ApplyLoad.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ ApplyLoad::setupBatchTransferContracts()
535535
auto const& lm = mApp.getLedgerManager();
536536

537537
// First, upload the batch_transfer contract WASM
538-
auto wasm = rust_bridge::get_test_contract_sac_transfer();
538+
auto wasm = rust_bridge::get_test_contract_sac_transfer(
539+
mApp.getConfig().LEDGER_PROTOCOL_VERSION);
539540
xdr::opaque_vec<> wasmBytes;
540541
wasmBytes.assign(wasm.data.begin(), wasm.data.end());
541542

src/transactions/test/InvokeHostFunctionTests.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,11 @@ TEST_CASE_VERSIONS("Trustline stellar asset contract",
280280
REQUIRE(!client.transfer(acc, acc2Addr, 10));
281281

282282
// Now transfer from a contract
283-
TestContract& transferContract = test.deployWasmContract(
284-
rust_bridge::get_test_contract_sac_transfer());
283+
TestContract& transferContract =
284+
test.deployWasmContract(rust_bridge::get_test_contract_sac_transfer(
285+
app.getLedgerManager()
286+
.getLastClosedLedgerHeader()
287+
.header.ledgerVersion));
285288

286289
REQUIRE(client.mint(issuer, transferContract.getAddress(), 10));
287290

@@ -372,7 +375,8 @@ TEST_CASE("Native stellar asset contract",
372375
// Now test xlm transfer from a contract to another contract and then to an
373376
// account.
374377
TestContract& transferContract =
375-
test.deployWasmContract(rust_bridge::get_test_contract_sac_transfer());
378+
test.deployWasmContract(rust_bridge::get_test_contract_sac_transfer(
379+
app.getConfig().LEDGER_PROTOCOL_VERSION));
376380

377381
REQUIRE(client.transfer(a1, transferContract.getAddress(), 10));
378382

@@ -421,7 +425,8 @@ TEST_CASE("Native stellar asset contract",
421425
checkSponsorship(ltx, root.getPublicKey(), 0, nullptr, 0, 2, 2, 0);
422426
}
423427

424-
// Test batch_transfer with 5 destinations
428+
// Test batch_transfer with 5 destinations (protocol 23+)
429+
if (app.getConfig().LEDGER_PROTOCOL_VERSION >= 23)
425430
{
426431
auto batchDest1 = root.create("batchDest1", minBalance);
427432
auto batchDest2 = root.create("batchDest2", minBalance);
@@ -497,7 +502,8 @@ TEST_CASE("Stellar asset contract transfer with CAP-67 address types",
497502
auto a1Address = makeAccountAddress(a1.getPublicKey());
498503
auto a2Address = makeAccountAddress(a2.getPublicKey());
499504
TestContract& transferContract =
500-
test.deployWasmContract(rust_bridge::get_test_contract_sac_transfer());
505+
test.deployWasmContract(rust_bridge::get_test_contract_sac_transfer(
506+
test.getApp().getConfig().LEDGER_PROTOCOL_VERSION));
501507

502508
auto runTest = [&](bool useNativeAsset) {
503509
Asset tokenAsset = useNativeAsset ? txtest::makeNativeAsset() : asset;

test-tx-meta-baseline-current/InvokeHostFunctionTests.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
],
4545
"Module cache miss on immediate execution" : [ "+cR3oq2qY0I=", "+cR3oq2qY0I=" ],
4646
"Module cache miss on immediate execution|same ledger upload and execution" : [ "otnd+GHMKpE=", "/VLp/3iN+To=", "NDnBxhxdn4o=", "RCvKpCbS0VA=" ],
47-
"Native stellar asset contract" : [ "+cR3oq2qY0I=", "DUET1r2TwOg=" ],
47+
"Native stellar asset contract" :
48+
[
49+
"+cR3oq2qY0I=",
50+
"DUET1r2TwOg=",
51+
"j3E4E4zpoHM=",
52+
"nOOGkrrnOFw=",
53+
"UivZvwUUrZ0=",
54+
"HnO1VwITuAw=",
55+
"NC1BmSQafHo="
56+
],
4857
"Soroban authorization" :
4958
[
5059
"+cR3oq2qY0I=",

test-tx-meta-baseline-next/InvokeHostFunctionTests.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@
4545
],
4646
"Module cache miss on immediate execution" : [ "+cR3oq2qY0I=", "+cR3oq2qY0I=" ],
4747
"Module cache miss on immediate execution|same ledger upload and execution" : [ "otnd+GHMKpE=", "/VLp/3iN+To=", "NDnBxhxdn4o=", "RCvKpCbS0VA=" ],
48-
"Native stellar asset contract" : [ "+cR3oq2qY0I=", "DUET1r2TwOg=" ],
48+
"Native stellar asset contract" :
49+
[
50+
"+cR3oq2qY0I=",
51+
"DUET1r2TwOg=",
52+
"j3E4E4zpoHM=",
53+
"nOOGkrrnOFw=",
54+
"UivZvwUUrZ0=",
55+
"HnO1VwITuAw=",
56+
"NC1BmSQafHo="
57+
],
4958
"Soroban authorization" :
5059
[
5160
"+cR3oq2qY0I=",

0 commit comments

Comments
 (0)