mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 17:56:49 +00:00
Merge branch 'ripple/wamr' into ripple/wamr-host-functions
This commit is contained in:
6
.github/actions/build-deps/action.yml
vendored
6
.github/actions/build-deps/action.yml
vendored
@@ -28,6 +28,7 @@ runs:
|
||||
BUILD_DIR: ${{ inputs.build_dir }}
|
||||
BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }}
|
||||
BUILD_TYPE: ${{ inputs.build_type }}
|
||||
VERBOSITY: ${{ inputs.verbosity }}
|
||||
run: |
|
||||
echo 'Installing dependencies.'
|
||||
mkdir -p '${{ env.BUILD_DIR }}'
|
||||
@@ -38,7 +39,6 @@ runs:
|
||||
--options:host='&:tests=True' \
|
||||
--options:host='&:xrpld=True' \
|
||||
--settings:all build_type='${{ env.BUILD_TYPE }}' \
|
||||
--conf:all tools.build:verbosity='${{ inputs.verbosity }}' \
|
||||
--conf:all tools.compilation:verbosity='${{ inputs.verbosity }}' \
|
||||
--conf:all tools.build:jobs=$(nproc) \
|
||||
--conf:all tools.build:verbosity='${{ env.VERBOSITY }}' \
|
||||
--conf:all tools.compilation:verbosity='${{ env.VERBOSITY }}' \
|
||||
..
|
||||
|
||||
26
.github/scripts/strategy-matrix/linux.json
vendored
26
.github/scripts/strategy-matrix/linux.json
vendored
@@ -73,47 +73,61 @@
|
||||
"compiler_version": "20",
|
||||
"image_sha": "6948666"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "8",
|
||||
"compiler_name": "gcc",
|
||||
"compiler_version": "14",
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "8",
|
||||
"compiler_name": "clang",
|
||||
"compiler_version": "any",
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "9",
|
||||
"compiler_name": "gcc",
|
||||
"compiler_version": "12",
|
||||
"image_sha": "6948666"
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "9",
|
||||
"compiler_name": "gcc",
|
||||
"compiler_version": "13",
|
||||
"image_sha": "6948666"
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "9",
|
||||
"compiler_name": "gcc",
|
||||
"compiler_version": "14",
|
||||
"image_sha": "6948666"
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "9",
|
||||
"compiler_name": "clang",
|
||||
"compiler_version": "any",
|
||||
"image_sha": "6948666"
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "10",
|
||||
"compiler_name": "gcc",
|
||||
"compiler_version": "14",
|
||||
"image_sha": "6948666"
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "rhel",
|
||||
"distro_version": "10",
|
||||
"compiler_name": "clang",
|
||||
"compiler_version": "any",
|
||||
"image_sha": "6948666"
|
||||
"image_sha": "10e69b4"
|
||||
},
|
||||
{
|
||||
"distro_name": "ubuntu",
|
||||
|
||||
1
.github/workflows/on-pr.yml
vendored
1
.github/workflows/on-pr.yml
vendored
@@ -103,6 +103,7 @@ jobs:
|
||||
if: ${{ needs.should-run.outputs.go == 'true' }}
|
||||
uses: ./.github/workflows/reusable-build-test.yml
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [linux, macos, windows]
|
||||
with:
|
||||
|
||||
1
.github/workflows/on-trigger.yml
vendored
1
.github/workflows/on-trigger.yml
vendored
@@ -65,6 +65,7 @@ jobs:
|
||||
build-test:
|
||||
uses: ./.github/workflows/reusable-build-test.yml
|
||||
strategy:
|
||||
fail-fast: ${{ github.event_name == 'merge_group' }}
|
||||
matrix:
|
||||
os: [linux, macos, windows]
|
||||
with:
|
||||
|
||||
2
.github/workflows/pre-commit.yml
vendored
2
.github/workflows/pre-commit.yml
vendored
@@ -9,7 +9,7 @@ on:
|
||||
jobs:
|
||||
# Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
|
||||
run-hooks:
|
||||
uses: XRPLF/actions/.github/workflows/pre-commit.yml@af1b0f0d764cda2e5435f5ac97b240d4bd4d95d3
|
||||
uses: XRPLF/actions/.github/workflows/pre-commit.yml@a8d7472b450eb53a1e5228f64552e5974457a21a
|
||||
with:
|
||||
runs_on: ubuntu-latest
|
||||
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-a8c7be1" }'
|
||||
|
||||
2
.github/workflows/reusable-build-test.yml
vendored
2
.github/workflows/reusable-build-test.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
- generate-matrix
|
||||
uses: ./.github/workflows/reusable-build-test-config.yml
|
||||
strategy:
|
||||
fail-fast: false
|
||||
fail-fast: ${{ github.event_name == 'merge_group' }}
|
||||
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
||||
max-parallel: 10
|
||||
with:
|
||||
|
||||
4
.github/workflows/reusable-notify-clio.yml
vendored
4
.github/workflows/reusable-notify-clio.yml
vendored
@@ -64,7 +64,9 @@ jobs:
|
||||
conan_remote_name: ${{ inputs.conan_remote_name }}
|
||||
conan_remote_url: ${{ inputs.conan_remote_url }}
|
||||
- name: Log into Conan remote
|
||||
run: conan remote login ${{ inputs.conan_remote_name }} "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
|
||||
env:
|
||||
CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
|
||||
run: conan remote login ${{ env.CONAN_REMOTE_NAME }} "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
|
||||
- name: Upload package
|
||||
env:
|
||||
CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
core:non_interactive=True
|
||||
core.download:parallel={{ os.cpu_count() }}
|
||||
core.upload:parallel={{ os.cpu_count() }}
|
||||
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
|
||||
tools.build:jobs={{ os.cpu_count() - 1 }}
|
||||
|
||||
@@ -3081,16 +3081,23 @@ public:
|
||||
env.fund(XRP(1000000), alice);
|
||||
env.close();
|
||||
|
||||
auto const withQueue =
|
||||
R"({ "account": ")" + alice.human() + R"(", "queue": true })";
|
||||
auto const withoutQueue = R"({ "account": ")" + alice.human() + R"("})";
|
||||
auto const prevLedgerWithQueue = R"({ "account": ")" + alice.human() +
|
||||
R"(", "queue": true, "ledger_index": 3 })";
|
||||
Json::Value withQueue;
|
||||
withQueue[jss::account] = alice.human();
|
||||
withQueue[jss::queue] = true;
|
||||
|
||||
Json::Value withoutQueue;
|
||||
withoutQueue[jss::account] = alice.human();
|
||||
|
||||
Json::Value prevLedgerWithQueue;
|
||||
prevLedgerWithQueue[jss::account] = alice.human();
|
||||
prevLedgerWithQueue[jss::queue] = true;
|
||||
prevLedgerWithQueue[jss::ledger_index] = 3;
|
||||
BEAST_EXPECT(env.current()->info().seq > 3);
|
||||
|
||||
{
|
||||
// account_info without the "queue" argument.
|
||||
auto const info = env.rpc("json", "account_info", withoutQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withoutQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -3098,7 +3105,8 @@ public:
|
||||
}
|
||||
{
|
||||
// account_info with the "queue" argument.
|
||||
auto const info = env.rpc("json", "account_info", withQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -3120,7 +3128,8 @@ public:
|
||||
checkMetrics(*this, env, 0, 6, 4, 3);
|
||||
|
||||
{
|
||||
auto const info = env.rpc("json", "account_info", withQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -3149,7 +3158,8 @@ public:
|
||||
checkMetrics(*this, env, 4, 6, 4, 3);
|
||||
|
||||
{
|
||||
auto const info = env.rpc("json", "account_info", withQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -3212,7 +3222,8 @@ public:
|
||||
checkMetrics(*this, env, 1, 8, 5, 4);
|
||||
|
||||
{
|
||||
auto const info = env.rpc("json", "account_info", withQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -3276,7 +3287,8 @@ public:
|
||||
checkMetrics(*this, env, 1, 8, 5, 4);
|
||||
|
||||
{
|
||||
auto const info = env.rpc("json", "account_info", withQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -3344,7 +3356,7 @@ public:
|
||||
|
||||
{
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", prevLedgerWithQueue);
|
||||
env.rpc("json", "account_info", to_string(prevLedgerWithQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
RPC::contains_error(info[jss::result]));
|
||||
@@ -3356,7 +3368,8 @@ public:
|
||||
checkMetrics(*this, env, 0, 10, 0, 5);
|
||||
|
||||
{
|
||||
auto const info = env.rpc("json", "account_info", withQueue);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withQueue));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
|
||||
@@ -58,10 +58,10 @@ public:
|
||||
{
|
||||
// account_info with an account that's not in the ledger.
|
||||
Account const bogie{"bogie"};
|
||||
auto const info = env.rpc(
|
||||
"json",
|
||||
"account_info",
|
||||
R"({ "account": ")" + bogie.human() + R"("})");
|
||||
Json::Value params;
|
||||
params[jss::account] = bogie.human();
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(params));
|
||||
BEAST_EXPECT(
|
||||
info[jss::result][jss::error_code] == rpcACT_NOT_FOUND);
|
||||
BEAST_EXPECT(
|
||||
@@ -128,16 +128,18 @@ public:
|
||||
Account const alice{"alice"};
|
||||
env.fund(XRP(1000), alice);
|
||||
|
||||
auto const withoutSigners =
|
||||
std::string("{ ") + "\"account\": \"" + alice.human() + "\"}";
|
||||
Json::Value withoutSigners;
|
||||
withoutSigners[jss::account] = alice.human();
|
||||
|
||||
auto const withSigners = std::string("{ ") + "\"account\": \"" +
|
||||
alice.human() + "\", " + "\"signer_lists\": true }";
|
||||
Json::Value withSigners;
|
||||
withSigners[jss::account] = alice.human();
|
||||
withSigners[jss::signer_lists] = true;
|
||||
|
||||
// Alice has no SignerList yet.
|
||||
{
|
||||
// account_info without the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withoutSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withoutSigners));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -146,7 +148,8 @@ public:
|
||||
}
|
||||
{
|
||||
// account_info with the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withSigners));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -164,7 +167,8 @@ public:
|
||||
env(smallSigners);
|
||||
{
|
||||
// account_info without the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withoutSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withoutSigners));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -173,7 +177,8 @@ public:
|
||||
}
|
||||
{
|
||||
// account_info with the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withSigners));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -216,7 +221,8 @@ public:
|
||||
env(bigSigners);
|
||||
{
|
||||
// account_info with the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withSigners));
|
||||
BEAST_EXPECT(
|
||||
info.isMember(jss::result) &&
|
||||
info[jss::result].isMember(jss::account_data));
|
||||
@@ -250,12 +256,14 @@ public:
|
||||
Account const alice{"alice"};
|
||||
env.fund(XRP(1000), alice);
|
||||
|
||||
auto const withoutSigners = std::string("{ ") +
|
||||
"\"api_version\": 2, \"account\": \"" + alice.human() + "\"}";
|
||||
Json::Value withoutSigners;
|
||||
withoutSigners[jss::api_version] = 2;
|
||||
withoutSigners[jss::account] = alice.human();
|
||||
|
||||
auto const withSigners = std::string("{ ") +
|
||||
"\"api_version\": 2, \"account\": \"" + alice.human() + "\", " +
|
||||
"\"signer_lists\": true }";
|
||||
Json::Value withSigners;
|
||||
withSigners[jss::api_version] = 2;
|
||||
withSigners[jss::account] = alice.human();
|
||||
withSigners[jss::signer_lists] = true;
|
||||
|
||||
auto const withSignersAsString = std::string("{ ") +
|
||||
"\"api_version\": 2, \"account\": \"" + alice.human() + "\", " +
|
||||
@@ -264,13 +272,15 @@ public:
|
||||
// Alice has no SignerList yet.
|
||||
{
|
||||
// account_info without the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withoutSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withoutSigners));
|
||||
BEAST_EXPECT(info.isMember(jss::result));
|
||||
BEAST_EXPECT(!info[jss::result].isMember(jss::signer_lists));
|
||||
}
|
||||
{
|
||||
// account_info with the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withSigners));
|
||||
BEAST_EXPECT(info.isMember(jss::result));
|
||||
auto const& data = info[jss::result];
|
||||
BEAST_EXPECT(data.isMember(jss::signer_lists));
|
||||
@@ -286,13 +296,15 @@ public:
|
||||
env(smallSigners);
|
||||
{
|
||||
// account_info without the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withoutSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withoutSigners));
|
||||
BEAST_EXPECT(info.isMember(jss::result));
|
||||
BEAST_EXPECT(!info[jss::result].isMember(jss::signer_lists));
|
||||
}
|
||||
{
|
||||
// account_info with the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withSigners));
|
||||
BEAST_EXPECT(info.isMember(jss::result));
|
||||
auto const& data = info[jss::result];
|
||||
BEAST_EXPECT(data.isMember(jss::signer_lists));
|
||||
@@ -340,7 +352,8 @@ public:
|
||||
env(bigSigners);
|
||||
{
|
||||
// account_info with the "signer_lists" argument.
|
||||
auto const info = env.rpc("json", "account_info", withSigners);
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(withSigners));
|
||||
BEAST_EXPECT(info.isMember(jss::result));
|
||||
auto const& data = info[jss::result];
|
||||
BEAST_EXPECT(data.isMember(jss::signer_lists));
|
||||
@@ -567,10 +580,10 @@ public:
|
||||
auto getAccountFlag = [&env](
|
||||
std::string_view fName,
|
||||
Account const& account) {
|
||||
auto const info = env.rpc(
|
||||
"json",
|
||||
"account_info",
|
||||
R"({"account" : ")" + account.human() + R"("})");
|
||||
Json::Value params;
|
||||
params[jss::account] = account.human();
|
||||
auto const info =
|
||||
env.rpc("json", "account_info", to_string(params));
|
||||
|
||||
std::optional<bool> res;
|
||||
if (info[jss::result][jss::status] == "success" &&
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -72,39 +72,23 @@ getAutofillSequence(Json::Value const& tx_json, RPC::JsonContext& context)
|
||||
}
|
||||
|
||||
static std::optional<Json::Value>
|
||||
autofillTx(Json::Value& tx_json, RPC::JsonContext& context)
|
||||
autofillSignature(Json::Value& sigObject)
|
||||
{
|
||||
if (!tx_json.isMember(jss::Fee))
|
||||
{
|
||||
// autofill Fee
|
||||
// Must happen after all the other autofills happen
|
||||
// Error handling/messaging works better that way
|
||||
auto feeOrError = RPC::getCurrentNetworkFee(
|
||||
context.role,
|
||||
context.app.config(),
|
||||
context.app.getFeeTrack(),
|
||||
context.app.getTxQ(),
|
||||
context.app,
|
||||
tx_json);
|
||||
if (feeOrError.isMember(jss::error))
|
||||
return feeOrError;
|
||||
tx_json[jss::Fee] = feeOrError;
|
||||
}
|
||||
|
||||
if (!tx_json.isMember(jss::SigningPubKey))
|
||||
if (!sigObject.isMember(jss::SigningPubKey))
|
||||
{
|
||||
// autofill SigningPubKey
|
||||
tx_json[jss::SigningPubKey] = "";
|
||||
sigObject[jss::SigningPubKey] = "";
|
||||
}
|
||||
|
||||
if (tx_json.isMember(jss::Signers))
|
||||
if (sigObject.isMember(jss::Signers))
|
||||
{
|
||||
if (!tx_json[jss::Signers].isArray())
|
||||
if (!sigObject[jss::Signers].isArray())
|
||||
return RPC::invalid_field_error("tx.Signers");
|
||||
// check multisigned signers
|
||||
for (unsigned index = 0; index < tx_json[jss::Signers].size(); index++)
|
||||
for (unsigned index = 0; index < sigObject[jss::Signers].size();
|
||||
index++)
|
||||
{
|
||||
auto& signer = tx_json[jss::Signers][index];
|
||||
auto& signer = sigObject[jss::Signers][index];
|
||||
if (!signer.isObject() || !signer.isMember(jss::Signer) ||
|
||||
!signer[jss::Signer].isObject())
|
||||
return RPC::invalid_field_error(
|
||||
@@ -129,16 +113,41 @@ autofillTx(Json::Value& tx_json, RPC::JsonContext& context)
|
||||
}
|
||||
}
|
||||
|
||||
if (!tx_json.isMember(jss::TxnSignature))
|
||||
if (!sigObject.isMember(jss::TxnSignature))
|
||||
{
|
||||
// autofill TxnSignature
|
||||
tx_json[jss::TxnSignature] = "";
|
||||
sigObject[jss::TxnSignature] = "";
|
||||
}
|
||||
else if (tx_json[jss::TxnSignature] != "")
|
||||
else if (sigObject[jss::TxnSignature] != "")
|
||||
{
|
||||
// Transaction must not be signed
|
||||
return rpcError(rpcTX_SIGNED);
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
static std::optional<Json::Value>
|
||||
autofillTx(Json::Value& tx_json, RPC::JsonContext& context)
|
||||
{
|
||||
if (!tx_json.isMember(jss::Fee))
|
||||
{
|
||||
// autofill Fee
|
||||
// Must happen after all the other autofills happen
|
||||
// Error handling/messaging works better that way
|
||||
auto feeOrError = RPC::getCurrentNetworkFee(
|
||||
context.role,
|
||||
context.app.config(),
|
||||
context.app.getFeeTrack(),
|
||||
context.app.getTxQ(),
|
||||
context.app,
|
||||
tx_json);
|
||||
if (feeOrError.isMember(jss::error))
|
||||
return feeOrError;
|
||||
tx_json[jss::Fee] = feeOrError;
|
||||
}
|
||||
|
||||
if (auto error = autofillSignature(tx_json))
|
||||
return *error;
|
||||
|
||||
if (!tx_json.isMember(jss::Sequence))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user