mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-26 23:19:07 +00:00
fix: compile the smart-contracts merge against develop and embed the contract test fixtures
This commit is contained in:
@@ -205,7 +205,7 @@ ContractCreate::doApply()
|
||||
ctx_.view().insert(sourceSle);
|
||||
}
|
||||
|
||||
std::uint32_t const seq = ctx_.tx.getSeqValue();
|
||||
std::uint32_t const seq = ctx_.tx.getSeqProxy().value();
|
||||
auto const contractKeylet = keylet::contract(*contractHash, accountID_, seq);
|
||||
auto contractSle = std::make_shared<SLE>(contractKeylet);
|
||||
|
||||
|
||||
@@ -116,9 +116,6 @@ EscrowFinish::preflight(PreflightContext const& ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (auto const err = credentials::checkFields(ctx.tx, ctx.j); !isTesSuccess(err))
|
||||
return err;
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,10 +57,15 @@
|
||||
#include <test/jtx/utility.h>
|
||||
|
||||
#include <xrpl/json/to_string.h>
|
||||
#include <xrpl/ledger/helpers/ContractUtils.h>
|
||||
#include <xrpl/protocol/Feature.h>
|
||||
#include <xrpl/protocol/digest.h>
|
||||
#include <xrpl/protocol/jss.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string_view>
|
||||
|
||||
namespace xrpl {
|
||||
namespace test {
|
||||
|
||||
@@ -510,21 +515,10 @@ class Contract_test : public beast::unit_test::Suite
|
||||
env.fund(XRP(10'000), alice);
|
||||
env.close();
|
||||
|
||||
env(contract::create(alice, BaseContractWasm),
|
||||
contract::add_function("func1", {}),
|
||||
contract::add_function("func2", {}),
|
||||
contract::add_function("func3", {}),
|
||||
contract::add_function("func4", {}),
|
||||
contract::add_function("func5", {}),
|
||||
contract::add_function("func6", {}),
|
||||
contract::add_function("func7", {}),
|
||||
contract::add_function("func8", {}),
|
||||
contract::add_function("func9", {}),
|
||||
contract::add_function("func10", {}),
|
||||
contract::add_function("func11", {}),
|
||||
contract::add_function("func12", {}),
|
||||
contract::add_function("func13", {}),
|
||||
Ter(temARRAY_TOO_LARGE));
|
||||
auto jt = env.jt(contract::create(alice, BaseContractWasm));
|
||||
for (std::size_t i = 0; i <= ::xrpl::contract::maxContractFunctions; ++i)
|
||||
contract::add_function("func" + std::to_string(i), {})(env, jt);
|
||||
env(jt, Ter(temARRAY_TOO_LARGE));
|
||||
}
|
||||
|
||||
// temREDUNDANT: Duplicate function name
|
||||
@@ -1490,37 +1484,23 @@ class Contract_test : public beast::unit_test::Suite
|
||||
}
|
||||
|
||||
std::string
|
||||
loadContractWasmStr(std::string const& contract_name = "")
|
||||
loadContractWasmStr(std::string const& contract_name)
|
||||
{
|
||||
std::string const& dir = "e2e-tests";
|
||||
std::string const name = "/Users/darkmatter/projects/ledger-works/xrpl-wasm-std/" + dir +
|
||||
"/" + contract_name + "/target/wasm32v1-none/release/" + contract_name + ".wasm";
|
||||
if (!boost::filesystem::exists(name))
|
||||
static std::map<std::string, std::string_view> const fixtures{
|
||||
{"contract_data", kContractDataWasmHex},
|
||||
{"emit_txn", kEmitTxnWasmHex},
|
||||
{"events", kEventsWasmHex},
|
||||
{"function_params", kFunctionParamsWasmHex},
|
||||
{"instance_params_other", kInstanceParamsOtherWasmHex},
|
||||
{"instance_params_uint", kInstanceParamsUintWasmHex},
|
||||
};
|
||||
auto const it = fixtures.find(contract_name);
|
||||
if (it == fixtures.end())
|
||||
{
|
||||
std::cout << "File does not exist: " << name << "\n";
|
||||
std::cout << "No wasm fixture for contract: " << contract_name << "\n";
|
||||
return "";
|
||||
}
|
||||
|
||||
std::ifstream file(name, std::ios::binary);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
std::cout << "Failed to open file: " << name << "\n";
|
||||
return "";
|
||||
}
|
||||
|
||||
// Read the file into a vector
|
||||
std::vector<char> const buffer(
|
||||
(std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
||||
|
||||
// Check if the buffer is empty
|
||||
if (buffer.empty())
|
||||
{
|
||||
std::cout << "File is empty or could not be read properly.\n";
|
||||
return "";
|
||||
}
|
||||
|
||||
return strHex(buffer);
|
||||
return std::string{it->second};
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -2756,7 +2756,7 @@ class Delegate_test : public beast::unit_test::Suite
|
||||
// DO NOT modify expectedDelegableCount unless all scenarios, including
|
||||
// edge cases, have been fully tested and verified.
|
||||
// ====================================================================
|
||||
std::size_t const expectedDelegableCount = 63;
|
||||
std::size_t const expectedDelegableCount = 62;
|
||||
|
||||
BEAST_EXPECTS(
|
||||
delegableCount == expectedDelegableCount,
|
||||
|
||||
15
src/test/app/wasm_fixtures/contract_data/Cargo.lock
generated
15
src/test/app/wasm_fixtures/contract_data/Cargo.lock
generated
@@ -1,15 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "contract_data"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"xrpl-wasm-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xrpl-wasm-std"
|
||||
version = "0.5.1-devnet5"
|
||||
source = "git+https://github.com/Transia-RnD/craft.git?branch=dangell%2Fsmart-contracts#3c8191ae9832ea25f7d8f3e5eeb33b65181d31b5"
|
||||
@@ -15,7 +15,7 @@ opt-level = 's'
|
||||
panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
xrpl-wasm-std = { git = "https://github.com/Transia-RnD/craft.git", branch = "dangell/smart-contracts", package = "xrpl-wasm-std" }
|
||||
xrpl-wasm-std = { git = "https://github.com/Transia-RnD/craft.git", rev = "ffbe88da26df27e59a72b6202883f42f696933cc", package = "xrpl-wasm-std" }
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
@@ -15,7 +15,7 @@ opt-level = 's'
|
||||
panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
xrpl-wasm-std = { git = "https://github.com/Transia-RnD/craft.git", branch = "dangell/smart-contracts", package = "xrpl-wasm-std" }
|
||||
xrpl-wasm-std = { git = "https://github.com/Transia-RnD/craft.git", rev = "ffbe88da26df27e59a72b6202883f42f696933cc", package = "xrpl-wasm-std" }
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
@@ -6,11 +6,12 @@ extern crate std;
|
||||
use xrpl_wasm_std::core::current_tx::contract_call::{ContractCall, get_current_contract_call};
|
||||
use xrpl_wasm_std::core::current_tx::traits::TransactionCommonFields;
|
||||
use xrpl_wasm_std::core::submit::inner_objects::build_memo;
|
||||
use xrpl_wasm_std::core::transaction_types::TT_PAYMENT;
|
||||
use xrpl_wasm_std::core::types::account_id::AccountID;
|
||||
use xrpl_wasm_std::host::{add_txn_field, build_txn, emit_built_txn};
|
||||
use xrpl_wasm_std::sfield;
|
||||
|
||||
const TT_PAYMENT: i32 = 0;
|
||||
|
||||
// ============================================================================
|
||||
// Constants
|
||||
// ============================================================================
|
||||
|
||||
@@ -15,7 +15,7 @@ opt-level = 's'
|
||||
panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
xrpl-wasm-std = { git = "https://github.com/Transia-RnD/craft.git", branch = "dangell/smart-contracts", package = "xrpl-wasm-std" }
|
||||
xrpl-wasm-std = { git = "https://github.com/Transia-RnD/craft.git", rev = "ffbe88da26df27e59a72b6202883f42f696933cc", package = "xrpl-wasm-std" }
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
@@ -1508,3 +1508,643 @@ extern std::string const kUpdateDataWasmHex =
|
||||
"6462353832393538616631656533303861373930636664623432626432343732302900490f7461726765745f666561"
|
||||
"7475726573042b0f6d757461626c652d676c6f62616c732b087369676e2d6578742b0f7265666572656e63652d7479"
|
||||
"7065732b0a6d756c746976616c7565";
|
||||
|
||||
extern std::string const kEventsWasmHex =
|
||||
"0061736d01000000010d0260047f7f7f7f017f6000017f02170108686f73745f6c69620a656d69745f6576656e7400"
|
||||
"000302010105030100110609017f01418080c0000b071302066d656d6f72790200066576656e747300010abd1d01ba"
|
||||
"1d01067f23004190086b22012400200141800c3b01082001428280808010370288080240034020032001280288086a"
|
||||
"22004180084f0d01200141086a20006a2003418080406b2d00003a0000200341016a22034106470d000b2001200128"
|
||||
"02880841066a22003602880820004180084904400240200141086a20006a41093a0000200120012802880841016a22"
|
||||
"003602880820004180084f0d02200141086a20006a41063a0000200120012802880841016a36028808410021030340"
|
||||
"20032001280288086a22004180084f0d01200141086a20006a2003418680c0006a2d00003a0000200341016a220341"
|
||||
"08470d000b2001200128028808220241086a220036028808417f21040240200241da076b41ff77490d002000418008"
|
||||
"4f0d03200141086a20006a41083a0000200120012802880841016a3602880841002103034020032001280288086a22"
|
||||
"004180084f0d04200141086a20006a2003418e80c0006a2d00003a0000200341016a22034108470d000b2001200128"
|
||||
"02880841086a22003602880820004180084f0d03200141086a20006a41153a0000200120012802880841016a220036"
|
||||
"02880820004180084f0d03200141086a20006a411a3a0000200120012802880841016a360288084100210303402003"
|
||||
"2001280288086a22004180084f0d04200141086a20006a2003419680c0006a2d00003a0000200341016a2203411447"
|
||||
"0d000b2001200128028808220241146a220036028808200241ca076b41ff77490d0020004180084f0d03200141086a"
|
||||
"20006a410b3a0000200120012802880841016a3602880841002103034020032001280288086a22004180084f0d0420"
|
||||
"0141086a20006a200341be80c0006a2d00003a0000200341016a2203410b470d000b2001200128028808410b6a2200"
|
||||
"3602880820004180084f0d03200141086a20006a41163a0000200120012802880841016a2200360288082000418008"
|
||||
"4f0d03200141086a20006a41083a0000200120012802880841016a22003602880820004180084f0d03200141086a20"
|
||||
"006a41143a0000200120012802880841016a3602880841002103034020032001280288086a22004180084f0d042001"
|
||||
"41086a20006a200341aa80c0006a2d00003a0000200341016a22034114470d000b2001200128028808220241146a22"
|
||||
"0036028808200241d3076b41ff77490d0020004180084f0d03200141086a20006a41073a0000200120012802880841"
|
||||
"016a3602880841002103034020032001280288086a22004180084f0d04200141086a20006a200341c980c0006a2d00"
|
||||
"003a0000200341016a22034107470d000b200120012802880841076a22003602880820004180084f0d03200141086a"
|
||||
"20006a41113a0000200120012802880841016a22003602880820004180084f0d03200141086a20006a41043a000020"
|
||||
"0120012802880841016a3602880841002103034020032001280288086a22004180084f0d04200141086a20006a4100"
|
||||
"3a0000200341016a22034110470d000b2001200128028808220241106a220036028808200241e6076b41ff77490d00"
|
||||
"20004180084f0d03200141086a20006a41063a0000200120012802880841016a360288084100210303402003200128"
|
||||
"0288086a22004180084f0d04200141086a20006a200341d080c0006a2d00003a0000200341016a22034106470d000b"
|
||||
"200120012802880841066a22003602880820004180084f0d03200141086a20006a41033a0000200120012802880841"
|
||||
"016a22003602880820004180084f0d03200141086a20006a41013a0000200120012802880841016a22003602880820"
|
||||
"004180084f0d03200141086a20006a41003a000020012802880841016a22004180084f0d03200141086a20006a4110"
|
||||
"3a00002001200128028808220241026a220036028808200241e1076b41ff77490d0020004180084f0d03200141086a"
|
||||
"20006a41073a0000200120012802880841016a3602880841002103034020032001280288086a22004180084f0d0420"
|
||||
"0141086a20006a200341d680c0006a2d00003a0000200341016a22034107470d000b200120012802880841076a2200"
|
||||
"3602880820004180084f0d03200141086a20006a41153a0000200120012802880841016a2200360288082000418008"
|
||||
"4f0d03200141086a20006a41113a0000200120012802880841016a3602880841002103034020032001280288086a22"
|
||||
"004180084f0d04200141086a20006a41003a0000200341016a22034114470d000b2001200128028808220241146a22"
|
||||
"0036028808200241366a4180084b0d0020004180084f0d03200141086a20006a41073a000020012001280288084101"
|
||||
"6a3602880841002103034020032001280288086a22004180084f0d04200141086a20006a200341dd80c0006a2d0000"
|
||||
"3a0000200341016a22034107470d000b200120012802880841076a22003602880820004180084f0d03200141086a20"
|
||||
"006a41193a0000200120012802880841016a22003602880820004180084f0d03200141086a20006a41153a00002001"
|
||||
"20012802880841016a3602880841002103034020032001280288086a22024180084f0d042002200141086a22006a41"
|
||||
"003a0000200341016a22034118470d000b200120012802880841186a36028808200028028008220241d7076b41ff77"
|
||||
"4f047f20024180084f0d04200020026a41073a0000200020002802800841016a360280084100210203402002200028"
|
||||
"0280086a22034180084f0d05200020036a200241e480c0006a2d00003a0000200241016a22024107470d000b200020"
|
||||
"002802800841076a22023602800820024180084f0d04200020026a41213a0000200020002802800841016a22023602"
|
||||
"800820024180084f0d04200020026a41053a0000200020002802800841016a36028008410021020340200220002802"
|
||||
"80086a22034180084f0d05200020036a41003a0000200241016a22024120470d000b200020002802800841206a3602"
|
||||
"800841000541010b0d00027f410121020240200028028008220341f4076b41ff774f044020034180084f0d06200020"
|
||||
"036a41063a0000200020002802800841016a3602800841002102034020022000280280086a22034180084f0d072000"
|
||||
"20036a200241eb80c0006a2d00003a0000200241016a22024106470d000b200020002802800841066a220236028008"
|
||||
"20024180084f0d01200020026a41053a0000200020002802800841016a22023602800820024180084f0d0120002002"
|
||||
"6a41023a0000200020002802800841016a22023602800820024180084f0d01200020026a41003a0000200028028008"
|
||||
"41016a22024180084f0d01200020026a41003a000020002802800841026a22034180084f0d0641002102200020036a"
|
||||
"41003a000020002802800841036a22034180084f0d06200020036a41203a0000200020002802800841046a36028008"
|
||||
"0b20020c010b0c040b0d00027f410121020240200028028008220341f0076b41ff774f044020034180084f0d062000"
|
||||
"20036a41063a0000200020002802800841016a3602800841002102034020022000280280086a22034180084f0d0720"
|
||||
"0020036a200241f180c0006a2d00003a0000200241016a22024106470d000b200020002802800841066a2202360280"
|
||||
"0820024180084f0d01200020026a41093a0000200020002802800841016a22023602800820024180084f0d01200020"
|
||||
"026a41033a0000200020002802800841016a22023602800820024180084f0d01200020026a41003a00002000280280"
|
||||
"0841016a22024180084f0d01200020026a41003a000020002802800841026a22024180084f0d01200020026a41003a"
|
||||
"000020002802800841036a22024180084f0d01200020026a41003a000020002802800841046a22024180084f0d0120"
|
||||
"0020026a41003a000020002802800841056a22024180084f0d01200020026a41003a000020002802800841066a2203"
|
||||
"4180084f0d0641002102200020036a41003a000020002802800841076a22034180084f0d06200020036a41c0003a00"
|
||||
"00200020002802800841086a360280080b20020c010b0c040b0d00200028028008220241f8076b41ff774f047f2002"
|
||||
"4180084f0d04200020026a41053a0000200020002802800841016a3602800841002102034020022000280280086a22"
|
||||
"034180084f0d05200020036a200241f780c0006a2d00003a0000200241016a22024105470d000b2000200028028008"
|
||||
"41056a22023602800820024180084f0d04200020026a41023a0000200020002802800841016a220236028008200241"
|
||||
"80084f0d04200020026a41103a0000200020002802800841016a22023602800820024180084f0d04200020026a4108"
|
||||
"3a0000200020002802800841016a3602800841000541010b0d00200128028808220041ee076b41ff77490d00200041"
|
||||
"80084f0d03200141086a20006a41023a000041012100200120012802880841016a3602880841002103034020012802"
|
||||
"880820036a22024180084f0d02200141086a220420026a20032d00fc80403a0000410121032000410021000d000b20"
|
||||
"0120012802880841026a22003602880820004180084f0d03200020046a410f3a0000200120012802880841016a2200"
|
||||
"3602880820004180084f0d03200020046a41073a0000200120012802880841016a220036028808200020046a410d3a"
|
||||
"0000200120012802880841016a3602880841002103034020032001280288086a22024180084f0d042002200141086a"
|
||||
"22006a200341fe80c0006a2d00003a0000200341016a2203410d470d000b2001200128028808410d6a360288084101"
|
||||
"41024103200028028008220220002802840822046b220341c1e100491b200341c101491b2205200447044020052004"
|
||||
"6b2103200220044b0440034020024180084b0d06200241016b220220036a22044180084f0d06200020046a20002002"
|
||||
"6a2d00003a00002000280284082002490d000b20002802800821020b20002005360284082000200220036a22023602"
|
||||
"8008200220056b21030b02400240200341c1014f0440200341c1e100490d01200341d989384f0d022000200341c1e1"
|
||||
"006b22033a0002200020034108763a000120002003411076410f6b3a00000c020b200020033a00000c010b20002003"
|
||||
"41c1016b22033a000120002003410876413f6b3a00000b418b81c00041062000200210001a410021040b2001419008"
|
||||
"6a240020040f0b0b0b000b0b96010200418080c0000b16616d6f756e7440000000000000c063757272656e63790041"
|
||||
"a280c0000b6f5553440000000000596915cfdeee3a695b3efd6bda9ac788a368b70b64657374696e6174696f6e7569"
|
||||
"6e7431323875696e74313675696e7431363075696e7431393275696e7432353675696e74333275696e74363475696e"
|
||||
"7438766c48656c6c6f2c20576f726c64216576656e7431004d0970726f64756365727302086c616e67756167650104"
|
||||
"52757374000c70726f6365737365642d6279010572757374631d312e39372e31202838626162323666346620323032"
|
||||
"362d30372d313429002c0f7461726765745f6665617475726573022b0f6d757461626c652d676c6f62616c732b0873"
|
||||
"69676e2d657874";
|
||||
|
||||
extern std::string const kContractDataWasmHex =
|
||||
"0061736d010000000143076000017f60087f7f7f7f7f7f7f7f017f60067f7f7f7f7f7f017f60077f7f7f7f7f7f7f01"
|
||||
"7f60097f7f7f7f7f7f7f7f7f017f60057f7f7f7f7f017f60037f7f7e017f02e7020a08686f73745f6c696205747261"
|
||||
"6365000508686f73745f6c69621c7365745f646174615f6e65737465645f6f626a6563745f6669656c64000108686f"
|
||||
"73745f6c69621c6765745f646174615f6e65737465645f6f626a6563745f6669656c64000108686f73745f6c696209"
|
||||
"74726163655f6e756d000608686f73745f6c6962157365745f646174615f6f626a6563745f6669656c64000208686f"
|
||||
"73745f6c6962156765745f646174615f6f626a6563745f6669656c64000208686f73745f6c69621c7365745f646174"
|
||||
"615f61727261795f656c656d656e745f6669656c64000308686f73745f6c69621c6765745f646174615f6172726179"
|
||||
"5f656c656d656e745f6669656c64000308686f73745f6c6962237365745f646174615f6e65737465645f6172726179"
|
||||
"5f656c656d656e745f6669656c64000408686f73745f6c6962236765745f646174615f6e65737465645f6172726179"
|
||||
"5f656c656d656e745f6669656c640004030908000000000000000005030100110609017f01418080c0000b07e40109"
|
||||
"066d656d6f72790200146f626a6563745f6e65737465645f637265617465000a146f626a6563745f6e65737465645f"
|
||||
"757064617465000b146f626a6563745f73696d706c655f637265617465000c146f626a6563745f73696d706c655f75"
|
||||
"7064617465000d196f626a6563745f776974685f6172726179735f637265617465000e196f626a6563745f77697468"
|
||||
"5f6172726179735f757064617465000f206f626a6563745f776974685f6e65737465645f6172726179735f63726561"
|
||||
"74650010206f626a6563745f776974685f6e65737465645f6172726179735f75706461746500110a822e08a0060204"
|
||||
"7f017e230041306b22002400418080c000412441004100410010001a200041b480c000280000360218200041ac80c0"
|
||||
"00290000370310200041a480c00029000037030841b880c000411441004100410010001a20004190183b0020200041"
|
||||
"086a2201411441cc80c000410341cf80c0004106200041206a2202410210011a200041003a0020027f024002400240"
|
||||
"2001411441cc80c000410341cf80c0004106200241011002410146044041d580c0004117200031002010031a41ec80"
|
||||
"c000411541004100410010001a20004180809cf900360021200041023a002020014114418181c0004105418681c000"
|
||||
"41052002410510011a2000410036022020014114418181c0004105418681c00041052002410410024104470d01418b"
|
||||
"81c00041152000280220220341ff81fc0771410878200341187841ff81fc077172ad10031a41a081c000412a410041"
|
||||
"00410010001a20004180808028360021200041023a002020014114418181c000410541ca81c0004105200241051001"
|
||||
"1a20004180808cc07e360021200041023a002020014114418181c000410541cf81c00041052002410510011a200041"
|
||||
"0036022020014114418181c000410541ca81c00041052002410410024104470d0241d481c000411620002802202203"
|
||||
"41ff81fc0771410878200341187841ff81fc077172ad10031a41ea81c000411541004100410010001a200042808080"
|
||||
"8090c9a58152370021200041033a00202001411441ff81c0004104418382c00041092002410910011a200042003703"
|
||||
"202001411441ff81c0004104418382c00041092002410810024108460440418c82c000411520002903202204423886"
|
||||
"20044280fe0383422886842004428080fc0783421886200442808080f80f834208868484200442088842808080f80f"
|
||||
"832004421888428080fc07838420044228884280fe0383200442388884848410031a41a182c0004122410041004100"
|
||||
"10001a41000c050b41c382c000411e41004100410010001a0c030b419e83c000412041004100410010001a0c020b41"
|
||||
"8083c000411e41004100410010001a0c010b41e182c000411f41004100410010001a0b417f0b200041306a24000bbd"
|
||||
"0401037f230041206b2200240041be83c000412441004100410010001a200041b480c000280000360210200041ac80"
|
||||
"c000290000370308200041a480c00029000037030041e283c000412141004100410010001a2000418080c0c9033600"
|
||||
"19200041023a001820004114418181c0004105418681c0004105200041186a2201410510011a200041003602180240"
|
||||
"0240024020004114418181c0004105418681c00041052001410410024104460440418384c000411f20002802182202"
|
||||
"41ff81fc0771410878200241187841ff81fc077172ad10031a41a284c000411e41004100410010001a200041808080"
|
||||
"d000360019200041023a001820004114418181c000410541ca81c00041052001410510011a20004100360218200041"
|
||||
"14418181c000410541ca81c00041052001410410024104470d0141c084c00041182000280218220241ff81fc077141"
|
||||
"0878200241187841ff81fc077172ad10031a4100210241d884c000411a41004100410010001a200041808080f00136"
|
||||
"0019200041023a00182000411441f284c000410641f884c00041072001410510011a200041003602182000411441f2"
|
||||
"84c000410641f884c0004107200141041002410446044041ff84c000411d2000280218220141ff81fc077141087820"
|
||||
"0141187841ff81fc077172ad10031a419c85c000412241004100410010001a0c040b41be85c0004122410041004100"
|
||||
"10001a0c020b41f985c000412041004100410010001a0c010b41e085c000411941004100410010001a0b417f21020b"
|
||||
"200041206a240020020bce0702037f017e230041306b22002400419986c000412441004100410010001a200041b480"
|
||||
"c000280000360210200041ac80c000290000370308200041a480c00029000037030041bd86c000410d410041004100"
|
||||
"10001a20004190d4003b00182000411441ca86c0004108200041186a2201410210041a200041003a0018027f024002"
|
||||
"40024002402000411441ca86c0004108200141011005410146044041d286c000410d200031001810031a41df86c000"
|
||||
"410e41004100410010001a200041d2013a001a20004181083b00182000411441ed86c00041092001410310041a2000"
|
||||
"41003b01182000411441ed86c00041092001410210054102470d0141f686c000410e20002f01182202410874200241"
|
||||
"087672ad42ffff038310031a418487c000410e41004100410010001a20004180808018360019200041023a00182000"
|
||||
"4114419287c00041052001410510041a200041808080e000360019200041023a001820004114419787c00041052001"
|
||||
"410510041a2000410036021820004114419287c00041052001410410054104470d02419c87c0004110200028021822"
|
||||
"0241ff81fc0771410878200241187841ff81fc077172ad10031a41ac87c000410e41004100410010001a2000428080"
|
||||
"8090c089ac8b6a370019200041033a00182000411441ba87c00041092001410910041a200042003703182000411441"
|
||||
"ba87c00041092001410810054108470d0341c387c000410e2000290318220342388620034280fe0383422886842003"
|
||||
"428080fc0783421886200342808080f80f834208868484200342088842808080f80f832003421888428080fc078384"
|
||||
"20034228884280fe0383200342388884848410031a41d187c000411441004100410010001a20004188283b00182000"
|
||||
"41e587c00029000037001a200041ed87c000290000370022200041f587c00028000036002a2000411441f987c00041"
|
||||
"0b2001411610041a2000420037002520004200370320200042003703182000411441f987c000410b20014115100541"
|
||||
"15470d04418488c000412041004100410010001a41a488c000411b41004100410010001a2000410036021820004114"
|
||||
"41bf88c000410b200141041005410446044041ca88c000412c41004100410010001a417f0c060b41f688c000412b41"
|
||||
"004100410010001a41a189c000412241004100410010001a41000c050b41a78ac000411641004100410010001a417f"
|
||||
"0c040b41908ac000411741004100410010001a417f0c030b41f789c000411941004100410010001a417f0c020b41e0"
|
||||
"89c000411741004100410010001a417f0c010b41c389c000411d41004100410010001a417f0b200041306a24000bf1"
|
||||
"0301037f230041206b2200240041bd8ac000412441004100410010001a200041b480c000280000360210200041ac80"
|
||||
"c000290000370308200041a480c00029000037030041e18ac000411441004100410010001a20004190c6013b001820"
|
||||
"00411441ca86c0004108200041186a2201410210041a200041003a00180240024002402000411441ca86c000410820"
|
||||
"0141011005410146044041f58ac0004115200031001810031a418a8bc000411641004100410010001a200041808080"
|
||||
"20360019200041023a001820004114419287c00041052001410510041a2000410036021820004114419287c0004105"
|
||||
"2001410410054104470d0141a08bc00041182000280218220241ff81fc0771410878200241187841ff81fc077172ad"
|
||||
"10031a4100210241b88bc000411c41004100410010001a200041808080a006360019200041023a00182000411441d4"
|
||||
"8bc00041062001410510041a200041003602182000411441d48bc0004106200141041005410446044041da8bc00041"
|
||||
"152000280218220141ff81fc0771410878200141187841ff81fc077172ad10031a41ef8bc000412241004100410010"
|
||||
"001a0c040b41918cc000411a41004100410010001a0c020b41a78ac000411641004100410010001a0c010b41f789c0"
|
||||
"00411941004100410010001a0b417f21020b200041206a240020020bb80702047f017e230041306b2200240041ab8c"
|
||||
"c000412941004100410010001a200041b480c000280000360218200041ac80c000290000370310200041a480c00029"
|
||||
"000037030841d48cc000411341004100410010001a20004190143b0020200041086a2201411441e78cc00041084100"
|
||||
"200041206a2202410210061a20004190283b00202001411441e78cc000410841012002410210061a200041903c3b00"
|
||||
"202001411441e78cc000410841022002410210061a200041003a0020024002400240024002402001411441e78cc000"
|
||||
"41084100200241011007410146044041ef8cc0004111200031002010031a200041003a00202001411441e78cc00041"
|
||||
"0841012002410110074101470d0141808dc0004111200031002010031a41918dc000411441004100410010001a2000"
|
||||
"41e4003a0022200041013b00202001411441a58dc000410941002002410310061a200041c8013a0022200041013b00"
|
||||
"202001411441a58dc000410941012002410310061a200041003b01202001411441a58dc00041094100200241021007"
|
||||
"4102470d0241ae8dc000411220002f01202203410874200341087672ad42ffff038310031a41c08dc0004114410041"
|
||||
"00410010001a20004180808cc07e360021200041023a00202001411441d48dc000410941002002410510061a200041"
|
||||
"80809c807d360021200041023a00202001411441d48dc000410941012002410510061a200041003602202001411441"
|
||||
"d48dc000410941002002410410074104470d0341dd8dc00041122000280220220341ff81fc07714108782003411878"
|
||||
"41ff81fc077172ad10031a4100210341ef8dc000411441004100410010001a200042808080808080c0931037002120"
|
||||
"0041033a00202001411441838ec000410941002002410910061a20004280808080808080a720370021200041033a00"
|
||||
"202001411441838ec000410941012002410910061a200042003703202001411441838ec00041094100200241081007"
|
||||
"4108460440418c8ec00041122000290320220442388620044280fe0383422886842004428080fc0783421886200442"
|
||||
"808080f80f834208868484200442088842808080f80f832004421888428080fc07838420044228884280fe03832004"
|
||||
"42388884848410031a419e8ec000412741004100410010001a0c060b41c58ec000411b41004100410010001a0c040b"
|
||||
"41b08fc000411a41004100410010001a0c030b41968fc000411a41004100410010001a0c020b41fb8ec000411b4100"
|
||||
"4100410010001a0c010b41e08ec000411b41004100410010001a0b417f21030b200041306a240020030bf40301037f"
|
||||
"230041206b2200240041ca8fc000412941004100410010001a200041b480c000280000360210200041ac80c0002900"
|
||||
"00370308200041a480c00029000037030041f38fc000412041004100410010001a2000418080f88806360019200041"
|
||||
"023a00182000411441d48dc00041094100200041186a2202410510061a200041003602180240024002402000411441"
|
||||
"d48dc000410941002002410410074104460440419390c000411f2000280218220141ff81fc07714108782001411878"
|
||||
"41ff81fc077172ad10031a41b290c000412841004100410010001a2000412c3a001a20004181023b00182000411441"
|
||||
"a58dc000410941022002410310061a200041003b01182000411441a58dc000410941022002410210074102470d0141"
|
||||
"da90c000411b20002f01182201410874200141087672ad42ffff038310031a4100210141f590c000412c4100410041"
|
||||
"0010001a20004190e4003b00182000411441e78cc000410841052002410210061a200041003a00182000411441e78c"
|
||||
"c00041084105200241011007410146044041a191c0004116200031001810031a41b791c00041274100410041001000"
|
||||
"1a0c040b41de91c000411f41004100410010001a0c020b419d92c000412041004100410010001a0c010b41fd91c000"
|
||||
"412041004100410010001a0b417f21010b200041206a240020010baa0702047f017e230041306b2200240041bd92c0"
|
||||
"00413041004100410010001a200041b480c000280000360218200041ac80c000290000370310200041a480c0002900"
|
||||
"0037030841ed92c000411a41004100410010001a20004190ee003b0020200041086a22014114418793c000410c4100"
|
||||
"419393c0004106200041206a2202410210081a2000419084013b002020014114418793c000410c4100419993c00041"
|
||||
"062002410210081a200041909a013b002020014114418793c000410c4101419393c00041062002410210081a200041"
|
||||
"003a00200240024002400240024020014114418793c000410c4100419393c00041062002410110094101460440419f"
|
||||
"93c000411c200031002010031a200041003a002020014114418793c000410c4100419993c000410620024101100941"
|
||||
"01470d0141bb93c000411c200031002010031a200041003a002020014114418793c000410c4101419393c000410620"
|
||||
"02410110094101470d0241d793c000411c200031002010031a41f393c000411b41004100410010001a2000418080d4"
|
||||
"987b360021200041023a002020014114418e94c00041104100419e94c00041052002410510081a2000418080e8d000"
|
||||
"360021200041023a002020014114418e94c00041104101419e94c00041052002410510081a20004100360220200141"
|
||||
"14418e94c00041104100419e94c00041052002410410094104470d0341a394c000411f2000280220220341ff81fc07"
|
||||
"71410878200341187841ff81fc077172ad10031a4100210341c294c000411b41004100410010001a20004280808080"
|
||||
"80a080c39f7f370021200041033a00202001411441dd94c0004105410041e294c00041022002410910081a20004280"
|
||||
"80808080a080f1c000370021200041033a00202001411441dd94c0004105410041e494c00041052002410910081a20"
|
||||
"0042003703202001411441dd94c0004105410041e294c0004102200241081009410846044041e994c0004111200029"
|
||||
"0320220442388620044280fe0383422886842004428080fc0783421886200442808080f80f83420886848420044208"
|
||||
"8842808080f80f832004421888428080fc07838420044228884280fe0383200442388884848410031a41fa94c00041"
|
||||
"2e41004100410010001a0c060b41a895c000411a41004100410010001a0c040b41b496c00041254100410041001000"
|
||||
"1a0c030b418f96c000412541004100410010001a0c020b41ea95c000412541004100410010001a0c010b41c295c000"
|
||||
"412841004100410010001a0b417f21030b200041306a240020030bff0401027f230041206b2200240041d996c00041"
|
||||
"3041004100410010001a200041b480c000280000360210200041ac80c000290000370308200041a480c00029000037"
|
||||
"0300418997c000412841004100410010001a20004190b0013b001820004114418793c000410c4100419393c0004106"
|
||||
"200041186a2201410210081a200041003a0018027f02400240024020004114418793c000410c4100419393c0004106"
|
||||
"200141011009410146044041b197c0004129200031001810031a41da97c000412341004100410010001a20004190de"
|
||||
"013b001820004114418793c000410c410041fd97c00041062001410210081a200041003a001820004114418793c000"
|
||||
"410c410041fd97c00041062001410110094101470d01418398c0004121200031001810031a41a498c0004119410041"
|
||||
"00410010001a20004190c6013b001820004114418793c000410c4102419393c00041062001410210081a200041003a"
|
||||
"001820004114418793c000410c4102419393c00041062001410110094101470d0241bd98c000412120003100181003"
|
||||
"1a41de98c000412d41004100410010001a200041808088c17b360019200041023a001820004114418e94c000411041"
|
||||
"01419e94c00041052001410510081a2000410036021820004114418e94c00041104101419e94c00041052001410410"
|
||||
"094104460440418b99c000412c2000280218220141ff81fc0771410878200141187841ff81fc077172ad10031a41b7"
|
||||
"99c000412e41004100410010001a41000c050b41e599c000412d41004100410010001a0c030b41e69ac000412a4100"
|
||||
"4100410010001a0c020b41bc9ac000412a41004100410010001a0c010b41929ac000412a41004100410010001a0b41"
|
||||
"7f0b200041206a24000b0b9a1b0100418080c0000b901b3d3d3d205445535420323a204e6573746564204f626a6563"
|
||||
"7420437265617465203d3d3dae123a8556f3cf91154711376afb0f894f832b3d54657374696e67206e657374656420"
|
||||
"75382e2e2e6b65797375626b657952656164206261636b206e65737465642076616c75653a54657374696e67206e65"
|
||||
"73746564207533322e2e2e737461747373636f726552656164206261636b206e6573746564207533323a416464696e"
|
||||
"67206d756c7469706c65206669656c647320746f206e6573746564206f626a6563742e2e2e6c6576656c636f696e73"
|
||||
"52656164206261636b2073746174732e6c6576656c3a54657374696e67206e6573746564207536342e2e2e64617461"
|
||||
"74696d657374616d7052656164206261636b206e6573746564207536343a4e6573746564206f626a65637420637265"
|
||||
"61746520746573747320706173736564214661696c656420746f2072656164206261636b206e657374656420753634"
|
||||
"4661696c656420746f2072656164206261636b2073746174732e6c6576656c4661696c656420746f20726561642062"
|
||||
"61636b206e6573746564207533324661696c656420746f2072656164206261636b206e65737465642076616c75653d"
|
||||
"3d3d205445535420323a204e6573746564204f626a65637420557064617465203d3d3d5570646174696e67206e6573"
|
||||
"7465642073636f726520746f2031323334352e2e2e52656164206261636b2075706461746564206e65737465642073"
|
||||
"636f72653a5570646174696e67206e6573746564206c6576656c20746f2031302e2e2e52656164206261636b207570"
|
||||
"6461746564206c6576656c3a416464696e67206e6577206e6573746564206669656c642e2e2e636f6e66696774696d"
|
||||
"656f757452656164206261636b206e657720636f6e6669672e74696d656f75743a4e6573746564206f626a65637420"
|
||||
"75706461746520746573747320706173736564214661696c656420746f2072656164206261636b20636f6e6669672e"
|
||||
"74696d656f75744661696c656420746f2072656164206261636b206c6576656c4661696c656420746f207265616420"
|
||||
"6261636b206e65737465642073636f72653d3d3d205445535420313a2053696d706c65204f626a6563742043726561"
|
||||
"7465203d3d3d54657374696e672075382e2e2e76616c75655f753852656164206261636b2075383a54657374696e67"
|
||||
"207531362e2e2e76616c75655f75313652656164206261636b207531363a54657374696e67207533322e2e2e636f75"
|
||||
"6e74746f74616c52656164206261636b20636f756e743a54657374696e67207536342e2e2e76616c75655f75363452"
|
||||
"656164206261636b207536343a54657374696e67204163636f756e7449442e2e2e0596915cfdeee3a695b3efd6bda9"
|
||||
"ac788a368b7b64657374696e6174696f6e52656164206261636b204163636f756e744944207375636365737366756c"
|
||||
"6c7954657374696e67206e6f6e2d6578697374656e74206b65792e2e2e6e6f6e6578697374656e744552524f523a20"
|
||||
"53686f756c64206e6f74206861766520666f756e64206e6f6e6578697374656e74206b6579436f72726563746c7920"
|
||||
"72657475726e6564204e6f6e6520666f72206e6f6e6578697374656e74206b657953696d706c65206f626a65637420"
|
||||
"63726561746520746573747320706173736564214661696c656420746f2072656164206261636b204163636f756e74"
|
||||
"49444661696c656420746f2072656164206261636b207536344661696c656420746f2072656164206261636b20636f"
|
||||
"756e744661696c656420746f2072656164206261636b207531364661696c656420746f2072656164206261636b2075"
|
||||
"383d3d3d205445535420313a2053696d706c65204f626a65637420557064617465203d3d3d5570646174696e672075"
|
||||
"3820746f2039392e2e2e52656164206261636b20757064617465642075383a5570646174696e6720636f756e742074"
|
||||
"6f20342e2e2e52656164206261636b207570646174656420636f756e743a416464696e67206e6577206669656c6420"
|
||||
"27737461747573272e2e2e73746174757352656164206261636b206e6577207374617475733a53696d706c65206f62"
|
||||
"6a6563742075706461746520746573747320706173736564214661696c656420746f2072656164206261636b207374"
|
||||
"617475733d3d3d205445535420333a204f626a65637420776974682041727261797320437265617465203d3d3d5465"
|
||||
"7374696e672075382061727261792e2e2e61727261795f7538526561642061727261795f75385b305d3a5265616420"
|
||||
"61727261795f75385b315d3a54657374696e67207531362061727261792e2e2e61727261795f753136526561642061"
|
||||
"727261795f7531365b305d3a54657374696e67207533322061727261792e2e2e61727261795f753332526561642061"
|
||||
"727261795f7533325b305d3a54657374696e67207536342061727261792e2e2e61727261795f753634526561642061"
|
||||
"727261795f7536345b305d3a4f626a6563742077697468206172726179732063726561746520746573747320706173"
|
||||
"736564214661696c656420746f20726561642061727261795f7536345b305d4661696c656420746f20726561642061"
|
||||
"727261795f7533325b305d4661696c656420746f20726561642061727261795f7531365b305d4661696c656420746f"
|
||||
"20726561642061727261795f75385b315d4661696c656420746f20726561642061727261795f75385b305d3d3d3d20"
|
||||
"5445535420333a204f626a65637420776974682041727261797320557064617465203d3d3d5570646174696e672061"
|
||||
"727261795f7533325b305d20746f20373737372e2e2e52656164206261636b20757064617465642061727261795f75"
|
||||
"33325b305d3a416464696e67206e657720617272617920656c656d656e742061727261795f7531365b325d2e2e2e52"
|
||||
"656164206261636b206e65772061727261795f7531365b325d3a416464696e672061727261795f75385b355d202873"
|
||||
"6b697070696e6720696e646963657320332d34292e2e2e52656164206261636b2061727261795f75385b355d3a4f62"
|
||||
"6a6563742077697468206172726179732075706461746520746573747320706173736564214661696c656420746f20"
|
||||
"72656164206261636b2061727261795f75385b355d4661696c656420746f2072656164206261636b2061727261795f"
|
||||
"7531365b325d4661696c656420746f2072656164206261636b2061727261795f7533325b305d3d3d3d205445535420"
|
||||
"343a204f626a6563742077697468204e65737465642041727261797320437265617465203d3d3d54657374696e6720"
|
||||
"6e65737465642075382061727261792e2e2e6e65737465645f61727261796669656c64316669656c64325265616420"
|
||||
"6e65737465645f61727261795b305d2e6669656c64313a52656164206e65737465645f61727261795b305d2e666965"
|
||||
"6c64323a52656164206e65737465645f61727261795b315d2e6669656c64313a54657374696e67206e657374656420"
|
||||
"7533322061727261792e2e2e6e65737465645f61727261795f75333276616c756552656164206e65737465645f6172"
|
||||
"7261795f7533325b305d2e76616c75653a54657374696e67206e6573746564207536342061727261792e2e2e697465"
|
||||
"6d736964707269636552656164206974656d735b305d2e69643a4f626a6563742077697468206e6573746564206172"
|
||||
"726179732063726561746520746573747320706173736564214661696c656420746f2072656164206974656d735b30"
|
||||
"5d2e69644661696c656420746f2072656164206e65737465645f61727261795f7533325b305d2e76616c7565466169"
|
||||
"6c656420746f2072656164206e65737465645f61727261795b315d2e6669656c64314661696c656420746f20726561"
|
||||
"64206e65737465645f61727261795b305d2e6669656c64324661696c656420746f2072656164206e65737465645f61"
|
||||
"727261795b305d2e6669656c64313d3d3d205445535420343a204f626a6563742077697468204e6573746564204172"
|
||||
"7261797320557064617465203d3d3d5570646174696e67206e65737465645f61727261795b305d2e6669656c643120"
|
||||
"746f2038382e2e2e52656164206261636b2075706461746564206e65737465645f61727261795b305d2e6669656c64"
|
||||
"313a416464696e67206669656c643320746f206e65737465645f61727261795b305d2e2e2e6669656c643352656164"
|
||||
"206261636b206e65737465645f61727261795b305d2e6669656c64333a416464696e67206e65737465645f61727261"
|
||||
"795b325d2e2e2e52656164206261636b206e65737465645f61727261795b325d2e6669656c64313a5570646174696e"
|
||||
"67206e65737465645f61727261795f7533325b315d2e76616c756520746f20383838382e2e2e52656164206261636b"
|
||||
"2075706461746564206e65737465645f61727261795f7533325b315d2e76616c75653a4f626a656374207769746820"
|
||||
"6e6573746564206172726179732075706461746520746573747320706173736564214661696c656420746f20726561"
|
||||
"64206261636b206e65737465645f61727261795f7533325b315d2e76616c75654661696c656420746f207265616420"
|
||||
"6261636b206e65737465645f61727261795b325d2e6669656c64314661696c656420746f2072656164206261636b20"
|
||||
"6e65737465645f61727261795b305d2e6669656c64334661696c656420746f2072656164206261636b206e65737465"
|
||||
"645f61727261795b305d2e6669656c6431004d0970726f64756365727302086c616e6775616765010452757374000c"
|
||||
"70726f6365737365642d6279010572757374631d312e39372e31202838626162323666346620323032362d30372d31"
|
||||
"3429002c0f7461726765745f6665617475726573022b0f6d757461626c652d676c6f62616c732b087369676e2d6578"
|
||||
"74";
|
||||
|
||||
extern std::string const kEmitTxnWasmHex =
|
||||
"0061736d0100000001200560017f017f60037f7f7f017f60047f7f7f7f017f60037f7f7e017f6000017f0276050868"
|
||||
"6f73745f6c69620c6765745f74785f6669656c64000108686f73745f6c6962096275696c645f74786e000008686f73"
|
||||
"745f6c69620d6164645f74786e5f6669656c64000208686f73745f6c69620e656d69745f6275696c745f74786e0000"
|
||||
"08686f73745f6c69620974726163655f6e756d00030302010405030100110609017f01418080c0000b071102066d65"
|
||||
"6d6f7279020004656d697400050af70a01f40a02117f017e230041b0086b2200240020004100360240200042003703"
|
||||
"382000420037033041818020200041306a220c41141000220141144604402000200029003c37002520002000290037"
|
||||
"370320200020002d00323a001e200020002f01303b011c200020002903203703082000200029002537000d20002800"
|
||||
"332101416e210d0240410010014100480d0041004181801841df80c000410810024100480d00200041143a00302000"
|
||||
"20002f011c3b0031200020002d001e3a003320002001360034200020002903083700382000200029000d37003d4100"
|
||||
"41838020200c411510024100480d00200041073a0032200041eaf9013b0030200041fd183b003a200041fe143b0048"
|
||||
"200042e1d5f3a3e0ed9bbae500370054200041fd3e3b005c2000418080c0002800003600332000418380c000280000"
|
||||
"3600362000418780c00029000037003c2000418f80c0002800003600442000419380c000290000221137004a200041"
|
||||
"9b80c0002f000022013b0052200041fe143b007d200041e1d5f79b0236008901200041b480c0002900003700752000"
|
||||
"41ad80c00029000037006e200041a580c0002900003700662000419d80c00029000037005e2000201137007f200020"
|
||||
"013b008701230041106b2106024041002000418d016a22026b410371220320026a220420024d0d0041bc80c0002101"
|
||||
"20030440200321050340200220012d00003a0000200141016a2101200241016a2102200541016b22050d000b0b2003"
|
||||
"41016b4107490d000340200220012d00003a0000200241016a200141016a2d00003a0000200241026a200141026a2d"
|
||||
"00003a0000200241036a200141036a2d00003a0000200241046a200141046a2d00003a0000200241056a200141056a"
|
||||
"2d00003a0000200241066a200141066a2d00003a0000200241076a200141076a2d00003a0000200141086a21012002"
|
||||
"41086a22022004470d000b0b2004412320036b220f417c7122106a21020240200341bc80c0006a2207410371220345"
|
||||
"0440200220044d0d0120072103034020042003280200360200200341046a2103200441046a22042002490d000b0c01"
|
||||
"0b410021012006410036020c2006410c6a2003722105410420036b22084101710440200520072d00003a0000410121"
|
||||
"010b20084102710440200120056a200120076a2f01003b01000b200720036b210520034103742108200628020c210a"
|
||||
"2002200441046a4b0440410020086b411871210b034020042201200a200876200541046a2205280200220a200b7472"
|
||||
"360200200141046a2104200141086a2002490d000b0b41002101200641003a0008200641003a0006027f2003410146"
|
||||
"044041002103200641086a0c010b200541056a2d00002006200541046a2d000022033a000841087421094102210e20"
|
||||
"0641066a0b210b20042007410171047f200b200541046a200e6a2d00003a000020062d0006411074210120062d0008"
|
||||
"0520030b41ff0171200120097272410020086b41187174200a200876723602000b200720106a210302402002200f41"
|
||||
"0371220420026a22054f0d002004220104400340200220032d00003a0000200341016a2103200241016a2102200141"
|
||||
"016b22010d000b0b200441016b4107490d000340200220032d00003a0000200241016a200341016a2d00003a000020"
|
||||
"0241026a200341026a2d00003a0000200241036a200341036a2d00003a0000200241046a200341046a2d00003a0000"
|
||||
"200241056a200341056a2d00003a0000200241066a200341066a2d00003a0000200241076a200341076a2d00003a00"
|
||||
"00200341086a2103200241086a22022005470d000b0b200041e1e3033b00b00141004189803c200c41820110024100"
|
||||
"480d00410010032201411f75200171210d0b200041b0086a2400200d0f0b41e780c000410b417f20012001417f4e1b"
|
||||
"ac1004000b0b7b0100418080c0000b72696e766f696365494e562d323032342d303031746578742f706c61696e5061"
|
||||
"796d656e7420666f7220636f6e73756c74696e672073657276696365734164646974696f6e616c207265666572656e"
|
||||
"63653a2050726f6a65637420416c70686140000000000000c06572726f725f636f64653d004d0970726f6475636572"
|
||||
"7302086c616e6775616765010452757374000c70726f6365737365642d6279010572757374631d312e39372e312028"
|
||||
"38626162323666346620323032362d30372d313429002c0f7461726765745f6665617475726573022b0f6d75746162"
|
||||
"6c652d676c6f62616c732b087369676e2d657874";
|
||||
|
||||
extern std::string const kFunctionParamsWasmHex =
|
||||
"0061736d01000000014d0b60047f7f7f7f017f60037f7f7f006000017f60037f7f7e017f60057f7f7f7f7f017f6007"
|
||||
"7f7f7f7f7f7f7f017f60057f7e7f7f7f017f60027f7f0060027f7f017f60037f7f7f017f60017f000289010608686f"
|
||||
"73745f6c69620e66756e6374696f6e5f706172616d000008686f73745f6c69620974726163655f6e756d000308686f"
|
||||
"73745f6c6962057472616365000408686f73745f6c696209666c6f61745f616464000508686f73745f6c696209666c"
|
||||
"6f61745f736574000608686f73745f6c69621274726163655f6f70617175655f666c6f617400000309080701080201"
|
||||
"02090a05030100110609017f01418080c0000b073903066d656d6f727902001566756e6374696f6e5f706172616d73"
|
||||
"5f6f7468657200091466756e6374696f6e5f706172616d735f75696e74000b0aa62408fa0a020d7f017e230041e000"
|
||||
"6b22032400200341086a2202100d02400240024020014106200241301000220141004c04402000417f360200200041"
|
||||
"ff013a00040c010b2003200341086a2001100720032802002101027f02400240200328020422024108462002413046"
|
||||
"72452002412147710d0020012d00002205c02204410048044020024130470d012003200129001d3703382003200129"
|
||||
"00253703402003200128002c3600472003200129000837004b200320012900103700532003200128001836005b2001"
|
||||
"2d001c21022001290000210f41010c030b2004412071450d01200241084d0d04200241204d0d052003200129000937"
|
||||
"033820032001290011370340200320012900193703482001290001220f423886200f4280fe038342288684200f4280"
|
||||
"80fc0783421886200f42808080f80f834208868484200f42088842808080f80f83200f421888428080fc078384200f"
|
||||
"4228884280fe0383200f423888848484210f200441c00171410676210241020c020b2000417f360200200041fc013a"
|
||||
"00040c020b2001290000220f420183423886200f4280fe038342288684200f428080fc0783421886200f42808080f8"
|
||||
"0f834208868484200f42088842808080f80f83200f421888428080fc078384200f4228884280fe0383200f42388884"
|
||||
"8484220f4200200f7d200541c000711b210f41000b2101200020023a00102000200f37030820002001360200200341"
|
||||
"386a2106230041106b210702404100200041116a22016b410371220220016a220420014d0d00200621002002044020"
|
||||
"0221050340200120002d00003a0000200041016a2100200141016a2101200541016b22050d000b0b200241016b4107"
|
||||
"490d000340200120002d00003a0000200141016a200041016a2d00003a0000200141026a200041026a2d00003a0000"
|
||||
"200141036a200041036a2d00003a0000200141046a200041046a2d00003a0000200141056a200041056a2d00003a00"
|
||||
"00200141066a200041066a2d00003a0000200141076a200041076a2d00003a0000200041086a2100200141086a2201"
|
||||
"2004470d000b0b2004412720026b220d417c71220e6a21010240200220066a22004103712208450440200120044d0d"
|
||||
"0120002102034020042002280200360200200241046a2102200441046a22042001490d000b0c010b41002106200741"
|
||||
"0036020c2007410c6a2008722102410420086b22054101710440200220002d00003a0000410121060b200541027104"
|
||||
"40200220066a200020066a2f01003b01000b200020086b210520084103742109200728020c210a2001200441046a4b"
|
||||
"0440410020096b4118712106034020042202200a200976200541046a2205280200220a20067472360200200241046a"
|
||||
"2104200241086a2001490d000b0b41002106200741003a0008200741003a0006027f20084101460440410021022007"
|
||||
"41086a0c010b200541056a2d00002007200541046a2d000022023a0008410874210b4102210c200741066a0b210820"
|
||||
"042000410171047f2008200541046a200c6a2d00003a000020072d0006411074210620072d00080520020b41ff0171"
|
||||
"2006200b7272410020096b41187174200a200976723602000b2000200e6a210202402001200d410371220420016a22"
|
||||
"054f0d002004220004400340200120022d00003a0000200241016a2102200141016a2101200041016b22000d000b0b"
|
||||
"200441016b4107490d000340200120022d00003a0000200141016a200241016a2d00003a0000200141026a20024102"
|
||||
"6a2d00003a0000200141036a200241036a2d00003a0000200141046a200241046a2d00003a0000200141056a200241"
|
||||
"056a2d00003a0000200141066a200241066a2d00003a0000200141076a200241076a2d00003a0000200241086a2102"
|
||||
"200141086a22012005470d000b0b0b200341e0006a24000f0b000b000b1900200241314f0440000b20002002360204"
|
||||
"200020013602000b0d00200020014114100c4100470bca0902037f017e230041d0016b22002400200041f8006a2201"
|
||||
"100d02400240024041db84c000411d41014108200141141000220141004c047e427f05200041086a200041f8006a20"
|
||||
"011007200028020c41134b0d01427c0b10011a0c010b20002000280208220128001036004f20002001290009370348"
|
||||
"20012d0000210220002001290001370011200020023a0010200020002903483700192000200028004f360020418080"
|
||||
"c000410e200041106a22014114410110021a200041cf86aee903360034200042958ec5b8a3edfe87897f37002c2000"
|
||||
"42aea5e8a9e8eafce7917f3700240240024002402001200041246a1008450440200041f8006a41021006417f210120"
|
||||
"002802782202417f460440419584c0004120200030007c10011a0c060b20020d01418e80c000411320002903800122"
|
||||
"0310011a2000200337033841a180c000410b200041386a4108410110021a200342c0843d520d02200041f8006a4103"
|
||||
"100620002802782202417f46044041a483c0004120200030007c10011a0c060b200020002903880137035020002000"
|
||||
"2903900137035820002000280298013602602000200029029c01370264200020002902a40137026c200020002802ac"
|
||||
"01360274200020002903800122033703482000200028027c3602442000200236024020024101470d0341ac80c00041"
|
||||
"13200041c8006a22014108410110021a41bf80c000411e2001100a41dd80c000410b200041d0006a4114410110021a"
|
||||
"41e880c000410d200041e4006a4114410110021a2000420037037802402001410841f580c0004108200041f8006a22"
|
||||
"024108410010032201410846044041fd80c000412420024108410110021a41fd80c00041242002100a0c010b41a181"
|
||||
"c000412d2001ac10011a0b2000200337037841d681c000410b200041f8006a22014108410110021a2001100d024041"
|
||||
"e082c000411c410441092001410c1000220141004c047e427f052000200041f8006a200110072000280204410b4b0d"
|
||||
"01427c0b10011a0c050b2000280200220129000021032000200128000822013602b801200020033703b00141e181c0"
|
||||
"00410d200041b0016a2202410c410110021a200041fffffff77e3600800120004290ce86a2aa8c1e37007820022000"
|
||||
"41f8006a410c100c45044041ee81c0004110200342388620034280fe0383422886842003428080fc07834218862003"
|
||||
"42808080f80f834208868484200342088842808080f80f832003421888428080fc07838420034228884280fe038320"
|
||||
"03423888848484220310011a41fe81c0004110200141187841ff81fc0771200141ff81fc0771410878722202ac1001"
|
||||
"1a200042003703c0014100210120022003200041c0016a22024108410010041a200020002903c0013703c801418e82"
|
||||
"c0004116200041c8016a100a41a482c000411720024108410110021a0c060b41bb82c000412541014100410010021a"
|
||||
"0c040b41b584c000412641014100410010021a0c030b418e80c0004113427f10011a2000420037033841a180c00041"
|
||||
"0b200041386a4108410110021a41ed83c000412841014100410010021a0c020b41c483c00041294101410041001002"
|
||||
"1a0c010b41ac80c000411341ce81c0004108410110021a41d681c000410b41ce81c0004108410110021a41fc82c000"
|
||||
"412841014100410010021a0b417f21010b200041d0016a240020010b0d00200020012002410810051a0bf50b02037f"
|
||||
"017e23004190026b22002400200041e0016a2201100d0240024041004110200141011000220241004c044041fc89c0"
|
||||
"00411b427f10011a0c010b200041386a200041e0016a22012002100741f884c000410c20002802382d00002202ad10"
|
||||
"011a200020023a00e001418485c000410a20014101410110021a0240200241ff014604402001100d024041bc89c000"
|
||||
"411c41014101200141021000220141004c047e427f05200041306a200041e0016a20011007200028023441024f0d01"
|
||||
"427c0b10011a0c030b418e85c000410d20002802302f00002201ad10011a200020013b0142419b85c000410b200041"
|
||||
"c2006a4102410110021a200141ffff03460d01419789c000412541014100410010021a0c020b41d889c00041244101"
|
||||
"4100410010021a0c010b200041e0016a2201100d024041024102200141041000220141004c0440427f21030c010b20"
|
||||
"0041286a200041e0016a20011007200028022c41034d0440427c21030c010b20002000280228280000220236024441"
|
||||
"a685c000410b200041c4006a4104410110021a417f210102400240024002402002417f460440200041e0016a220210"
|
||||
"0d024041ba88c000411c41034103200241081000220241004c047e427f05200041206a200041e0016a200210072000"
|
||||
"28022441074b0d01427c0b10011a0c080b41b185c000410d2000280220290000220310011a2000200337034841be85"
|
||||
"c000410b200041c8006a4108410110021a427f21032000290348427f520d01200041e0016a2201100d024041044104"
|
||||
"200141101000220241004a0440200041186a200120021007427c2103200028021c410f4b0d010b41f887c000411d20"
|
||||
"0310011a0c070b200028021822012900002103200020012900083703582000200337035041c985c000410c200041d0"
|
||||
"006a22014110410110021a200141d585c0004110100c0d02200041e0016a2201100d024041b587c000411d41054111"
|
||||
"200141141000220141004c047e427f05200041106a200041e0016a20011007200028021441134b0d01427c0b10011a"
|
||||
"0c070b2000200028021022012800103600cf01200020012900093703c80120012d0000210220002001290001370065"
|
||||
"200020023a0064200020002903c80137006d200020002800cf0136007441e585c000410c200041e4006a2201411441"
|
||||
"0110021a2000410036008701200042003703800120004200370378200041013a008b0102402001200041f8006a1008"
|
||||
"450440200041e0016a2201100d41064115200141181000220141004c044041ff0121010c070b200041086a200041e0"
|
||||
"016a20011007200028020c220141134d044041fc0121010c070b200141174b0d01000b418f87c00041264101410041"
|
||||
"0010021a0c070b2000200028020822012900103700cf01200020012900093703c80120012d00002102200020012900"
|
||||
"0137009101200020023a009001200020002903c80137009901200020002900cf013700a00141f185c000410c200041"
|
||||
"90016a22014118410110021a200042003700b701200042003703b001200042003703a801200041013a00bf01200120"
|
||||
"0041a8016a4118100c0d03200041e0016a2201100d024041af86c000411d41074105200141201000220141004c047e"
|
||||
"427f052000200041e0016a200110072000280204411f4b0d01427c0b10011a0c070b200028020022012d0000210220"
|
||||
"0020012900183700d801200020012900113700d101200020012900093700c901200020012900013700c10120002002"
|
||||
"3a00c00141fd85c000410c200041c0016a22014120410110021a200042efb4a8a69492a496253700f80120004292be"
|
||||
"cded89ebffcf103700f001200042daa2c7aababaf2cf483700e801200042d9abe996fcbcdd8c703700e00120012000"
|
||||
"41e0016a4120100c450440410021010c080b418986c000412641014100410010021a0c060b41d688c0004125410141"
|
||||
"00410010021a0c060b419588c000412541014100410010021a0c040b41d287c000412641014100410010021a0c030b"
|
||||
"41cc86c000412641014100410010021a0c020b41f286c000411d2001adc210011a0c010b41fb88c000411c20031001"
|
||||
"1a0b417f21010b20004190026a240020010b4301037f02402002450d00034020002d0000220420012d000022054604"
|
||||
"40200041016a2100200141016a2101200241016b22020d010c020b0b200420056b21030b20030bea0201037f024020"
|
||||
"002000410020006b41037122016a22024f0d0020010440200121030340200041003a0000200041016a210020034101"
|
||||
"6b22030d000b0b200141016b4107490d000340200041003a0000200041076a41003a0000200041066a41003a000020"
|
||||
"0041056a41003a0000200041046a41003a0000200041036a41003a0000200041026a41003a0000200041016a41003a"
|
||||
"0000200041086a22002002470d000b0b2002413020016b2201417c716a220020024b04400340200241003602002002"
|
||||
"41046a22022000490d000b0b024020002001410371220120006a22034f0d002001220204400340200041003a000020"
|
||||
"0041016a2100200241016b22020d000b0b200141016b4107490d000340200041003a0000200041076a41003a000020"
|
||||
"0041066a41003a0000200041056a41003a0000200041046a41003a0000200041036a41003a0000200041026a41003a"
|
||||
"0000200041016a41003a0000200041086a22002003470d000b0b0b0b9b0a0200418080c0000bd5054143434f554e54"
|
||||
"2056616c75653a414d4f554e542056616c75652028585250293a414d4f554e54204865783a414d4f554e542056616c"
|
||||
"75652028494f55293a414d4f554e542056616c75652028494f5529202d204f726967696e616c3a494f552049737375"
|
||||
"65723a494f552043757272656e63793ad4838d7ea4c68000414d4f554e542056616c75652028494f5529202d204166"
|
||||
"74657220616464696e6720313a4572726f7220616464696e6720464c4f41545f4f4e4520746f20494f5520616d6f75"
|
||||
"6e742c20726573756c743a0000000000000000494f5520416d6f756e743a4e554d4245522056616c75653a4e554d42"
|
||||
"4552204d616e74697373613a4e554d424552204578706f6e656e743a4e554d424552206173204f7061717565466c6f"
|
||||
"61743a4e554d424552204f7061717565466c6f6174204865783a4e554d42455220506172616d65746572204572726f"
|
||||
"723a20496e76616c69642056616c75654e554d42455220506172616d65746572204572726f7220436f64653a414d4f"
|
||||
"554e542e494f5520506172616d65746572204572726f723a20496e76616c69642054797065414d4f554e5420494f55"
|
||||
"20506172616d65746572204572726f7220436f64653a414d4f554e542e58525020506172616d65746572204572726f"
|
||||
"723a20496e76616c69642056616c7565414d4f554e542e58525020506172616d65746572204572726f723a20496e76"
|
||||
"616c69642054797065414d4f554e542058525020506172616d65746572204572726f7220436f64653a4143434f554e"
|
||||
"5420506172616d65746572204572726f723a20496e76616c69642056616c75654143434f554e5420506172616d6574"
|
||||
"6572204572726f7220436f64653a55494e54382056616c75653a55494e5438204865783a55494e5431362056616c75"
|
||||
"653a55494e543136204865783a55494e543332204865783a55494e5436342056616c75653a55494e54363420486578"
|
||||
"3a55494e54313238204865783a0041e485c0000bb3040155494e54313630204865783a55494e54313932204865783a"
|
||||
"55494e54323536204865783a55494e5432353620506172616d65746572204572726f723a20496e76616c6964205661"
|
||||
"6c756555494e5432353620506172616d65746572204572726f7220436f64653a55494e5431393220506172616d6574"
|
||||
"6572204572726f723a20496e76616c69642056616c756555494e5431393220506172616d65746572204572726f7220"
|
||||
"436f64653a55494e5431363020506172616d65746572204572726f723a20496e76616c69642056616c756555494e54"
|
||||
"31363020506172616d65746572204572726f7220436f64653a55494e5431323820506172616d65746572204572726f"
|
||||
"723a20496e76616c69642056616c756555494e5431323820506172616d65746572204572726f7220436f64653a5549"
|
||||
"4e54363420506172616d65746572204572726f723a20496e76616c69642056616c756555494e54363420506172616d"
|
||||
"65746572204572726f7220436f64653a55494e54333220506172616d65746572204572726f723a20496e76616c6964"
|
||||
"2056616c756555494e54333220506172616d65746572204572726f7220436f64653a55494e54313620506172616d65"
|
||||
"746572204572726f723a20496e76616c69642056616c756555494e54313620506172616d65746572204572726f7220"
|
||||
"436f64653a55494e543820506172616d65746572204572726f723a20496e76616c69642056616c756555494e543820"
|
||||
"506172616d65746572204572726f7220436f64653a";
|
||||
|
||||
extern std::string const kInstanceParamsOtherWasmHex =
|
||||
"0061736d0100000001470a60047f7f7f7f017f60037f7f7f0060037f7f7e017f60057f7f7f7f7f017f60077f7f7f7f"
|
||||
"7f7f7f017f60057f7e7f7f7f017f60027f7f006000017f60037f7f7f017f60017f000289010608686f73745f6c6962"
|
||||
"0e696e7374616e63655f706172616d000008686f73745f6c69620974726163655f6e756d000208686f73745f6c6962"
|
||||
"057472616365000308686f73745f6c696209666c6f61745f616464000408686f73745f6c696209666c6f61745f7365"
|
||||
"74000508686f73745f6c69621274726163655f6f70617175655f666c6f617400000307060601070108090503010011"
|
||||
"0609017f01418080c0000b072202066d656d6f7279020015696e7374616e63655f706172616d735f6f746865720008"
|
||||
"0aa31806fa0a020d7f017e230041e0006b22032400200341086a2202100b0240024002402001410620024130100022"
|
||||
"0141004c04402000417f360200200041ff013a00040c010b2003200341086a2001100720032802002101027f024002"
|
||||
"4020032802042202410846200241304672452002412147710d0020012d00002205c02204410048044020024130470d"
|
||||
"012003200129001d370338200320012900253703402003200128002c3600472003200129000837004b200320012900"
|
||||
"103700532003200128001836005b20012d001c21022001290000210f41010c030b2004412071450d01200241084d0d"
|
||||
"04200241204d0d052003200129000937033820032001290011370340200320012900193703482001290001220f4238"
|
||||
"86200f4280fe038342288684200f428080fc0783421886200f42808080f80f834208868484200f42088842808080f8"
|
||||
"0f83200f421888428080fc078384200f4228884280fe0383200f423888848484210f200441c0017141067621024102"
|
||||
"0c020b2000417f360200200041fc013a00040c020b2001290000220f420183423886200f4280fe038342288684200f"
|
||||
"428080fc0783421886200f42808080f80f834208868484200f42088842808080f80f83200f421888428080fc078384"
|
||||
"200f4228884280fe0383200f423888848484220f4200200f7d200541c000711b210f41000b2101200020023a001020"
|
||||
"00200f37030820002001360200200341386a2106230041106b210702404100200041116a22016b410371220220016a"
|
||||
"220420014d0d002006210020020440200221050340200120002d00003a0000200041016a2100200141016a21012005"
|
||||
"41016b22050d000b0b200241016b4107490d000340200120002d00003a0000200141016a200041016a2d00003a0000"
|
||||
"200141026a200041026a2d00003a0000200141036a200041036a2d00003a0000200141046a200041046a2d00003a00"
|
||||
"00200141056a200041056a2d00003a0000200141066a200041066a2d00003a0000200141076a200041076a2d00003a"
|
||||
"0000200041086a2100200141086a22012004470d000b0b2004412720026b220d417c71220e6a21010240200220066a"
|
||||
"22004103712208450440200120044d0d0120002102034020042002280200360200200241046a2102200441046a2204"
|
||||
"2001490d000b0c010b410021062007410036020c2007410c6a2008722102410420086b22054101710440200220002d"
|
||||
"00003a0000410121060b20054102710440200220066a200020066a2f01003b01000b200020086b2105200841037421"
|
||||
"09200728020c210a2001200441046a4b0440410020096b4118712106034020042202200a200976200541046a220528"
|
||||
"0200220a20067472360200200241046a2104200241086a2001490d000b0b41002106200741003a0008200741003a00"
|
||||
"06027f2008410146044041002102200741086a0c010b200541056a2d00002007200541046a2d000022023a00084108"
|
||||
"74210b4102210c200741066a0b210820042000410171047f2008200541046a200c6a2d00003a000020072d00064110"
|
||||
"74210620072d00080520020b41ff01712006200b7272410020096b41187174200a200976723602000b2000200e6a21"
|
||||
"0202402001200d410371220420016a22054f0d002004220004400340200120022d00003a0000200241016a21022001"
|
||||
"41016a2101200041016b22000d000b0b200441016b4107490d000340200120022d00003a0000200141016a20024101"
|
||||
"6a2d00003a0000200141026a200241026a2d00003a0000200141036a200241036a2d00003a0000200141046a200241"
|
||||
"046a2d00003a0000200141056a200241056a2d00003a0000200141066a200241066a2d00003a0000200141076a2002"
|
||||
"41076a2d00003a0000200241086a2102200141086a22012005470d000b0b0b200341e0006a24000f0b000b000b1900"
|
||||
"200241314f0440000b20002002360204200020013602000bcc0902037f017e230041d0016b22002400200041f8006a"
|
||||
"2201100b02400240024041db84c000411d41014108200141141000220141004c047e427f05200041086a200041f800"
|
||||
"6a20011007200028020c41134b0d01427c0b10011a0c010b20002000280208220128001036004f2000200129000937"
|
||||
"034820012d0000210220002001290001370011200020023a0010200020002903483700192000200028004f36002041"
|
||||
"8080c000410e200041106a22014114410110021a200041cf86aee903360034200042958ec5b8a3edfe87897f37002c"
|
||||
"200042aea5e8a9e8eafce7917f3700240240024002402001200041246a4114100a450440200041f8006a4102100641"
|
||||
"7f210120002802782202417f460440419584c0004120200030007c10011a0c060b20020d01418e80c0004113200029"
|
||||
"038001220310011a2000200337033841a180c000410b200041386a4108410110021a200342c0843d520d02200041f8"
|
||||
"006a4103100620002802782202417f46044041a483c0004120200030007c10011a0c060b2000200029038801370350"
|
||||
"200020002903900137035820002000280298013602602000200029029c01370264200020002902a40137026c200020"
|
||||
"002802ac01360274200020002903800122033703482000200028027c3602442000200236024020024101470d0341ac"
|
||||
"80c0004113200041c8006a22014108410110021a41bf80c000411e2001100941dd80c000410b200041d0006a411441"
|
||||
"0110021a41e880c000410d200041e4006a4114410110021a2000420037037802402001410841f580c0004108200041"
|
||||
"f8006a22024108410010032201410846044041fd80c000412420024108410110021a41fd80c0004124200210090c01"
|
||||
"0b41a181c000412d2001ac10011a0b2000200337037841d681c000410b200041f8006a22014108410110021a200110"
|
||||
"0b024041e082c000411c410441092001410c1000220141004c047e427f052000200041f8006a200110072000280204"
|
||||
"410b4b0d01427c0b10011a0c050b2000280200220129000021032000200128000822013602b801200020033703b001"
|
||||
"41e181c000410d200041b0016a2202410c410110021a200041fffffff77e3600800120004290ce86a2aa8c1e370078"
|
||||
"2002200041f8006a410c100a45044041ee81c0004110200342388620034280fe0383422886842003428080fc078342"
|
||||
"1886200342808080f80f834208868484200342088842808080f80f832003421888428080fc07838420034228884280"
|
||||
"fe03832003423888848484220310011a41fe81c0004110200141187841ff81fc0771200141ff81fc07714108787222"
|
||||
"02ac10011a200042003703c0014100210120022003200041c0016a22024108410010041a200020002903c0013703c8"
|
||||
"01418e82c0004116200041c8016a100941a482c000411720024108410110021a0c060b41bb82c00041254101410041"
|
||||
"0010021a0c040b41b584c000412641014100410010021a0c030b418e80c0004113427f10011a2000420037033841a1"
|
||||
"80c000410b200041386a4108410110021a41ed83c000412841014100410010021a0c020b41c483c000412941014100"
|
||||
"410010021a0c010b41ac80c000411341ce81c0004108410110021a41d681c000410b41ce81c0004108410110021a41"
|
||||
"fc82c000412841014100410010021a0b417f21010b200041d0016a240020010b0d00200020012002410810051a0b43"
|
||||
"01037f02402002450d00034020002d0000220420012d00002205460440200041016a2100200141016a210120024101"
|
||||
"6b22020d010c020b0b200420056b21030b20030bea0201037f024020002000410020006b41037122016a22024f0d00"
|
||||
"20010440200121030340200041003a0000200041016a2100200341016b22030d000b0b200141016b4107490d000340"
|
||||
"200041003a0000200041076a41003a0000200041066a41003a0000200041056a41003a0000200041046a41003a0000"
|
||||
"200041036a41003a0000200041026a41003a0000200041016a41003a0000200041086a22002002470d000b0b200241"
|
||||
"3020016b2201417c716a220020024b0440034020024100360200200241046a22022000490d000b0b02402000200141"
|
||||
"0371220120006a22034f0d002001220204400340200041003a0000200041016a2100200241016b22020d000b0b2001"
|
||||
"41016b4107490d000340200041003a0000200041076a41003a0000200041066a41003a0000200041056a41003a0000"
|
||||
"200041046a41003a0000200041036a41003a0000200041026a41003a0000200041016a41003a0000200041086a2200"
|
||||
"2003470d000b0b0b0b82050100418080c0000bf8044143434f554e542056616c75653a414d4f554e542056616c7565"
|
||||
"2028585250293a414d4f554e54204865783a414d4f554e542056616c75652028494f55293a414d4f554e542056616c"
|
||||
"75652028494f5529202d204f726967696e616c3a494f55204973737565723a494f552043757272656e63793ad4838d"
|
||||
"7ea4c68000414d4f554e542056616c75652028494f5529202d20416674657220616464696e6720313a4572726f7220"
|
||||
"616464696e6720464c4f41545f4f4e4520746f20494f5520616d6f756e742c20726573756c743a0000000000000000"
|
||||
"494f5520416d6f756e743a4e554d4245522056616c75653a4e554d424552204d616e74697373613a4e554d42455220"
|
||||
"4578706f6e656e743a4e554d424552206173204f7061717565466c6f61743a4e554d424552204f7061717565466c6f"
|
||||
"6174204865783a4e554d42455220506172616d65746572204572726f723a20496e76616c69642056616c75654e554d"
|
||||
"42455220506172616d65746572204572726f7220436f64653a414d4f554e542e494f5520506172616d657465722045"
|
||||
"72726f723a20496e76616c69642054797065414d4f554e5420494f5520506172616d65746572204572726f7220436f"
|
||||
"64653a414d4f554e542e58525020506172616d65746572204572726f723a20496e76616c69642056616c7565414d4f"
|
||||
"554e542e58525020506172616d65746572204572726f723a20496e76616c69642054797065414d4f554e5420585250"
|
||||
"20506172616d65746572204572726f7220436f64653a4143434f554e5420506172616d65746572204572726f723a20"
|
||||
"496e76616c69642056616c75654143434f554e5420506172616d65746572204572726f7220436f64653a";
|
||||
|
||||
extern std::string const kInstanceParamsUintWasmHex =
|
||||
"0061736d01000000012e0760047f7f7f7f017f60037f7f7e017f60057f7f7f7f7f017f60037f7f7f006000017f6003"
|
||||
"7f7f7f017f60017f0002410308686f73745f6c69620e696e7374616e63655f706172616d000008686f73745f6c6962"
|
||||
"0974726163655f6e756d000108686f73745f6c696205747261636500020305040304050605030100110609017f0141"
|
||||
"8080c0000b072102066d656d6f7279020014696e7374616e63655f706172616d735f75696e7400040ac40f04190020"
|
||||
"0241314f0440000b20002002360204200020013602000bf70b02037f017e23004190026b22002400200041e0016a22"
|
||||
"0110060240024041004110200141011000220241004c0440418485c000411b427f10011a0c010b200041386a200041"
|
||||
"e0016a220120021003418080c000410c20002802382d00002202ad10011a200020023a00e001418c80c000410a2001"
|
||||
"4101410110021a0240200241ff0146044020011006024041c484c000411c41014101200141021000220141004c047e"
|
||||
"427f05200041306a200041e0016a20011003200028023441024f0d01427c0b10011a0c030b419680c000410d200028"
|
||||
"02302f00002201ad10011a200020013b014241a380c000410b200041c2006a4102410110021a200141ffff03460d01"
|
||||
"419f84c000412541014100410010021a0c020b41e084c000412441014100410010021a0c010b200041e0016a220110"
|
||||
"06024041024102200141041000220141004c0440427f21030c010b200041286a200041e0016a20011003200028022c"
|
||||
"41034d0440427c21030c010b20002000280228280000220236024441ae80c000410b200041c4006a4104410110021a"
|
||||
"417f210102400240024002402002417f460440200041e0016a22021006024041c283c000411c410341032002410810"
|
||||
"00220241004c047e427f05200041206a200041e0016a20021003200028022441074b0d01427c0b10011a0c080b41b9"
|
||||
"80c000410d2000280220290000220310011a2000200337034841c680c000410b200041c8006a4108410110021a427f"
|
||||
"21032000290348427f520d01200041e0016a22011006024041044104200141101000220241004a0440200041186a20"
|
||||
"0120021003427c2103200028021c410f4b0d010b418083c000411d200310011a0c070b200028021822012900002103"
|
||||
"200020012900083703582000200337035041d180c000410c200041d0006a22014110410110021a200141dd80c00041"
|
||||
"1010050d02200041e0016a22011006024041bd82c000411d41054111200141141000220141004c047e427f05200041"
|
||||
"106a200041e0016a20011003200028021441134b0d01427c0b10011a0c070b2000200028021022012800103600cf01"
|
||||
"200020012900093703c80120012d0000210220002001290001370065200020023a0064200020002903c80137006d20"
|
||||
"0020002800cf0136007441ed80c000410c200041e4006a22014114410110021a200041003600870120004200370380"
|
||||
"0120004200370378200041013a008b0102402001200041f8006a41141005450440200041e0016a2201100641064115"
|
||||
"200141181000220141004c044041ff0121010c070b200041086a200041e0016a20011003200028020c220141134d04"
|
||||
"4041fc0121010c070b200141174b0d01000b419782c000412641014100410010021a0c070b20002000280208220129"
|
||||
"00103700cf01200020012900093703c80120012d000021022000200129000137009101200020023a00900120002000"
|
||||
"2903c80137009901200020002900cf013700a00141f980c000410c20004190016a22014118410110021a2000420037"
|
||||
"00b701200042003703b001200042003703a801200041013a00bf012001200041a8016a411810050d03200041e0016a"
|
||||
"22011006024041b781c000411d41074105200141201000220141004c047e427f052000200041e0016a200110032000"
|
||||
"280204411f4b0d01427c0b10011a0c070b200028020022012d00002102200020012900183700d80120002001290011"
|
||||
"3700d101200020012900093700c901200020012900013700c101200020023a00c001418581c000410c200041c0016a"
|
||||
"22014120410110021a200042efb4a8a69492a496253700f80120004292becded89ebffcf103700f001200042daa2c7"
|
||||
"aababaf2cf483700e801200042d9abe996fcbcdd8c703700e0012001200041e0016a41201005450440410021010c08"
|
||||
"0b419181c000412641014100410010021a0c060b41de83c000412541014100410010021a0c060b419d83c000412541"
|
||||
"014100410010021a0c040b41da82c000412641014100410010021a0c030b41d481c000412641014100410010021a0c"
|
||||
"020b41fa81c000411d2001adc210011a0c010b418384c000411c200310011a0b417f21010b20004190026a24002001"
|
||||
"0b4301037f02402002450d00034020002d0000220420012d00002205460440200041016a2100200141016a21012002"
|
||||
"41016b22020d010c020b0b200420056b21030b20030bea0201037f024020002000410020006b41037122016a22024f"
|
||||
"0d0020010440200121030340200041003a0000200041016a2100200341016b22030d000b0b200141016b4107490d00"
|
||||
"0340200041003a0000200041076a41003a0000200041066a41003a0000200041056a41003a0000200041046a41003a"
|
||||
"0000200041036a41003a0000200041026a41003a0000200041016a41003a0000200041086a22002002470d000b0b20"
|
||||
"02413020016b2201417c716a220020024b0440034020024100360200200241046a22022000490d000b0b0240200020"
|
||||
"01410371220120006a22034f0d002001220204400340200041003a0000200041016a2100200241016b22020d000b0b"
|
||||
"200141016b4107490d000340200041003a0000200041076a41003a0000200041066a41003a0000200041056a41003a"
|
||||
"0000200041046a41003a0000200041036a41003a0000200041026a41003a0000200041016a41003a0000200041086a"
|
||||
"22002003470d000b0b0b0ba2050200418080c0000b5d55494e54382056616c75653a55494e5438204865783a55494e"
|
||||
"5431362056616c75653a55494e543136204865783a55494e543332204865783a55494e5436342056616c75653a5549"
|
||||
"4e543634204865783a55494e54313238204865783a0041ec80c0000bb3040155494e54313630204865783a55494e54"
|
||||
"313932204865783a55494e54323536204865783a55494e5432353620506172616d65746572204572726f723a20496e"
|
||||
"76616c69642056616c756555494e5432353620506172616d65746572204572726f7220436f64653a55494e54313932"
|
||||
"20506172616d65746572204572726f723a20496e76616c69642056616c756555494e5431393220506172616d657465"
|
||||
"72204572726f7220436f64653a55494e5431363020506172616d65746572204572726f723a20496e76616c69642056"
|
||||
"616c756555494e5431363020506172616d65746572204572726f7220436f64653a55494e5431323820506172616d65"
|
||||
"746572204572726f723a20496e76616c69642056616c756555494e5431323820506172616d65746572204572726f72"
|
||||
"20436f64653a55494e54363420506172616d65746572204572726f723a20496e76616c69642056616c756555494e54"
|
||||
"363420506172616d65746572204572726f7220436f64653a55494e54333220506172616d65746572204572726f723a"
|
||||
"20496e76616c69642056616c756555494e54333220506172616d65746572204572726f7220436f64653a55494e5431"
|
||||
"3620506172616d65746572204572726f723a20496e76616c69642056616c756555494e54313620506172616d657465"
|
||||
"72204572726f7220436f64653a55494e543820506172616d65746572204572726f723a20496e76616c69642056616c"
|
||||
"756555494e543820506172616d65746572204572726f7220436f64653a";
|
||||
|
||||
@@ -155,3 +155,15 @@ extern std::string const kOpcReservedHex;
|
||||
|
||||
extern std::string const kImpExpHex;
|
||||
extern std::string const kUpdateDataWasmHex;
|
||||
|
||||
extern std::string const kEventsWasmHex;
|
||||
|
||||
extern std::string const kContractDataWasmHex;
|
||||
|
||||
extern std::string const kEmitTxnWasmHex;
|
||||
|
||||
extern std::string const kFunctionParamsWasmHex;
|
||||
|
||||
extern std::string const kInstanceParamsOtherWasmHex;
|
||||
|
||||
extern std::string const kInstanceParamsUintWasmHex;
|
||||
|
||||
29
src/test/app/wasm_fixtures/function_params/Cargo.toml
Normal file
29
src/test/app/wasm_fixtures/function_params/Cargo.toml
Normal file
@@ -0,0 +1,29 @@
|
||||
[package]
|
||||
name = "function_params"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
description = ""
|
||||
license = "MIT"
|
||||
|
||||
[workspace]
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[target.wasm32-unknown-unknown]
|
||||
rustflags = ["-C", "target-feature=-bulk-memory"]
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z" # Most aggressive size optimization
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
strip = true # Remove debug symbols
|
||||
debug = false # Disable debug info generation
|
||||
overflow-checks = false # Disable overflow checks (use cautiously)
|
||||
|
||||
[profile.dev]
|
||||
panic = "unwind"
|
||||
|
||||
[dependencies]
|
||||
xrpl-wasm-stdlib = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", rev = "bd44875189fff1ae1c4ae740331d2366cb014cc0", package = "xrpl-wasm-stdlib" }
|
||||
375
src/test/app/wasm_fixtures/function_params/src/lib.rs
Normal file
375
src/test/app/wasm_fixtures/function_params/src/lib.rs
Normal file
@@ -0,0 +1,375 @@
|
||||
#![allow(unused_imports)]
|
||||
#![cfg_attr(target_arch = "wasm32", no_std)]
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
extern crate std;
|
||||
|
||||
use xrpl_wasm_stdlib::host::trace::{DataRepr, trace, trace_data, trace_num, trace_float};
|
||||
use xrpl_wasm_stdlib::host::{function_param};
|
||||
use xrpl_wasm_stdlib::core::params::function::{get_function_param};
|
||||
use xrpl_wasm_stdlib::core::type_codes::{
|
||||
STI_UINT8, STI_UINT16, STI_UINT32, STI_UINT64, STI_UINT128,
|
||||
STI_UINT160, STI_UINT192, STI_UINT256, STI_AMOUNT, STI_VL, STI_ACCOUNT,
|
||||
STI_OBJECT, STI_ARRAY, STI_CURRENCY, STI_NUMBER
|
||||
};
|
||||
use xrpl_wasm_stdlib::core::types::opaque_float::OpaqueFloat;
|
||||
use xrpl_wasm_stdlib::core::types::number::Number;
|
||||
use xrpl_wasm_stdlib::core::types::account_id::AccountID;
|
||||
use xrpl_wasm_stdlib::core::types::amount::Amount;
|
||||
use xrpl_wasm_stdlib::host::{FLOAT_ROUNDING_MODES_TO_NEAREST, float_add, float_set};
|
||||
use xrpl_wasm_stdlib::core::types::opaque_float::{FLOAT_NEGATIVE_ONE, FLOAT_ONE};
|
||||
use xrpl_wasm_stdlib::core::types::uint::Hash160;
|
||||
use xrpl_wasm_stdlib::core::types::uint::Hash192;
|
||||
use xrpl_wasm_stdlib::core::types::uint::Hash256;
|
||||
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn function_params_uint() -> i32 {
|
||||
// UINT8
|
||||
let value = match get_function_param::<u8>(0) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT8 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let _ = trace_num("UINT8 Value:", value as i64);
|
||||
// as hex
|
||||
let _ = trace_data("UINT8 Hex:", &[value], DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if value != 255 {
|
||||
let _ = trace("UINT8 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT16
|
||||
let value = match get_function_param::<u16>(1) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT16 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let _ = trace_num("UINT16 Value:", value as i64);
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT16 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if value != 65535 {
|
||||
let _ = trace("UINT16 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT32
|
||||
let value = match get_function_param::<u32>(2) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT32 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT32 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if value != 4294967295 {
|
||||
let _ = trace("UINT32 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT64
|
||||
let value = match get_function_param::<u64>(3) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT64 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let _ = trace_num("UINT64 Value:", value as i64);
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT64 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if buf != [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] {
|
||||
let _ = trace("UINT64 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT128
|
||||
let value = match get_function_param::<u128>(4) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT128 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT128 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if buf != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01] {
|
||||
let _ = trace("UINT128 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT160
|
||||
let value = match get_function_param::<Hash160>(5) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT160 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.as_bytes();
|
||||
let _ = trace_data("UINT160 Hex:", buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expected190: [u8; 20] = [
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||
];
|
||||
if *buf != expected190 {
|
||||
let _ = trace("UINT160 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT192
|
||||
let value = match get_function_param::<Hash192>(6) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT192 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.as_bytes();
|
||||
let _ = trace_data("UINT192 Hex:", buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expected192: [u8; 24] = [
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||
];
|
||||
if *buf != expected192 {
|
||||
let _ = trace("UINT192 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT256
|
||||
let value = match get_function_param::<Hash256>(7) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT256 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.as_bytes();
|
||||
let _ = trace_data("UINT256 Hex:", buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expected256: [u8; 32] = [
|
||||
0xD9, 0x55, 0xDA, 0xC2, 0xE7, 0x75, 0x19, 0xF0,
|
||||
0x5A, 0xD1, 0x51, 0xA5, 0xD3, 0xC9, 0x9F, 0xC8,
|
||||
0x12, 0x5F, 0xB3, 0x9D, 0x58, 0xFF, 0x9F, 0x10,
|
||||
0x6F, 0x1A, 0xCA, 0x44, 0x91, 0x90, 0x2C, 0x25
|
||||
];
|
||||
if *buf != expected256 {
|
||||
let _ = trace("UINT256 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // Return success code
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn function_params_other() -> i32 {
|
||||
// // VL
|
||||
// let mut buf = [0x00; 4];
|
||||
// let output_len = unsafe { function_param(0, STI_VL.into(), buf.as_mut_ptr(), buf.len()) };
|
||||
// let _ = trace_num("VL Value Len:", output_len as i64);
|
||||
// // as hex
|
||||
// let _ = trace_data("VL Hex:", &buf[0..4], DataRepr::AsHex);
|
||||
|
||||
// ACCOUNT
|
||||
let account_id = match get_function_param::<AccountID>(1) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("ACCOUNT Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// trace the value
|
||||
let _ = trace_data("ACCOUNT Value:", &account_id.0, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expectedAccount: [u8; 20] = [
|
||||
0xAE, 0x12, 0x3A, 0x85, 0x56, 0xF3, 0xCF, 0x91,
|
||||
0x15, 0x47, 0x11, 0x37, 0x6A, 0xFB, 0x0F, 0x89,
|
||||
0x4F, 0x83, 0x2B, 0x3D
|
||||
];
|
||||
if account_id.0 != expectedAccount {
|
||||
let _ = trace("ACCOUNT Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// AMOUNT XRP
|
||||
let xrp_token = match get_function_param::<Amount>(2) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("AMOUNT XRP Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
match xrp_token {
|
||||
Amount::XRP { num_drops } => {
|
||||
let _ = trace_num("AMOUNT Value (XRP):", num_drops);
|
||||
}
|
||||
_ => {
|
||||
let _ = trace_num("AMOUNT Value (XRP):", -1);
|
||||
}
|
||||
}
|
||||
let buf = match xrp_token {
|
||||
Amount::XRP { num_drops } => num_drops.to_le_bytes(),
|
||||
_ => [0u8; 8],
|
||||
};
|
||||
let _ = trace_data("AMOUNT Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if let Amount::XRP { num_drops } = xrp_token {
|
||||
if num_drops != 1000000 {
|
||||
let _ = trace("AMOUNT.XRP Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
let _ = trace("AMOUNT.XRP Parameter Error: Invalid Type");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// AMOUNT IOU
|
||||
let iou_token = match get_function_param::<Amount>(3) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("AMOUNT IOU Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let (iou_amount, iou_issuer, iou_currency) = match &iou_token {
|
||||
Amount::IOU { amount, issuer, currency } => {
|
||||
// trace amount hex
|
||||
let _ = trace_data("AMOUNT Value (IOU):", &amount.0, DataRepr::AsHex);
|
||||
let _ = trace_float("AMOUNT Value (IOU) - Original:", &amount.0);
|
||||
let _ = trace_data("IOU Issuer:", &issuer.0, DataRepr::AsHex);
|
||||
let _ = trace_data("IOU Currency:", ¤cy.0, DataRepr::AsHex);
|
||||
|
||||
// Add FLOAT_ONE to the IOU amount
|
||||
let mut new_amount: [u8; 8] = [0u8; 8];
|
||||
let result = unsafe {
|
||||
float_add(
|
||||
amount.0.as_ptr(),
|
||||
8,
|
||||
FLOAT_ONE.as_ptr(),
|
||||
8,
|
||||
new_amount.as_mut_ptr(),
|
||||
8,
|
||||
FLOAT_ROUNDING_MODES_TO_NEAREST,
|
||||
)
|
||||
};
|
||||
|
||||
if result == 8 {
|
||||
// trace hex of the new amount
|
||||
let _ = trace_data("AMOUNT Value (IOU) - After adding 1:", &new_amount, DataRepr::AsHex);
|
||||
let _ = trace_float("AMOUNT Value (IOU) - After adding 1:", &new_amount);
|
||||
|
||||
// Create a new Amount with the updated amount
|
||||
let updated_token = Amount::IOU {
|
||||
amount: new_amount.into(),
|
||||
issuer: *issuer,
|
||||
currency: *currency,
|
||||
};
|
||||
|
||||
// You now have the updated token amount in `updated_token`
|
||||
// and the raw float bytes in `new_amount`
|
||||
|
||||
} else {
|
||||
let _ = trace_num("Error adding FLOAT_ONE to IOU amount, result:", result as i64);
|
||||
}
|
||||
|
||||
(Some(*amount), Some(*issuer), Some(*currency))
|
||||
}
|
||||
_ => {
|
||||
let _ = trace_data("AMOUNT Value (IOU):", &[0u8; 8], DataRepr::AsHex);
|
||||
(None, None, None)
|
||||
}
|
||||
};
|
||||
// trace new iou_amount as hex
|
||||
if let Some(amount) = iou_amount {
|
||||
let _ = trace_data("IOU Amount:", &amount.0, DataRepr::AsHex);
|
||||
} else {
|
||||
let _ = trace_data("IOU Amount:", &[0u8; 8], DataRepr::AsHex);
|
||||
}
|
||||
|
||||
// TODO: replace with require
|
||||
if iou_amount.is_none() {
|
||||
let _ = trace("AMOUNT.IOU Parameter Error: Invalid Type");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// let mut buf = [0x00; 12];
|
||||
// let output_len = unsafe { function_param(12, STI_NUMBER.into(), buf.as_mut_ptr(), buf.len()) };
|
||||
// let _ = trace_num("NUMBER Value Len:", output_len as i64);
|
||||
|
||||
// NUMBER
|
||||
let number = match get_function_param::<Number>(4) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("NUMBER Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// trace the value
|
||||
let buf = number.as_bytes();
|
||||
let _ = trace_data("NUMBER Value:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expectedNumber: [u8; 12] = [
|
||||
0x10, 0xA7, 0x41, 0xA4, 0x62, 0x78, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xEE
|
||||
];
|
||||
if buf != expectedNumber {
|
||||
let _ = trace("NUMBER Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// // Parse Number to get mantissa and exponent
|
||||
// let stnumber = Number::from(&buf).unwrap();
|
||||
let _ = trace_num("NUMBER Mantissa:", number.mantissa);
|
||||
let _ = trace_num("NUMBER Exponent:", number.exponent as i64);
|
||||
|
||||
let mut opaque_float_buf = [0x00; 8];
|
||||
let result = unsafe {
|
||||
float_set(
|
||||
number.exponent,
|
||||
number.mantissa,
|
||||
opaque_float_buf.as_mut_ptr(),
|
||||
8,
|
||||
FLOAT_ROUNDING_MODES_TO_NEAREST
|
||||
)
|
||||
};
|
||||
|
||||
let opaque = OpaqueFloat::from(opaque_float_buf);
|
||||
let _ = trace_float("NUMBER as OpaqueFloat:", &opaque.0);
|
||||
let _ = trace_data("NUMBER OpaqueFloat Hex:", &opaque_float_buf, DataRepr::AsHex);
|
||||
|
||||
// AMOUNT (MPT)
|
||||
// ISSUE (XRP)
|
||||
// ISSUE (IOU)
|
||||
// ISSUE (MPT)
|
||||
// CURRENCY
|
||||
|
||||
return 0; // Return success code
|
||||
}
|
||||
29
src/test/app/wasm_fixtures/instance_params_other/Cargo.toml
Normal file
29
src/test/app/wasm_fixtures/instance_params_other/Cargo.toml
Normal file
@@ -0,0 +1,29 @@
|
||||
[package]
|
||||
name = "instance_params_other"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
description = ""
|
||||
license = "MIT"
|
||||
|
||||
[workspace]
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[target.wasm32-unknown-unknown]
|
||||
rustflags = ["-C", "target-feature=-bulk-memory"]
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z" # Most aggressive size optimization
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
strip = true # Remove debug symbols
|
||||
debug = false # Disable debug info generation
|
||||
overflow-checks = false # Disable overflow checks (use cautiously)
|
||||
|
||||
[profile.dev]
|
||||
panic = "unwind"
|
||||
|
||||
[dependencies]
|
||||
xrpl-wasm-stdlib = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", rev = "bd44875189fff1ae1c4ae740331d2366cb014cc0", package = "xrpl-wasm-stdlib" }
|
||||
206
src/test/app/wasm_fixtures/instance_params_other/src/lib.rs
Normal file
206
src/test/app/wasm_fixtures/instance_params_other/src/lib.rs
Normal file
@@ -0,0 +1,206 @@
|
||||
#![allow(unused_imports)]
|
||||
#![cfg_attr(target_arch = "wasm32", no_std)]
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
extern crate std;
|
||||
|
||||
use xrpl_wasm_stdlib::host::trace::{DataRepr, trace, trace_data, trace_num, trace_float};
|
||||
use xrpl_wasm_stdlib::host::{instance_param};
|
||||
use xrpl_wasm_stdlib::core::params::instance::{get_instance_param};
|
||||
use xrpl_wasm_stdlib::core::type_codes::{
|
||||
STI_AMOUNT, STI_VL, STI_ACCOUNT, STI_OBJECT, STI_ARRAY, STI_CURRENCY, STI_NUMBER
|
||||
};
|
||||
use xrpl_wasm_stdlib::core::types::opaque_float::OpaqueFloat;
|
||||
use xrpl_wasm_stdlib::core::types::number::Number;
|
||||
use xrpl_wasm_stdlib::core::types::account_id::AccountID;
|
||||
use xrpl_wasm_stdlib::core::types::amount::Amount;
|
||||
use xrpl_wasm_stdlib::host::{FLOAT_ROUNDING_MODES_TO_NEAREST, float_add, float_set};
|
||||
use xrpl_wasm_stdlib::core::types::opaque_float::{FLOAT_NEGATIVE_ONE, FLOAT_ONE};
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn instance_params_other() -> i32 {
|
||||
// // VL
|
||||
// let mut buf = [0x00; 4];
|
||||
// let output_len = unsafe { instance_param(0, STI_VL.into(), buf.as_mut_ptr(), buf.len()) };
|
||||
// let _ = trace_num("VL Value Len:", output_len as i64);
|
||||
// // as hex
|
||||
// let _ = trace_data("VL Hex:", &buf[0..4], DataRepr::AsHex);
|
||||
|
||||
// ACCOUNT
|
||||
let account_id = match get_instance_param::<AccountID>(1) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("ACCOUNT Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// trace the value
|
||||
let _ = trace_data("ACCOUNT Value:", &account_id.0, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expectedAccount: [u8; 20] = [
|
||||
0xAE, 0x12, 0x3A, 0x85, 0x56, 0xF3, 0xCF, 0x91,
|
||||
0x15, 0x47, 0x11, 0x37, 0x6A, 0xFB, 0x0F, 0x89,
|
||||
0x4F, 0x83, 0x2B, 0x3D
|
||||
];
|
||||
if account_id.0 != expectedAccount {
|
||||
let _ = trace("ACCOUNT Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// AMOUNT XRP
|
||||
let xrp_token = match get_instance_param::<Amount>(2) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("AMOUNT XRP Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
match xrp_token {
|
||||
Amount::XRP { num_drops } => {
|
||||
let _ = trace_num("AMOUNT Value (XRP):", num_drops);
|
||||
}
|
||||
_ => {
|
||||
let _ = trace_num("AMOUNT Value (XRP):", -1);
|
||||
}
|
||||
}
|
||||
let buf = match xrp_token {
|
||||
Amount::XRP { num_drops } => num_drops.to_le_bytes(),
|
||||
_ => [0u8; 8],
|
||||
};
|
||||
let _ = trace_data("AMOUNT Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if let Amount::XRP { num_drops } = xrp_token {
|
||||
if num_drops != 1000000 {
|
||||
let _ = trace("AMOUNT.XRP Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
let _ = trace("AMOUNT.XRP Parameter Error: Invalid Type");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// AMOUNT IOU
|
||||
let iou_token = match get_instance_param::<Amount>(3) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("AMOUNT IOU Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let (iou_amount, iou_issuer, iou_currency) = match &iou_token {
|
||||
Amount::IOU { amount, issuer, currency } => {
|
||||
// trace amount hex
|
||||
let _ = trace_data("AMOUNT Value (IOU):", &amount.0, DataRepr::AsHex);
|
||||
let _ = trace_float("AMOUNT Value (IOU) - Original:", &amount.0);
|
||||
let _ = trace_data("IOU Issuer:", &issuer.0, DataRepr::AsHex);
|
||||
let _ = trace_data("IOU Currency:", ¤cy.0, DataRepr::AsHex);
|
||||
|
||||
// Add FLOAT_ONE to the IOU amount
|
||||
let mut new_amount: [u8; 8] = [0u8; 8];
|
||||
let result = unsafe {
|
||||
float_add(
|
||||
amount.0.as_ptr(),
|
||||
8,
|
||||
FLOAT_ONE.as_ptr(),
|
||||
8,
|
||||
new_amount.as_mut_ptr(),
|
||||
8,
|
||||
FLOAT_ROUNDING_MODES_TO_NEAREST,
|
||||
)
|
||||
};
|
||||
|
||||
if result == 8 {
|
||||
// trace hex of the new amount
|
||||
let _ = trace_data("AMOUNT Value (IOU) - After adding 1:", &new_amount, DataRepr::AsHex);
|
||||
let _ = trace_float("AMOUNT Value (IOU) - After adding 1:", &new_amount);
|
||||
|
||||
// Create a new Amount with the updated amount
|
||||
let updated_token = Amount::IOU {
|
||||
amount: new_amount.into(),
|
||||
issuer: *issuer,
|
||||
currency: *currency,
|
||||
};
|
||||
|
||||
// You now have the updated token amount in `updated_token`
|
||||
// and the raw float bytes in `new_amount`
|
||||
|
||||
} else {
|
||||
let _ = trace_num("Error adding FLOAT_ONE to IOU amount, result:", result as i64);
|
||||
}
|
||||
|
||||
(Some(*amount), Some(*issuer), Some(*currency))
|
||||
}
|
||||
_ => {
|
||||
let _ = trace_data("AMOUNT Value (IOU):", &[0u8; 8], DataRepr::AsHex);
|
||||
(None, None, None)
|
||||
}
|
||||
};
|
||||
// trace new iou_amount as hex
|
||||
if let Some(amount) = iou_amount {
|
||||
let _ = trace_data("IOU Amount:", &amount.0, DataRepr::AsHex);
|
||||
} else {
|
||||
let _ = trace_data("IOU Amount:", &[0u8; 8], DataRepr::AsHex);
|
||||
}
|
||||
|
||||
// TODO: replace with require
|
||||
if iou_amount.is_none() {
|
||||
let _ = trace("AMOUNT.IOU Parameter Error: Invalid Type");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// let mut buf = [0x00; 12];
|
||||
// let output_len = unsafe { instance_param(12, STI_NUMBER.into(), buf.as_mut_ptr(), buf.len()) };
|
||||
// let _ = trace_num("NUMBER Value Len:", output_len as i64);
|
||||
|
||||
// NUMBER
|
||||
let number = match get_instance_param::<Number>(4) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("NUMBER Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// trace the value
|
||||
let buf = number.as_bytes();
|
||||
let _ = trace_data("NUMBER Value:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expectedNumber: [u8; 12] = [
|
||||
0x10, 0xA7, 0x41, 0xA4, 0x62, 0x78, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xEE
|
||||
];
|
||||
if buf != expectedNumber {
|
||||
let _ = trace("NUMBER Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// // Parse Number to get mantissa and exponent
|
||||
// let stnumber = Number::from(&buf).unwrap();
|
||||
let _ = trace_num("NUMBER Mantissa:", number.mantissa);
|
||||
let _ = trace_num("NUMBER Exponent:", number.exponent as i64);
|
||||
|
||||
let mut opaque_float_buf = [0x00; 8];
|
||||
let result = unsafe {
|
||||
float_set(
|
||||
number.exponent,
|
||||
number.mantissa,
|
||||
opaque_float_buf.as_mut_ptr(),
|
||||
8,
|
||||
FLOAT_ROUNDING_MODES_TO_NEAREST
|
||||
)
|
||||
};
|
||||
|
||||
let opaque = OpaqueFloat::from(opaque_float_buf);
|
||||
let _ = trace_float("NUMBER as OpaqueFloat:", &opaque.0);
|
||||
let _ = trace_data("NUMBER OpaqueFloat Hex:", &opaque_float_buf, DataRepr::AsHex);
|
||||
|
||||
// AMOUNT (MPT)
|
||||
// ISSUE (XRP)
|
||||
// ISSUE (IOU)
|
||||
// ISSUE (MPT)
|
||||
// CURRENCY
|
||||
|
||||
return 0; // Return success code
|
||||
}
|
||||
26
src/test/app/wasm_fixtures/instance_params_uint/Cargo.toml
Normal file
26
src/test/app/wasm_fixtures/instance_params_uint/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
[package]
|
||||
name = "instance_params_uint"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
description = ""
|
||||
license = "MIT"
|
||||
|
||||
[workspace]
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z" # Most aggressive size optimization
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
strip = true # Remove debug symbols
|
||||
debug = false # Disable debug info generation
|
||||
overflow-checks = false # Disable overflow checks (use cautiously)
|
||||
|
||||
[profile.dev]
|
||||
panic = "unwind"
|
||||
|
||||
[dependencies]
|
||||
xrpl-wasm-stdlib = { git = "https://github.com/ripple/xrpl-wasm-stdlib.git", rev = "bd44875189fff1ae1c4ae740331d2366cb014cc0", package = "xrpl-wasm-stdlib" }
|
||||
179
src/test/app/wasm_fixtures/instance_params_uint/src/lib.rs
Normal file
179
src/test/app/wasm_fixtures/instance_params_uint/src/lib.rs
Normal file
@@ -0,0 +1,179 @@
|
||||
#![allow(unused_imports)]
|
||||
#![cfg_attr(target_arch = "wasm32", no_std)]
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
extern crate std;
|
||||
|
||||
use xrpl_wasm_stdlib::host::trace::{DataRepr, trace, trace_data, trace_num};
|
||||
use xrpl_wasm_stdlib::host::{instance_param};
|
||||
use xrpl_wasm_stdlib::core::params::instance::{get_instance_param};
|
||||
use xrpl_wasm_stdlib::core::type_codes::{
|
||||
STI_UINT8, STI_UINT16, STI_UINT32, STI_UINT64, STI_UINT128,
|
||||
STI_UINT160, STI_UINT192, STI_UINT256
|
||||
};
|
||||
use xrpl_wasm_stdlib::core::types::uint::Hash160;
|
||||
use xrpl_wasm_stdlib::core::types::uint::Hash192;
|
||||
use xrpl_wasm_stdlib::core::types::uint::Hash256;
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn instance_params_uint() -> i32 {
|
||||
// UINT8
|
||||
let value = match get_instance_param::<u8>(0) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT8 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let _ = trace_num("UINT8 Value:", value as i64);
|
||||
// as hex
|
||||
let _ = trace_data("UINT8 Hex:", &[value], DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if value != 255 {
|
||||
let _ = trace("UINT8 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT16
|
||||
let value = match get_instance_param::<u16>(1) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT16 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let _ = trace_num("UINT16 Value:", value as i64);
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT16 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if value != 65535 {
|
||||
let _ = trace("UINT16 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT32
|
||||
let value = match get_instance_param::<u32>(2) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT32 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT32 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if value != 4294967295 {
|
||||
let _ = trace("UINT32 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT64
|
||||
let value = match get_instance_param::<u64>(3) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT64 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
let _ = trace_num("UINT64 Value:", value as i64);
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT64 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if buf != [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] {
|
||||
let _ = trace("UINT64 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT128
|
||||
let value = match get_instance_param::<u128>(4) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT128 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.to_le_bytes();
|
||||
let _ = trace_data("UINT128 Hex:", &buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
if buf != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01] {
|
||||
let _ = trace("UINT128 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT160
|
||||
let value = match get_instance_param::<Hash160>(5) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT160 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.as_bytes();
|
||||
let _ = trace_data("UINT160 Hex:", buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expected190: [u8; 20] = [
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||
];
|
||||
if *buf != expected190 {
|
||||
let _ = trace("UINT160 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT192
|
||||
let value = match get_instance_param::<Hash192>(6) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT192 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.as_bytes();
|
||||
let _ = trace_data("UINT192 Hex:", buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expected192: [u8; 24] = [
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||
];
|
||||
if *buf != expected192 {
|
||||
let _ = trace("UINT192 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// UINT256
|
||||
let value = match get_instance_param::<Hash256>(7) {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
let _ = trace_num("UINT256 Parameter Error Code:", err as i64);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
// as hex
|
||||
let buf = value.as_bytes();
|
||||
let _ = trace_data("UINT256 Hex:", buf, DataRepr::AsHex);
|
||||
|
||||
// TODO: replace with require
|
||||
let expected256: [u8; 32] = [
|
||||
0xD9, 0x55, 0xDA, 0xC2, 0xE7, 0x75, 0x19, 0xF0,
|
||||
0x5A, 0xD1, 0x51, 0xA5, 0xD3, 0xC9, 0x9F, 0xC8,
|
||||
0x12, 0x5F, 0xB3, 0x9D, 0x58, 0xFF, 0x9F, 0x10,
|
||||
0x6F, 0x1A, 0xCA, 0x44, 0x91, 0x90, 0x2C, 0x25
|
||||
];
|
||||
if *buf != expected256 {
|
||||
let _ = trace("UINT256 Parameter Error: Invalid Value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // Return success code
|
||||
}
|
||||
@@ -2575,7 +2575,11 @@ NetworkOPsImp::pubConsensus(ConsensusPhase phase)
|
||||
void
|
||||
NetworkOPsImp::pubContractEvent(std::string const& name, STJson const& event)
|
||||
{
|
||||
std::lock_guard const sl(subLock_);
|
||||
// Hold each locked subscriber alive until after streamLock_ is released:
|
||||
// ~InfoSub re-acquires streamLock_ and would self-deadlock.
|
||||
std::vector<InfoSub::pointer> toRelease;
|
||||
|
||||
std::scoped_lock const sl(streamLock_);
|
||||
|
||||
auto& streamMap = streamMaps_[SContractEvents];
|
||||
if (!streamMap.empty())
|
||||
@@ -2590,6 +2594,7 @@ NetworkOPsImp::pubContractEvent(std::string const& name, STJson const& event)
|
||||
if (auto p = i->second.lock())
|
||||
{
|
||||
p->send(jvObj, true);
|
||||
toRelease.push_back(std::move(p));
|
||||
++i;
|
||||
}
|
||||
else
|
||||
@@ -4783,7 +4788,7 @@ NetworkOPsImp::unsubConsensus(std::uint64_t uSeq)
|
||||
bool
|
||||
NetworkOPsImp::subContractEvent(InfoSub::ref isrListener)
|
||||
{
|
||||
std::lock_guard const sl(subLock_);
|
||||
std::scoped_lock const sl(streamLock_);
|
||||
return streamMaps_[SContractEvents].emplace(isrListener->getSeq(), isrListener).second;
|
||||
}
|
||||
|
||||
@@ -4791,8 +4796,8 @@ NetworkOPsImp::subContractEvent(InfoSub::ref isrListener)
|
||||
bool
|
||||
NetworkOPsImp::unsubContractEvent(std::uint64_t uSeq)
|
||||
{
|
||||
std::lock_guard const sl(subLock_);
|
||||
return streamMaps_[SContractEvents].erase(uSeq);
|
||||
std::scoped_lock const sl(streamLock_);
|
||||
return streamMaps_[SContractEvents].erase(uSeq) != 0u;
|
||||
}
|
||||
|
||||
InfoSub::pointer
|
||||
|
||||
@@ -864,15 +864,16 @@ parseContractSource(
|
||||
return parseObjectID(params, fieldName);
|
||||
}
|
||||
|
||||
auto const id = LedgerEntryHelpers::requiredAccountID(params, jss::owner, "malformedOwner");
|
||||
auto const id = ledger_entry_helpers::requiredAccountID(params, jss::owner, "malformedOwner");
|
||||
if (!id)
|
||||
return std::unexpected(id.error());
|
||||
|
||||
auto const seq = LedgerEntryHelpers::requiredUInt32(params, jss::seq, "malformedRequest");
|
||||
auto const seq = ledger_entry_helpers::requiredUInt32(params, jss::seq, "malformedRequest");
|
||||
if (!seq)
|
||||
return std::unexpected(seq.error());
|
||||
|
||||
return keylet::vault(*id, *seq).key;
|
||||
auto const seqProxy = SeqProxy::rawSequence(*seq);
|
||||
return keylet::vault(*id, seqProxy).key;
|
||||
}
|
||||
|
||||
static std::expected<uint256, json::Value>
|
||||
@@ -886,15 +887,16 @@ parseContract(
|
||||
return parseObjectID(params, fieldName);
|
||||
}
|
||||
|
||||
auto const id = LedgerEntryHelpers::requiredAccountID(params, jss::owner, "malformedOwner");
|
||||
auto const id = ledger_entry_helpers::requiredAccountID(params, jss::owner, "malformedOwner");
|
||||
if (!id)
|
||||
return std::unexpected(id.error());
|
||||
|
||||
auto const seq = LedgerEntryHelpers::requiredUInt32(params, jss::seq, "malformedRequest");
|
||||
auto const seq = ledger_entry_helpers::requiredUInt32(params, jss::seq, "malformedRequest");
|
||||
if (!seq)
|
||||
return std::unexpected(seq.error());
|
||||
|
||||
return keylet::vault(*id, *seq).key;
|
||||
auto const seqProxy = SeqProxy::rawSequence(*seq);
|
||||
return keylet::vault(*id, seqProxy).key;
|
||||
}
|
||||
|
||||
static std::expected<uint256, json::Value>
|
||||
@@ -908,15 +910,16 @@ parseContractData(
|
||||
return parseObjectID(params, fieldName);
|
||||
}
|
||||
|
||||
auto const id = LedgerEntryHelpers::requiredAccountID(params, jss::owner, "malformedOwner");
|
||||
auto const id = ledger_entry_helpers::requiredAccountID(params, jss::owner, "malformedOwner");
|
||||
if (!id)
|
||||
return std::unexpected(id.error());
|
||||
|
||||
auto const seq = LedgerEntryHelpers::requiredUInt32(params, jss::seq, "malformedRequest");
|
||||
auto const seq = ledger_entry_helpers::requiredUInt32(params, jss::seq, "malformedRequest");
|
||||
if (!seq)
|
||||
return std::unexpected(seq.error());
|
||||
|
||||
return keylet::vault(*id, *seq).key;
|
||||
auto const seqProxy = SeqProxy::rawSequence(*seq);
|
||||
return keylet::vault(*id, seqProxy).key;
|
||||
}
|
||||
|
||||
struct LedgerEntry
|
||||
|
||||
Reference in New Issue
Block a user