test: Use proper length limits in codecov_tests (#6626)

This commit is contained in:
Mayukha Vadari
2026-03-25 09:10:12 -07:00
committed by GitHub
parent d006433579
commit 4b34102e8e
2 changed files with 20 additions and 17 deletions

View File

@@ -7,6 +7,7 @@ use core::panic;
use xrpl_std::core::current_tx::escrow_finish::{get_current_escrow_finish, EscrowFinish};
use xrpl_std::core::current_tx::traits::TransactionCommonFields;
use xrpl_std::core::locator::Locator;
use xrpl_std::core::types::blob::DEFAULT_BLOB_SIZE;
use xrpl_std::core::types::issue::Issue;
use xrpl_std::core::types::issue::XrpIssue;
use xrpl_std::core::types::keylets;
@@ -15,6 +16,7 @@ use xrpl_std::host;
use xrpl_std::host::error_codes;
use xrpl_std::host::trace::{trace, trace_num as trace_number};
use xrpl_std::sfield;
use xrpl_std::types::XRPL_CONTRACT_DATA_SIZE;
mod host_bindings_loose;
include!("host_bindings_loose.rs");
@@ -340,7 +342,7 @@ pub extern "C" fn finish() -> i32 {
error_codes::INVALID_PARAMS,
"get_tx_nested_array_len_neg_len",
);
let long_len = 4 * 1024 + 1;
let long_len = DEFAULT_BLOB_SIZE + 1;
check_result(
unsafe {
host_bindings_loose::get_tx_nested_array_len(locator.as_ptr() as i32, long_len as i32)
@@ -705,8 +707,9 @@ pub extern "C" fn finish() -> i32 {
error_codes::DATA_FIELD_TOO_LARGE,
"get_ledger_obj_nested_array_len_too_big_slice",
);
let too_big_data_len = XRPL_CONTRACT_DATA_SIZE + 1;
check_result(
unsafe { host::update_data(locator.as_ptr(), long_len) },
unsafe { host::update_data(locator.as_ptr(), too_big_data_len) },
error_codes::DATA_FIELD_TOO_LARGE,
"update_data_too_big_slice",
);

View File

@@ -470,7 +470,7 @@ extern std::string const codecovTestsWasmHex =
"9583c0004108101f4100419d83c0004111103c417f41041004417141ae83c000411e103c200041003602e801200141"
"7f1004417141c78ec000411e103c200041ea016a41003a0000200041003b01e801200141031004417d41e58ec00041"
"24103c200041003602e8012001418094ebdc031004417341898fc0004123103c4102100f416f41cc83c000411f103c"
"417f20002802a0011012417141eb83c000411f103c2002417f10124171418a84c000411f103c200241812010124174"
"417f20002802a0011012417141eb83c000411f103c2002417f10124171418a84c000411f103c200241810810124174"
"41a984c0004120103c200041e094ebdc036a220620002802a0011012417341c984c000411f103c2008420037030020"
"05420037030020034200370300200042003703e8012004411420064108200141201020417341ac8fc0004118103c20"
"0842003703002005420037030020034200370300200042003703e8012004411420044114200141201020417141c48f"
@@ -492,17 +492,17 @@ extern std::string const codecovTestsWasmHex =
"09411841a7a1c00041142001410210234171418392c000410e103c200620002802a001422a1001417341d685c00041"
"11103c200041003b01e8014102200141021007416f419192c000411b103c200041003b01e801410220014102100a41"
"6f41ac92c000412b103c200041003b01e8014101410220014102100b416f41d792c0004123103c4102100f416f41cc"
"83c000411f103c41021010416f41e785c000412f103c410141021011416f419686c0004127103c41b980c000418120"
"1006417441bd86c000411f103c41b980c00041c1001006417441dc86c000411a103c200041003b01e8012002418120"
"20014102100c417441fa92c0004121103c200041003b01e801200241812020014102100d4174419b93c0004131103c"
"200041003b01e8014101200241812020014102100e417441cc93c0004129103c20024181201012417441f686c00041"
"25103c200241812010134174419b87c0004135103c410120024181201014417441d087c000412d103c200241812010"
"15417441fd87c0004119103c41e782c00041812041a482c000410b41af82c000410e1017417441bd82c0004109103c"
"41e782c000410d41a482c00041812041af82c000410e1017417441bd82c0004109103c41e782c000410d41a482c000"
"410b41af82c0004181201017417441bd82c0004109103c200041003b01e8012002418120200141021016417441f593"
"c0004121103c200041003b01e80141a7a1c00041812041a7a1c00041142001410210234174419694c0004118103c20"
"0041003b01e80120044114200441142002418120200141021024417441ae94c000411f103c200041003b01e8012009"
"41812020044114200141021025417441cd94c0004122103c41e782c000410d200620002802a0014100100041734196"
"83c000411f103c41021010416f41e785c000412f103c410141021011416f419686c0004127103c41b980c000418108"
"1006417441bd86c000411f103c41b980c00041c1001006417441dc86c000411a103c200041003b01e8012002418108"
"20014102100c417441fa92c0004121103c200041003b01e801200241810820014102100d4174419b93c0004131103c"
"200041003b01e8014101200241810820014102100e417441cc93c0004129103c20024181081012417441f686c00041"
"25103c200241810810134174419b87c0004135103c410120024181081014417441d087c000412d103c200241812010"
"15417441fd87c0004119103c41e782c00041810841a482c000410b41af82c000410e1017417441bd82c0004109103c"
"41e782c000410d41a482c00041810841af82c000410e1017417441bd82c0004109103c41e782c000410d41a482c000"
"410b41af82c0004181081017417441bd82c0004109103c200041003b01e8012002418108200141021016417441f593"
"c0004121103c200041003b01e80141a7a1c00041810841a7a1c00041142001410210234174419694c0004118103c20"
"0041003b01e80120044114200441142002418108200141021024417441ae94c000411f103c200041003b01e8012009"
"41810820044114200141021025417441cd94c0004122103c41e782c000410d200620002802a0014100100041734196"
"88c000410f103c200042d487b6f4c7d4b1c0003700e00141e782c000410d200041e095ebdc036a2207410810264173"
"41a588c000411c103c41e782c000410d200620002802a001101f417341c188c0004116103c20074108200041e0016a"
"220641081027417341d788c0004118103c20064108200741081027417341ef88c0004118103c200041003b01e80120"
@@ -551,9 +551,9 @@ extern std::string const codecovTestsWasmHex =
"41021018417141e9a0c000411d103c41e782c000410d200220002802a001101e417141918ac0004123103c41e796ab"
"dd03410d41f189c000412041001000417341b48ac0004110103c41e796abdd03410d200641081026417341c48ac000"
"411d103c41e796abdd03410d20044114101e417341e18ac0004118103c41e796abdd03410d419583c0004108101f41"
"7341f98ac0004117103c200220002802a001200241812041001000417441908bc000410e103c200241812042011001"
"4174419e8bc0004112103c41e782c000418120200641081026417441b08bc000411b103c41e782c000418120200441"
"14101e417441cb8bc0004116103c41e782c000418120419583c0004108101f417441e18bc0004115103c41e782c000"
"7341f98ac0004117103c200220002802a001200241810841001000417441908bc000410e103c200241810842011001"
"4174419e8bc0004112103c41e782c000418108200641081026417441b08bc000411b103c41e782c000418108200441"
"14101e417441cb8bc0004116103c41e782c000418108419583c0004108101f417441e18bc0004115103c41e782c000"
"410d200220002802a001101f417141f68bc0004119103c200041003b018e02200220002802a0012004411420034102"
"102541714186a1c0004121103c41e782c000410d200220002802a001410210004171418f8cc0004114103c41014100"
"20044114101e410041a38cc000411a103c20004190026a240041010f0b0b418080c000410b417f20032003417f4e1b"