mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 11:15:56 +00:00
Compare commits
10 Commits
9546c52013
...
945c362559
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
945c362559 | ||
|
|
8ac8a47c99 | ||
|
|
12c4b5a632 | ||
|
|
25c5e3b17f | ||
|
|
8eb233c2ea | ||
|
|
50fc93f742 | ||
|
|
ab45a8a737 | ||
|
|
dfafb141cc | ||
|
|
4e32d2ed98 | ||
|
|
fa69918124 |
@@ -17,7 +17,7 @@ Loop: xrpld.app xrpld.rpc
|
|||||||
xrpld.rpc > xrpld.app
|
xrpld.rpc > xrpld.app
|
||||||
|
|
||||||
Loop: xrpld.app xrpld.shamap
|
Loop: xrpld.app xrpld.shamap
|
||||||
xrpld.app > xrpld.shamap
|
xrpld.shamap ~= xrpld.app
|
||||||
|
|
||||||
Loop: xrpld.core xrpld.perflog
|
Loop: xrpld.core xrpld.perflog
|
||||||
xrpld.perflog == xrpld.core
|
xrpld.perflog == xrpld.core
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ libxrpl.ledger > xrpl.ledger
|
|||||||
libxrpl.ledger > xrpl.protocol
|
libxrpl.ledger > xrpl.protocol
|
||||||
libxrpl.net > xrpl.basics
|
libxrpl.net > xrpl.basics
|
||||||
libxrpl.net > xrpl.net
|
libxrpl.net > xrpl.net
|
||||||
|
libxrpl.nodestore > xrpl.basics
|
||||||
|
libxrpl.nodestore > xrpl.json
|
||||||
|
libxrpl.nodestore > xrpl.nodestore
|
||||||
|
libxrpl.nodestore > xrpl.protocol
|
||||||
libxrpl.protocol > xrpl.basics
|
libxrpl.protocol > xrpl.basics
|
||||||
libxrpl.protocol > xrpl.json
|
libxrpl.protocol > xrpl.json
|
||||||
libxrpl.protocol > xrpl.protocol
|
libxrpl.protocol > xrpl.protocol
|
||||||
@@ -18,6 +22,9 @@ libxrpl.server > xrpl.basics
|
|||||||
libxrpl.server > xrpl.json
|
libxrpl.server > xrpl.json
|
||||||
libxrpl.server > xrpl.protocol
|
libxrpl.server > xrpl.protocol
|
||||||
libxrpl.server > xrpl.server
|
libxrpl.server > xrpl.server
|
||||||
|
libxrpl.shamap > xrpl.basics
|
||||||
|
libxrpl.shamap > xrpl.protocol
|
||||||
|
libxrpl.shamap > xrpl.shamap
|
||||||
test.app > test.jtx
|
test.app > test.jtx
|
||||||
test.app > test.rpc
|
test.app > test.rpc
|
||||||
test.app > test.toplevel
|
test.app > test.toplevel
|
||||||
@@ -25,11 +32,11 @@ test.app > test.unit_test
|
|||||||
test.app > xrpl.basics
|
test.app > xrpl.basics
|
||||||
test.app > xrpld.app
|
test.app > xrpld.app
|
||||||
test.app > xrpld.core
|
test.app > xrpld.core
|
||||||
test.app > xrpld.nodestore
|
|
||||||
test.app > xrpld.overlay
|
test.app > xrpld.overlay
|
||||||
test.app > xrpld.rpc
|
test.app > xrpld.rpc
|
||||||
test.app > xrpl.json
|
test.app > xrpl.json
|
||||||
test.app > xrpl.ledger
|
test.app > xrpl.ledger
|
||||||
|
test.app > xrpl.nodestore
|
||||||
test.app > xrpl.protocol
|
test.app > xrpl.protocol
|
||||||
test.app > xrpl.resource
|
test.app > xrpl.resource
|
||||||
test.basics > test.jtx
|
test.basics > test.jtx
|
||||||
@@ -86,8 +93,7 @@ test.nodestore > test.toplevel
|
|||||||
test.nodestore > test.unit_test
|
test.nodestore > test.unit_test
|
||||||
test.nodestore > xrpl.basics
|
test.nodestore > xrpl.basics
|
||||||
test.nodestore > xrpld.core
|
test.nodestore > xrpld.core
|
||||||
test.nodestore > xrpld.nodestore
|
test.nodestore > xrpl.nodestore
|
||||||
test.nodestore > xrpld.unity
|
|
||||||
test.overlay > test.jtx
|
test.overlay > test.jtx
|
||||||
test.overlay > test.toplevel
|
test.overlay > test.toplevel
|
||||||
test.overlay > test.unit_test
|
test.overlay > test.unit_test
|
||||||
@@ -95,8 +101,8 @@ test.overlay > xrpl.basics
|
|||||||
test.overlay > xrpld.app
|
test.overlay > xrpld.app
|
||||||
test.overlay > xrpld.overlay
|
test.overlay > xrpld.overlay
|
||||||
test.overlay > xrpld.peerfinder
|
test.overlay > xrpld.peerfinder
|
||||||
test.overlay > xrpld.shamap
|
|
||||||
test.overlay > xrpl.protocol
|
test.overlay > xrpl.protocol
|
||||||
|
test.overlay > xrpl.shamap
|
||||||
test.peerfinder > test.beast
|
test.peerfinder > test.beast
|
||||||
test.peerfinder > test.unit_test
|
test.peerfinder > test.unit_test
|
||||||
test.peerfinder > xrpl.basics
|
test.peerfinder > xrpl.basics
|
||||||
@@ -131,9 +137,9 @@ test.server > xrpl.json
|
|||||||
test.server > xrpl.server
|
test.server > xrpl.server
|
||||||
test.shamap > test.unit_test
|
test.shamap > test.unit_test
|
||||||
test.shamap > xrpl.basics
|
test.shamap > xrpl.basics
|
||||||
test.shamap > xrpld.nodestore
|
test.shamap > xrpl.nodestore
|
||||||
test.shamap > xrpld.shamap
|
|
||||||
test.shamap > xrpl.protocol
|
test.shamap > xrpl.protocol
|
||||||
|
test.shamap > xrpl.shamap
|
||||||
test.toplevel > test.csf
|
test.toplevel > test.csf
|
||||||
test.toplevel > xrpl.json
|
test.toplevel > xrpl.json
|
||||||
test.unit_test > xrpl.basics
|
test.unit_test > xrpl.basics
|
||||||
@@ -144,6 +150,8 @@ xrpl.json > xrpl.basics
|
|||||||
xrpl.ledger > xrpl.basics
|
xrpl.ledger > xrpl.basics
|
||||||
xrpl.ledger > xrpl.protocol
|
xrpl.ledger > xrpl.protocol
|
||||||
xrpl.net > xrpl.basics
|
xrpl.net > xrpl.basics
|
||||||
|
xrpl.nodestore > xrpl.basics
|
||||||
|
xrpl.nodestore > xrpl.protocol
|
||||||
xrpl.protocol > xrpl.basics
|
xrpl.protocol > xrpl.basics
|
||||||
xrpl.protocol > xrpl.json
|
xrpl.protocol > xrpl.json
|
||||||
xrpl.resource > xrpl.basics
|
xrpl.resource > xrpl.basics
|
||||||
@@ -152,17 +160,21 @@ xrpl.resource > xrpl.protocol
|
|||||||
xrpl.server > xrpl.basics
|
xrpl.server > xrpl.basics
|
||||||
xrpl.server > xrpl.json
|
xrpl.server > xrpl.json
|
||||||
xrpl.server > xrpl.protocol
|
xrpl.server > xrpl.protocol
|
||||||
|
xrpl.shamap > xrpl.basics
|
||||||
|
xrpl.shamap > xrpl.nodestore
|
||||||
|
xrpl.shamap > xrpl.protocol
|
||||||
xrpld.app > test.unit_test
|
xrpld.app > test.unit_test
|
||||||
xrpld.app > xrpl.basics
|
xrpld.app > xrpl.basics
|
||||||
xrpld.app > xrpld.conditions
|
xrpld.app > xrpld.conditions
|
||||||
xrpld.app > xrpld.consensus
|
xrpld.app > xrpld.consensus
|
||||||
xrpld.app > xrpld.nodestore
|
|
||||||
xrpld.app > xrpld.perflog
|
xrpld.app > xrpld.perflog
|
||||||
xrpld.app > xrpl.json
|
xrpld.app > xrpl.json
|
||||||
xrpld.app > xrpl.ledger
|
xrpld.app > xrpl.ledger
|
||||||
xrpld.app > xrpl.net
|
xrpld.app > xrpl.net
|
||||||
|
xrpld.app > xrpl.nodestore
|
||||||
xrpld.app > xrpl.protocol
|
xrpld.app > xrpl.protocol
|
||||||
xrpld.app > xrpl.resource
|
xrpld.app > xrpl.resource
|
||||||
|
xrpld.app > xrpl.shamap
|
||||||
xrpld.conditions > xrpl.basics
|
xrpld.conditions > xrpl.basics
|
||||||
xrpld.conditions > xrpl.protocol
|
xrpld.conditions > xrpl.protocol
|
||||||
xrpld.consensus > xrpl.basics
|
xrpld.consensus > xrpl.basics
|
||||||
@@ -172,11 +184,6 @@ xrpld.core > xrpl.basics
|
|||||||
xrpld.core > xrpl.json
|
xrpld.core > xrpl.json
|
||||||
xrpld.core > xrpl.net
|
xrpld.core > xrpl.net
|
||||||
xrpld.core > xrpl.protocol
|
xrpld.core > xrpl.protocol
|
||||||
xrpld.nodestore > xrpl.basics
|
|
||||||
xrpld.nodestore > xrpld.core
|
|
||||||
xrpld.nodestore > xrpld.unity
|
|
||||||
xrpld.nodestore > xrpl.json
|
|
||||||
xrpld.nodestore > xrpl.protocol
|
|
||||||
xrpld.overlay > xrpl.basics
|
xrpld.overlay > xrpl.basics
|
||||||
xrpld.overlay > xrpld.core
|
xrpld.overlay > xrpld.core
|
||||||
xrpld.overlay > xrpld.peerfinder
|
xrpld.overlay > xrpld.peerfinder
|
||||||
@@ -192,13 +199,11 @@ xrpld.perflog > xrpl.basics
|
|||||||
xrpld.perflog > xrpl.json
|
xrpld.perflog > xrpl.json
|
||||||
xrpld.rpc > xrpl.basics
|
xrpld.rpc > xrpl.basics
|
||||||
xrpld.rpc > xrpld.core
|
xrpld.rpc > xrpld.core
|
||||||
xrpld.rpc > xrpld.nodestore
|
|
||||||
xrpld.rpc > xrpl.json
|
xrpld.rpc > xrpl.json
|
||||||
xrpld.rpc > xrpl.ledger
|
xrpld.rpc > xrpl.ledger
|
||||||
xrpld.rpc > xrpl.net
|
xrpld.rpc > xrpl.net
|
||||||
|
xrpld.rpc > xrpl.nodestore
|
||||||
xrpld.rpc > xrpl.protocol
|
xrpld.rpc > xrpl.protocol
|
||||||
xrpld.rpc > xrpl.resource
|
xrpld.rpc > xrpl.resource
|
||||||
xrpld.rpc > xrpl.server
|
xrpld.rpc > xrpl.server
|
||||||
xrpld.shamap > xrpl.basics
|
xrpld.shamap > xrpl.shamap
|
||||||
xrpld.shamap > xrpld.nodestore
|
|
||||||
xrpld.shamap > xrpl.protocol
|
|
||||||
|
|||||||
48
.github/scripts/strategy-matrix/linux.json
vendored
48
.github/scripts/strategy-matrix/linux.json
vendored
@@ -15,168 +15,168 @@
|
|||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12",
|
"compiler_version": "12",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13",
|
"compiler_version": "13",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "15",
|
"compiler_version": "15",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "16",
|
"compiler_version": "16",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "17",
|
"compiler_version": "17",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "18",
|
"compiler_version": "18",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "19",
|
"compiler_version": "19",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "20",
|
"compiler_version": "20",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "8",
|
"distro_version": "8",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "8",
|
"distro_version": "8",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any",
|
"compiler_version": "any",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12",
|
"compiler_version": "12",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13",
|
"compiler_version": "13",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9",
|
"distro_version": "9",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any",
|
"compiler_version": "any",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "10",
|
"distro_version": "10",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "10",
|
"distro_version": "10",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any",
|
"compiler_version": "any",
|
||||||
"image_sha": "10e69b4"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "jammy",
|
"distro_version": "jammy",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12",
|
"compiler_version": "12",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13",
|
"compiler_version": "13",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14",
|
"compiler_version": "14",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "16",
|
"compiler_version": "16",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "17",
|
"compiler_version": "17",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "18",
|
"compiler_version": "18",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "19",
|
"compiler_version": "19",
|
||||||
"image_sha": "6948666"
|
"image_sha": "97ba375"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build_type": ["Debug", "Release"],
|
"build_type": ["Debug", "Release"],
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ if (static OR APPLE OR MSVC)
|
|||||||
set (OPENSSL_USE_STATIC_LIBS ON)
|
set (OPENSSL_USE_STATIC_LIBS ON)
|
||||||
endif ()
|
endif ()
|
||||||
set (OPENSSL_MSVC_STATIC_RT ON)
|
set (OPENSSL_MSVC_STATIC_RT ON)
|
||||||
find_dependency (OpenSSL 1.1.1 REQUIRED)
|
find_dependency (OpenSSL REQUIRED)
|
||||||
find_dependency (ZLIB)
|
find_dependency (ZLIB)
|
||||||
find_dependency (date)
|
find_dependency (date)
|
||||||
if (TARGET ZLIB::ZLIB)
|
if (TARGET ZLIB::ZLIB)
|
||||||
|
|||||||
@@ -53,14 +53,15 @@ add_library(xrpl.imports.main INTERFACE)
|
|||||||
|
|
||||||
target_link_libraries(xrpl.imports.main
|
target_link_libraries(xrpl.imports.main
|
||||||
INTERFACE
|
INTERFACE
|
||||||
LibArchive::LibArchive
|
|
||||||
OpenSSL::Crypto
|
|
||||||
Ripple::boost
|
|
||||||
Ripple::opts
|
|
||||||
Ripple::syslibs
|
|
||||||
absl::random_random
|
absl::random_random
|
||||||
date::date
|
date::date
|
||||||
ed25519::ed25519
|
ed25519::ed25519
|
||||||
|
LibArchive::LibArchive
|
||||||
|
OpenSSL::Crypto
|
||||||
|
Ripple::boost
|
||||||
|
Ripple::libs
|
||||||
|
Ripple::opts
|
||||||
|
Ripple::syslibs
|
||||||
secp256k1::secp256k1
|
secp256k1::secp256k1
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
xxHash::xxhash
|
xxHash::xxhash
|
||||||
@@ -111,6 +112,21 @@ target_link_libraries(xrpl.libxrpl.net PUBLIC
|
|||||||
add_module(xrpl server)
|
add_module(xrpl server)
|
||||||
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol)
|
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol)
|
||||||
|
|
||||||
|
add_module(xrpl nodestore)
|
||||||
|
target_link_libraries(xrpl.libxrpl.nodestore PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.json
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
)
|
||||||
|
|
||||||
|
add_module(xrpl shamap)
|
||||||
|
target_link_libraries(xrpl.libxrpl.shamap PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.crypto
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
xrpl.libxrpl.nodestore
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl ledger)
|
add_module(xrpl ledger)
|
||||||
target_link_libraries(xrpl.libxrpl.ledger PUBLIC
|
target_link_libraries(xrpl.libxrpl.ledger PUBLIC
|
||||||
xrpl.libxrpl.basics
|
xrpl.libxrpl.basics
|
||||||
@@ -136,6 +152,8 @@ target_link_modules(xrpl PUBLIC
|
|||||||
protocol
|
protocol
|
||||||
resource
|
resource
|
||||||
server
|
server
|
||||||
|
nodestore
|
||||||
|
shamap
|
||||||
net
|
net
|
||||||
ledger
|
ledger
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,20 +8,23 @@ install (
|
|||||||
TARGETS
|
TARGETS
|
||||||
common
|
common
|
||||||
opts
|
opts
|
||||||
ripple_syslibs
|
|
||||||
ripple_boost
|
ripple_boost
|
||||||
|
ripple_libs
|
||||||
|
ripple_syslibs
|
||||||
xrpl.imports.main
|
xrpl.imports.main
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
|
xrpl.libxrpl
|
||||||
xrpl.libxrpl.basics
|
xrpl.libxrpl.basics
|
||||||
xrpl.libxrpl.beast
|
xrpl.libxrpl.beast
|
||||||
xrpl.libxrpl.crypto
|
xrpl.libxrpl.crypto
|
||||||
xrpl.libxrpl.json
|
xrpl.libxrpl.json
|
||||||
|
xrpl.libxrpl.ledger
|
||||||
|
xrpl.libxrpl.net
|
||||||
|
xrpl.libxrpl.nodestore
|
||||||
xrpl.libxrpl.protocol
|
xrpl.libxrpl.protocol
|
||||||
xrpl.libxrpl.resource
|
xrpl.libxrpl.resource
|
||||||
xrpl.libxrpl.ledger
|
|
||||||
xrpl.libxrpl.server
|
xrpl.libxrpl.server
|
||||||
xrpl.libxrpl.net
|
xrpl.libxrpl.shamap
|
||||||
xrpl.libxrpl
|
|
||||||
antithesis-sdk-cpp
|
antithesis-sdk-cpp
|
||||||
EXPORT RippleExports
|
EXPORT RippleExports
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
|
#define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Types.h>
|
#include <xrpl/nodestore/Types.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@@ -20,13 +20,12 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_DATABASE_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_DATABASE_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_DATABASE_H_INCLUDED
|
#define RIPPLE_NODESTORE_DATABASE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Backend.h>
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
|
||||||
#include <xrpld/nodestore/Scheduler.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/BasicConfig.h>
|
#include <xrpl/basics/BasicConfig.h>
|
||||||
#include <xrpl/basics/Log.h>
|
#include <xrpl/basics/Log.h>
|
||||||
#include <xrpl/basics/TaggedCache.ipp>
|
#include <xrpl/basics/TaggedCache.ipp>
|
||||||
|
#include <xrpl/nodestore/Backend.h>
|
||||||
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
#include <xrpl/nodestore/Scheduler.h>
|
||||||
#include <xrpl/protocol/SystemParameters.h>
|
#include <xrpl/protocol/SystemParameters.h>
|
||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
|
#define RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Database.h>
|
#include <xrpl/nodestore/Database.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
|
#define RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Scheduler.h>
|
#include <xrpl/nodestore/Scheduler.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -20,11 +20,10 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_FACTORY_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_FACTORY_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_FACTORY_H_INCLUDED
|
#define RIPPLE_NODESTORE_FACTORY_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Backend.h>
|
|
||||||
#include <xrpld/nodestore/Scheduler.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/BasicConfig.h>
|
#include <xrpl/basics/BasicConfig.h>
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
|
#include <xrpl/nodestore/Backend.h>
|
||||||
|
#include <xrpl/nodestore/Scheduler.h>
|
||||||
|
|
||||||
#include <nudb/store.hpp>
|
#include <nudb/store.hpp>
|
||||||
|
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_MANAGER_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_MANAGER_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_MANAGER_H_INCLUDED
|
#define RIPPLE_NODESTORE_MANAGER_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/DatabaseRotating.h>
|
#include <xrpl/nodestore/DatabaseRotating.h>
|
||||||
#include <xrpld/nodestore/Factory.h>
|
#include <xrpl/nodestore/Factory.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
|
#define RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Task.h>
|
#include <xrpl/nodestore/Task.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_TYPES_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_TYPES_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_TYPES_H_INCLUDED
|
#define RIPPLE_NODESTORE_TYPES_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
|
#define RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Scheduler.h>
|
#include <xrpl/nodestore/Scheduler.h>
|
||||||
#include <xrpld/nodestore/Task.h>
|
#include <xrpl/nodestore/Task.h>
|
||||||
#include <xrpld/nodestore/Types.h>
|
#include <xrpl/nodestore/Types.h>
|
||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
@@ -20,10 +20,9 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
|
#define RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/TaggedCache.h>
|
#include <xrpl/basics/TaggedCache.h>
|
||||||
#include <xrpl/basics/chrono.h>
|
#include <xrpl/basics/chrono.h>
|
||||||
|
#include <xrpl/nodestore/Database.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
|
#define RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/DatabaseRotating.h>
|
#include <xrpl/nodestore/DatabaseRotating.h>
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
|
#define RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -20,9 +20,8 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
|
#define RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
|
||||||
|
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
|
||||||
#include <boost/align/align_up.hpp>
|
#include <boost/align/align_up.hpp>
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
|
#define RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
static void
|
static void
|
||||||
missing_backend();
|
missing_backend();
|
||||||
|
|
||||||
ManagerImp() = default;
|
ManagerImp();
|
||||||
|
|
||||||
~ManagerImp() = default;
|
~ManagerImp() = default;
|
||||||
|
|
||||||
@@ -23,11 +23,10 @@
|
|||||||
// Disable lz4 deprecation warning due to incompatibility with clang attributes
|
// Disable lz4 deprecation warning due to incompatibility with clang attributes
|
||||||
#define LZ4_DISABLE_DEPRECATE_WARNINGS
|
#define LZ4_DISABLE_DEPRECATE_WARNINGS
|
||||||
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
|
||||||
#include <xrpld/nodestore/detail/varint.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
#include <xrpl/nodestore/detail/varint.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
|
|
||||||
#include <nudb/detail/field.hpp>
|
#include <nudb/detail/field.hpp>
|
||||||
@@ -73,14 +73,8 @@ static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ{32570u};
|
|||||||
* used in asserts and tests. */
|
* used in asserts and tests. */
|
||||||
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES{562177u};
|
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES{562177u};
|
||||||
|
|
||||||
/** The minimum amount of support an amendment should have.
|
/** The minimum amount of support an amendment should have. */
|
||||||
|
constexpr std::ratio<80, 100> amendmentMajorityCalcThreshold;
|
||||||
@note This value is used by legacy code and will become obsolete
|
|
||||||
once the fixAmendmentMajorityCalc amendment activates.
|
|
||||||
*/
|
|
||||||
constexpr std::ratio<204, 256> preFixAmendmentMajorityCalcThreshold;
|
|
||||||
|
|
||||||
constexpr std::ratio<80, 100> postFixAmendmentMajorityCalcThreshold;
|
|
||||||
|
|
||||||
/** The minimum amount of time an amendment must hold a majority */
|
/** The minimum amount of time an amendment must hold a majority */
|
||||||
constexpr std::chrono::seconds const defaultAmendmentMajorityTime = weeks{2};
|
constexpr std::chrono::seconds const defaultAmendmentMajorityTime = weeks{2};
|
||||||
|
|||||||
@@ -225,8 +225,9 @@ enum TERcodes : TERUnderlyingType {
|
|||||||
terQUEUED, // Transaction is being held in TxQ until fee drops
|
terQUEUED, // Transaction is being held in TxQ until fee drops
|
||||||
terPRE_TICKET, // Ticket is not yet in ledger but might be on its way
|
terPRE_TICKET, // Ticket is not yet in ledger but might be on its way
|
||||||
terNO_AMM, // AMM doesn't exist for the asset pair
|
terNO_AMM, // AMM doesn't exist for the asset pair
|
||||||
terADDRESS_COLLISION, // Failed to allocate AccountID when trying to
|
terADDRESS_COLLISION, // Failed to allocate AccountID when trying to
|
||||||
// create a pseudo-account
|
// create a pseudo-account
|
||||||
|
terNO_DELEGATE_PERMISSION, // Delegate does not have permission
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -361,6 +362,9 @@ enum TECcodes : TERUnderlyingType {
|
|||||||
tecLIMIT_EXCEEDED = 195,
|
tecLIMIT_EXCEEDED = 195,
|
||||||
tecPSEUDO_ACCOUNT = 196,
|
tecPSEUDO_ACCOUNT = 196,
|
||||||
tecPRECISION_LOSS = 197,
|
tecPRECISION_LOSS = 197,
|
||||||
|
// DEPRECATED: This error code tecNO_DELEGATE_PERMISSION is reserved for
|
||||||
|
// backward compatibility with historical data on non-prod networks, can be
|
||||||
|
// reclaimed after those networks reset.
|
||||||
tecNO_DELEGATE_PERMISSION = 198,
|
tecNO_DELEGATE_PERMISSION = 198,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,51 +33,35 @@ namespace ripple {
|
|||||||
|
|
||||||
class TxMeta
|
class TxMeta
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
struct CtorHelper
|
|
||||||
{
|
|
||||||
explicit CtorHelper() = default;
|
|
||||||
};
|
|
||||||
template <class T>
|
|
||||||
TxMeta(
|
|
||||||
uint256 const& txID,
|
|
||||||
std::uint32_t ledger,
|
|
||||||
T const& data,
|
|
||||||
CtorHelper);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TxMeta(
|
TxMeta(uint256 const& transactionID, std::uint32_t ledger);
|
||||||
uint256 const& transactionID,
|
|
||||||
std::uint32_t ledger,
|
|
||||||
std::optional<uint256> parentBatchId = std::nullopt);
|
|
||||||
TxMeta(uint256 const& txID, std::uint32_t ledger, Blob const&);
|
TxMeta(uint256 const& txID, std::uint32_t ledger, Blob const&);
|
||||||
TxMeta(uint256 const& txID, std::uint32_t ledger, std::string const&);
|
|
||||||
TxMeta(uint256 const& txID, std::uint32_t ledger, STObject const&);
|
TxMeta(uint256 const& txID, std::uint32_t ledger, STObject const&);
|
||||||
|
|
||||||
uint256 const&
|
uint256 const&
|
||||||
getTxID() const
|
getTxID() const
|
||||||
{
|
{
|
||||||
return mTransactionID;
|
return transactionID_;
|
||||||
}
|
}
|
||||||
std::uint32_t
|
std::uint32_t
|
||||||
getLgrSeq() const
|
getLgrSeq() const
|
||||||
{
|
{
|
||||||
return mLedger;
|
return ledgerSeq_;
|
||||||
}
|
}
|
||||||
int
|
int
|
||||||
getResult() const
|
getResult() const
|
||||||
{
|
{
|
||||||
return mResult;
|
return result_;
|
||||||
}
|
}
|
||||||
TER
|
TER
|
||||||
getResultTER() const
|
getResultTER() const
|
||||||
{
|
{
|
||||||
return TER::fromInt(mResult);
|
return TER::fromInt(result_);
|
||||||
}
|
}
|
||||||
std::uint32_t
|
std::uint32_t
|
||||||
getIndex() const
|
getIndex() const
|
||||||
{
|
{
|
||||||
return mIndex;
|
return index_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -104,66 +88,52 @@ public:
|
|||||||
STArray&
|
STArray&
|
||||||
getNodes()
|
getNodes()
|
||||||
{
|
{
|
||||||
return (mNodes);
|
return nodes_;
|
||||||
}
|
}
|
||||||
STArray const&
|
STArray const&
|
||||||
getNodes() const
|
getNodes() const
|
||||||
{
|
{
|
||||||
return (mNodes);
|
return nodes_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setDeliveredAmount(STAmount const& delivered)
|
setAdditionalFields(STObject const& obj)
|
||||||
{
|
{
|
||||||
mDelivered = delivered;
|
if (obj.isFieldPresent(sfDeliveredAmount))
|
||||||
|
deliveredAmount_ = obj.getFieldAmount(sfDeliveredAmount);
|
||||||
|
|
||||||
|
if (obj.isFieldPresent(sfParentBatchID))
|
||||||
|
parentBatchID_ = obj.getFieldH256(sfParentBatchID);
|
||||||
}
|
}
|
||||||
|
|
||||||
STAmount
|
std::optional<STAmount> const&
|
||||||
getDeliveredAmount() const
|
getDeliveredAmount() const
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
return deliveredAmount_;
|
||||||
hasDeliveredAmount(),
|
|
||||||
"ripple::TxMeta::getDeliveredAmount : non-null delivered amount");
|
|
||||||
return *mDelivered;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
hasDeliveredAmount() const
|
|
||||||
{
|
|
||||||
return static_cast<bool>(mDelivered);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setParentBatchId(uint256 const& parentBatchId)
|
setDeliveredAmount(std::optional<STAmount> const& amount)
|
||||||
{
|
{
|
||||||
mParentBatchId = parentBatchId;
|
deliveredAmount_ = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint256
|
void
|
||||||
getParentBatchId() const
|
setParentBatchID(std::optional<uint256> const& id)
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
parentBatchID_ = id;
|
||||||
hasParentBatchId(),
|
|
||||||
"ripple::TxMeta::getParentBatchId : non-null batch id");
|
|
||||||
return *mParentBatchId;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
hasParentBatchId() const
|
|
||||||
{
|
|
||||||
return static_cast<bool>(mParentBatchId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint256 mTransactionID;
|
uint256 transactionID_;
|
||||||
std::uint32_t mLedger;
|
std::uint32_t ledgerSeq_;
|
||||||
std::uint32_t mIndex;
|
std::uint32_t index_;
|
||||||
int mResult;
|
int result_;
|
||||||
|
|
||||||
std::optional<STAmount> mDelivered;
|
std::optional<STAmount> deliveredAmount_;
|
||||||
std::optional<uint256> mParentBatchId;
|
std::optional<uint256> parentBatchID_;
|
||||||
|
|
||||||
STArray mNodes;
|
STArray nodes_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
|
|||||||
@@ -30,11 +30,11 @@
|
|||||||
// Add new amendments to the top of this list.
|
// Add new amendments to the top of this list.
|
||||||
// Keep it sorted in reverse chronological order.
|
// Keep it sorted in reverse chronological order.
|
||||||
|
|
||||||
|
XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (IncludeKeyletFields, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (IncludeKeyletFields, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(DynamicMPT, Supported::no, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(DynamicMPT, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (TokenEscrowV1, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (TokenEscrowV1, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (DelegateV1_1, Supported::no, VoteBehavior::DefaultNo)
|
|
||||||
XRPL_FIX (PriceOracleOrder, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (PriceOracleOrder, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (MPTDeliveredAmount, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (MPTDeliveredAmount, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (AMMClawbackRounding, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (AMMClawbackRounding, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
@@ -44,7 +44,6 @@ XRPL_FIX (AMMv1_3, Supported::yes, VoteBehavior::DefaultNo
|
|||||||
XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(PermissionDelegation, Supported::no, VoteBehavior::DefaultNo)
|
|
||||||
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
// Check flags in Credential transactions
|
// Check flags in Credential transactions
|
||||||
XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
@@ -78,13 +77,11 @@ XRPL_FIX (DisallowIncomingV1, Supported::yes, VoteBehavior::DefaultNo
|
|||||||
XRPL_FEATURE(XChainBridge, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(XChainBridge, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (ReducedOffersV1, Supported::yes, VoteBehavior::DefaultNo)
|
|
||||||
XRPL_FIX (NFTokenRemint, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (NFTokenRemint, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (NonFungibleTokensV1_2, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (NonFungibleTokensV1_2, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(ImmediateOfferKilled, Supported::yes, VoteBehavior::DefaultNo)
|
|
||||||
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (TrustLinesToSelf, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (TrustLinesToSelf, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(NonFungibleTokensV1_1, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(NonFungibleTokensV1_1, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
@@ -93,12 +90,10 @@ XRPL_FEATURE(CheckCashMakesTrustLine, Supported::yes, VoteBehavior::DefaultNo
|
|||||||
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(TicketBatch, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(TicketBatch, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(NegativeUNL, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(NegativeUNL, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (AmendmentMajorityCalc, Supported::yes, VoteBehavior::DefaultYes)
|
|
||||||
XRPL_FEATURE(HardenedValidations, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(HardenedValidations, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (PayChanRecipientOwnerDir, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FIX (PayChanRecipientOwnerDir, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (MasterKeyAsRegularKey, Supported::yes, VoteBehavior::DefaultYes)
|
|
||||||
XRPL_FEATURE(MultiSignReserve, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(MultiSignReserve, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(DepositPreauth, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(DepositPreauth, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
@@ -140,8 +135,11 @@ XRPL_RETIRE(fix1571)
|
|||||||
XRPL_RETIRE(fix1578)
|
XRPL_RETIRE(fix1578)
|
||||||
XRPL_RETIRE(fix1623)
|
XRPL_RETIRE(fix1623)
|
||||||
XRPL_RETIRE(fix1781)
|
XRPL_RETIRE(fix1781)
|
||||||
|
XRPL_RETIRE(fixAmendmentMajorityCalc)
|
||||||
XRPL_RETIRE(fixCheckThreading)
|
XRPL_RETIRE(fixCheckThreading)
|
||||||
|
XRPL_RETIRE(fixMasterKeyAsRegularKey)
|
||||||
XRPL_RETIRE(fixQualityUpperBound)
|
XRPL_RETIRE(fixQualityUpperBound)
|
||||||
|
XRPL_RETIRE(fixReducedOffersV1)
|
||||||
XRPL_RETIRE(fixRmSmallIncreasedQOffers)
|
XRPL_RETIRE(fixRmSmallIncreasedQOffers)
|
||||||
XRPL_RETIRE(fixSTAmountCanonicalize)
|
XRPL_RETIRE(fixSTAmountCanonicalize)
|
||||||
XRPL_RETIRE(fixTakerDryOfferRemoval)
|
XRPL_RETIRE(fixTakerDryOfferRemoval)
|
||||||
@@ -150,6 +148,7 @@ XRPL_RETIRE(Escrow)
|
|||||||
XRPL_RETIRE(EnforceInvariants)
|
XRPL_RETIRE(EnforceInvariants)
|
||||||
XRPL_RETIRE(FeeEscalation)
|
XRPL_RETIRE(FeeEscalation)
|
||||||
XRPL_RETIRE(FlowCross)
|
XRPL_RETIRE(FlowCross)
|
||||||
|
XRPL_RETIRE(ImmediateOfferKilled)
|
||||||
XRPL_RETIRE(MultiSign)
|
XRPL_RETIRE(MultiSign)
|
||||||
XRPL_RETIRE(PayChan)
|
XRPL_RETIRE(PayChan)
|
||||||
XRPL_RETIRE(SortedDirectories)
|
XRPL_RETIRE(SortedDirectories)
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ TRANSACTION(ttTRUST_SET, 20, TrustSet,
|
|||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
|
TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
|
||||||
Delegation::notDelegatable,
|
Delegation::notDelegatable,
|
||||||
uint256{},
|
featureDeletableAccounts,
|
||||||
mustDeleteAcct,
|
mustDeleteAcct,
|
||||||
({
|
({
|
||||||
{sfDestination, soeREQUIRED},
|
{sfDestination, soeREQUIRED},
|
||||||
@@ -837,7 +837,7 @@ TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete,
|
|||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttDELEGATE_SET, 64, DelegateSet,
|
TRANSACTION(ttDELEGATE_SET, 64, DelegateSet,
|
||||||
Delegation::notDelegatable,
|
Delegation::notDelegatable,
|
||||||
featurePermissionDelegation,
|
featurePermissionDelegationV1_1,
|
||||||
noPriv,
|
noPriv,
|
||||||
({
|
({
|
||||||
{sfAuthorize, soeREQUIRED},
|
{sfAuthorize, soeREQUIRED},
|
||||||
|
|||||||
@@ -20,11 +20,10 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_FAMILY_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_FAMILY_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_FAMILY_H_INCLUDED
|
#define RIPPLE_SHAMAP_FAMILY_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
#include <xrpld/shamap/FullBelowCache.h>
|
|
||||||
#include <xrpld/shamap/TreeNodeCache.h>
|
|
||||||
|
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
|
#include <xrpl/nodestore/Database.h>
|
||||||
|
#include <xrpl/shamap/FullBelowCache.h>
|
||||||
|
#include <xrpl/shamap/TreeNodeCache.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@@ -20,21 +20,19 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAP_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAP_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAP_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAP_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
|
||||||
#include <xrpld/shamap/Family.h>
|
|
||||||
#include <xrpld/shamap/SHAMapAddNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapInnerNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
|
||||||
#include <xrpld/shamap/SHAMapLeafNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapMissingNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
|
||||||
#include <xrpld/shamap/TreeNodeCache.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
#include <xrpl/basics/UnorderedContainers.h>
|
#include <xrpl/basics/UnorderedContainers.h>
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
|
#include <xrpl/nodestore/Database.h>
|
||||||
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
#include <xrpl/shamap/Family.h>
|
||||||
|
#include <xrpl/shamap/SHAMapAddNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapInnerNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
|
#include <xrpl/shamap/SHAMapLeafNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapMissingNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
@@ -20,12 +20,11 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPACCOUNTSTATELEAFNODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
|
||||||
#include <xrpld/shamap/SHAMapLeafNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/CountedObject.h>
|
#include <xrpl/basics/CountedObject.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
|
#include <xrpl/shamap/SHAMapLeafNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,10 +20,9 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPINNERNODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapNodeID.h>
|
|
||||||
#include <xrpld/shamap/detail/TaggedPointer.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
|
#include <xrpl/shamap/SHAMapNodeID.h>
|
||||||
|
#include <xrpl/shamap/detail/TaggedPointer.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPLEAFNODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@@ -20,9 +20,8 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/base_uint.h>
|
#include <xrpl/basics/base_uint.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPSYNCFILTER_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
@@ -20,13 +20,12 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPTREENODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
|
||||||
#include <xrpld/shamap/SHAMapNodeID.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
#include <xrpl/basics/IntrusiveRefCounts.h>
|
#include <xrpl/basics/IntrusiveRefCounts.h>
|
||||||
#include <xrpl/basics/SHAMapHash.h>
|
#include <xrpl/basics/SHAMapHash.h>
|
||||||
#include <xrpl/protocol/Serializer.h>
|
#include <xrpl/protocol/Serializer.h>
|
||||||
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
|
#include <xrpl/shamap/SHAMapNodeID.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -20,12 +20,11 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPTXLEAFNODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
|
||||||
#include <xrpld/shamap/SHAMapLeafNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/CountedObject.h>
|
#include <xrpl/basics/CountedObject.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
|
#include <xrpl/shamap/SHAMapLeafNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,12 +20,11 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED
|
#define RIPPLE_SHAMAP_SHAMAPLEAFTXPLUSMETANODE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
|
||||||
#include <xrpld/shamap/SHAMapLeafNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/CountedObject.h>
|
#include <xrpl/basics/CountedObject.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
|
#include <xrpl/shamap/SHAMapLeafNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,10 +20,9 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED
|
#define RIPPLE_SHAMAP_TREENODECACHE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
#include <xrpl/basics/TaggedCache.h>
|
#include <xrpl/basics/TaggedCache.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -20,9 +20,8 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_TAGGEDPOINTER_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_TAGGEDPOINTER_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_TAGGEDPOINTER_H_INCLUDED
|
#define RIPPLE_SHAMAP_TAGGEDPOINTER_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -17,10 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapInnerNode.h>
|
|
||||||
#include <xrpld/shamap/detail/TaggedPointer.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/ByteUtilities.h>
|
#include <xrpl/basics/ByteUtilities.h>
|
||||||
|
#include <xrpl/shamap/SHAMapInnerNode.h>
|
||||||
|
#include <xrpl/shamap/detail/TaggedPointer.h>
|
||||||
|
|
||||||
#include <boost/pool/pool_alloc.hpp>
|
#include <boost/pool/pool_alloc.hpp>
|
||||||
|
|
||||||
@@ -126,10 +126,10 @@ ApplyStateTable::apply(
|
|||||||
std::optional<TxMeta> metadata;
|
std::optional<TxMeta> metadata;
|
||||||
if (!to.open() || isDryRun)
|
if (!to.open() || isDryRun)
|
||||||
{
|
{
|
||||||
TxMeta meta(tx.getTransactionID(), to.seq(), parentBatchId);
|
TxMeta meta(tx.getTransactionID(), to.seq());
|
||||||
|
|
||||||
if (deliver)
|
meta.setDeliveredAmount(deliver);
|
||||||
meta.setDeliveredAmount(*deliver);
|
meta.setParentBatchID(parentBatchId);
|
||||||
|
|
||||||
Mods newMod;
|
Mods newMod;
|
||||||
for (auto& item : items_)
|
for (auto& item : items_)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/BatchWriter.h>
|
#include <xrpl/nodestore/detail/BatchWriter.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -17,11 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/chrono.h>
|
#include <xrpl/basics/chrono.h>
|
||||||
#include <xrpl/beast/core/CurrentThreadName.h>
|
#include <xrpl/beast/core/CurrentThreadName.h>
|
||||||
#include <xrpl/json/json_value.h>
|
#include <xrpl/json/json_value.h>
|
||||||
|
#include <xrpl/nodestore/Database.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/jss.h>
|
#include <xrpl/protocol/jss.h>
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/DatabaseNodeImp.h>
|
#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/DatabaseRotatingImp.h>
|
#include <xrpl/nodestore/detail/DatabaseRotatingImp.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -17,10 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/DecodedBlob.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
|
#include <xrpl/nodestore/detail/DecodedBlob.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/DummyScheduler.h>
|
#include <xrpl/nodestore/DummyScheduler.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/DatabaseNodeImp.h>
|
#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
|
||||||
#include <xrpld/nodestore/detail/ManagerImp.h>
|
#include <xrpl/nodestore/detail/ManagerImp.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
|
|
||||||
@@ -41,6 +41,27 @@ ManagerImp::missing_backend()
|
|||||||
"please see the rippled-example.cfg file!");
|
"please see the rippled-example.cfg file!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We shouldn't rely on global variables for lifetime management because their
|
||||||
|
// lifetime is not well-defined. ManagerImp may get destroyed before the Factory
|
||||||
|
// classes, and then, calling Manager::instance().erase() in the destructors of
|
||||||
|
// the Factory classes is an undefined behaviour.
|
||||||
|
void
|
||||||
|
registerNuDBFactory(Manager& manager);
|
||||||
|
void
|
||||||
|
registerRocksDBFactory(Manager& manager);
|
||||||
|
void
|
||||||
|
registerNullFactory(Manager& manager);
|
||||||
|
void
|
||||||
|
registerMemoryFactory(Manager& manager);
|
||||||
|
|
||||||
|
ManagerImp::ManagerImp()
|
||||||
|
{
|
||||||
|
registerNuDBFactory(*this);
|
||||||
|
registerRocksDBFactory(*this);
|
||||||
|
registerNullFactory(*this);
|
||||||
|
registerMemoryFactory(*this);
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<Backend>
|
std::unique_ptr<Backend>
|
||||||
ManagerImp::make_Backend(
|
ManagerImp::make_Backend(
|
||||||
Section const& parameters,
|
Section const& parameters,
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/NodeObject.h>
|
#include <xrpl/nodestore/NodeObject.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -17,10 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/Factory.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
#include <xrpl/nodestore/Factory.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
#include <boost/beast/core/string.hpp>
|
#include <boost/beast/core/string.hpp>
|
||||||
#include <boost/core/ignore_unused.hpp>
|
#include <boost/core/ignore_unused.hpp>
|
||||||
@@ -46,10 +45,10 @@ class MemoryFactory : public Factory
|
|||||||
private:
|
private:
|
||||||
std::mutex mutex_;
|
std::mutex mutex_;
|
||||||
std::map<std::string, MemoryDB, boost::beast::iless> map_;
|
std::map<std::string, MemoryDB, boost::beast::iless> map_;
|
||||||
|
Manager& manager_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MemoryFactory();
|
explicit MemoryFactory(Manager& manager);
|
||||||
~MemoryFactory() override;
|
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
getName() const override;
|
getName() const override;
|
||||||
@@ -75,7 +74,14 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static MemoryFactory memoryFactory;
|
MemoryFactory* memoryFactory = nullptr;
|
||||||
|
|
||||||
|
void
|
||||||
|
registerMemoryFactory(Manager& manager)
|
||||||
|
{
|
||||||
|
static MemoryFactory instance{manager};
|
||||||
|
memoryFactory = &instance;
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -112,9 +118,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
open(bool createIfMissing) override
|
open(bool) override
|
||||||
{
|
{
|
||||||
db_ = &memoryFactory.open(name_);
|
db_ = &memoryFactory->open(name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -219,14 +225,9 @@ public:
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
MemoryFactory::MemoryFactory()
|
MemoryFactory::MemoryFactory(Manager& manager) : manager_(manager)
|
||||||
{
|
{
|
||||||
Manager::instance().insert(*this);
|
manager_.insert(*this);
|
||||||
}
|
|
||||||
|
|
||||||
MemoryFactory::~MemoryFactory()
|
|
||||||
{
|
|
||||||
Manager::instance().erase(*this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
@@ -17,15 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/Factory.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
#include <xrpld/nodestore/detail/DecodedBlob.h>
|
|
||||||
#include <xrpld/nodestore/detail/EncodedBlob.h>
|
|
||||||
#include <xrpld/nodestore/detail/codec.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/beast/core/LexicalCast.h>
|
#include <xrpl/beast/core/LexicalCast.h>
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
|
#include <xrpl/nodestore/Factory.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
#include <xrpl/nodestore/detail/DecodedBlob.h>
|
||||||
|
#include <xrpl/nodestore/detail/EncodedBlob.h>
|
||||||
|
#include <xrpl/nodestore/detail/codec.h>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
@@ -427,15 +426,13 @@ private:
|
|||||||
|
|
||||||
class NuDBFactory : public Factory
|
class NuDBFactory : public Factory
|
||||||
{
|
{
|
||||||
public:
|
private:
|
||||||
NuDBFactory()
|
Manager& manager_;
|
||||||
{
|
|
||||||
Manager::instance().insert(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
~NuDBFactory() override
|
public:
|
||||||
|
explicit NuDBFactory(Manager& manager) : manager_(manager)
|
||||||
{
|
{
|
||||||
Manager::instance().erase(*this);
|
manager_.insert(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
@@ -470,7 +467,11 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static NuDBFactory nuDBFactory;
|
void
|
||||||
|
registerNuDBFactory(Manager& manager)
|
||||||
|
{
|
||||||
|
static NuDBFactory instance{manager};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace NodeStore
|
} // namespace NodeStore
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/Factory.h>
|
#include <xrpl/nodestore/Factory.h>
|
||||||
#include <xrpld/nodestore/Manager.h>
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -111,15 +111,13 @@ private:
|
|||||||
|
|
||||||
class NullFactory : public Factory
|
class NullFactory : public Factory
|
||||||
{
|
{
|
||||||
public:
|
private:
|
||||||
NullFactory()
|
Manager& manager_;
|
||||||
{
|
|
||||||
Manager::instance().insert(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
~NullFactory() override
|
public:
|
||||||
|
explicit NullFactory(Manager& manager) : manager_(manager)
|
||||||
{
|
{
|
||||||
Manager::instance().erase(*this);
|
manager_.insert(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
@@ -140,7 +138,11 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static NullFactory nullFactory;
|
void
|
||||||
|
registerNullFactory(Manager& manager)
|
||||||
|
{
|
||||||
|
static NullFactory instance{manager};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace NodeStore
|
} // namespace NodeStore
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
@@ -17,20 +17,18 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/unity/rocksdb.h>
|
#include <xrpl/basics/rocksdb.h>
|
||||||
|
|
||||||
#if RIPPLE_ROCKSDB_AVAILABLE
|
#if RIPPLE_ROCKSDB_AVAILABLE
|
||||||
#include <xrpld/core/Config.h> // VFALCO Bad dependency
|
|
||||||
#include <xrpld/nodestore/Factory.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
#include <xrpld/nodestore/detail/BatchWriter.h>
|
|
||||||
#include <xrpld/nodestore/detail/DecodedBlob.h>
|
|
||||||
#include <xrpld/nodestore/detail/EncodedBlob.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/ByteUtilities.h>
|
#include <xrpl/basics/ByteUtilities.h>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
#include <xrpl/beast/core/CurrentThreadName.h>
|
#include <xrpl/beast/core/CurrentThreadName.h>
|
||||||
|
#include <xrpl/nodestore/Factory.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
#include <xrpl/nodestore/detail/BatchWriter.h>
|
||||||
|
#include <xrpl/nodestore/detail/DecodedBlob.h>
|
||||||
|
#include <xrpl/nodestore/detail/EncodedBlob.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -461,17 +459,15 @@ public:
|
|||||||
|
|
||||||
class RocksDBFactory : public Factory
|
class RocksDBFactory : public Factory
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
Manager& manager_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RocksDBEnv m_env;
|
RocksDBEnv m_env;
|
||||||
|
|
||||||
RocksDBFactory()
|
RocksDBFactory(Manager& manager) : manager_(manager)
|
||||||
{
|
{
|
||||||
Manager::instance().insert(*this);
|
manager_.insert(*this);
|
||||||
}
|
|
||||||
|
|
||||||
~RocksDBFactory() override
|
|
||||||
{
|
|
||||||
Manager::instance().erase(*this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
@@ -493,7 +489,11 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static RocksDBFactory rocksDBFactory;
|
void
|
||||||
|
registerRocksDBFactory(Manager& manager)
|
||||||
|
{
|
||||||
|
static RocksDBFactory instance{manager};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace NodeStore
|
} // namespace NodeStore
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
@@ -174,21 +174,22 @@ Permission::isDelegatable(
|
|||||||
auto const txType = permissionToTxType(permissionValue);
|
auto const txType = permissionToTxType(permissionValue);
|
||||||
auto const it = delegatableTx_.find(txType);
|
auto const it = delegatableTx_.find(txType);
|
||||||
|
|
||||||
if (rules.enabled(fixDelegateV1_1))
|
if (it == delegatableTx_.end())
|
||||||
{
|
return false;
|
||||||
if (it == delegatableTx_.end())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto const feature = getTxFeature(txType);
|
auto const txFeaturesIt = txFeatureMap_.find(txType);
|
||||||
|
XRPL_ASSERT(
|
||||||
|
txFeaturesIt != txFeatureMap_.end(),
|
||||||
|
"ripple::Permissions::isDelegatable : tx exists in txFeatureMap_");
|
||||||
|
|
||||||
// fixDelegateV1_1: Delegation is only allowed if the required amendment
|
// Delegation is only allowed if the required amendment for the transaction
|
||||||
// for the transaction is enabled. For transactions that do not require
|
// is enabled. For transactions that do not require an amendment, delegation
|
||||||
// an amendment, delegation is always allowed.
|
// is always allowed.
|
||||||
if (feature && !rules.enabled(*feature))
|
if (txFeaturesIt->second != uint256{} &&
|
||||||
return false;
|
!rules.enabled(txFeaturesIt->second))
|
||||||
}
|
return false;
|
||||||
|
|
||||||
if (it != delegatableTx_.end() && it->second == Delegation::notDelegatable)
|
if (it->second == Delegation::notDelegatable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ transResults()
|
|||||||
MAKE_ERROR(tecLIMIT_EXCEEDED, "Limit exceeded."),
|
MAKE_ERROR(tecLIMIT_EXCEEDED, "Limit exceeded."),
|
||||||
MAKE_ERROR(tecPSEUDO_ACCOUNT, "This operation is not allowed against a pseudo-account."),
|
MAKE_ERROR(tecPSEUDO_ACCOUNT, "This operation is not allowed against a pseudo-account."),
|
||||||
MAKE_ERROR(tecPRECISION_LOSS, "The amounts used by the transaction cannot interact."),
|
MAKE_ERROR(tecPRECISION_LOSS, "The amounts used by the transaction cannot interact."),
|
||||||
MAKE_ERROR(tecNO_DELEGATE_PERMISSION, "Delegated account lacks permission to perform this transaction."),
|
|
||||||
|
|
||||||
MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
|
MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
|
||||||
MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
|
MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
|
||||||
@@ -235,6 +234,7 @@ transResults()
|
|||||||
MAKE_ERROR(terPRE_TICKET, "Ticket is not yet in ledger."),
|
MAKE_ERROR(terPRE_TICKET, "Ticket is not yet in ledger."),
|
||||||
MAKE_ERROR(terNO_AMM, "AMM doesn't exist for the asset pair."),
|
MAKE_ERROR(terNO_AMM, "AMM doesn't exist for the asset pair."),
|
||||||
MAKE_ERROR(terADDRESS_COLLISION, "Failed to allocate an unique account address."),
|
MAKE_ERROR(terADDRESS_COLLISION, "Failed to allocate an unique account address."),
|
||||||
|
MAKE_ERROR(terNO_DELEGATE_PERMISSION, "Delegated account lacks permission to perform this transaction."),
|
||||||
|
|
||||||
MAKE_ERROR(tesSUCCESS, "The transaction was applied. Only final in a validated ledger."),
|
MAKE_ERROR(tesSUCCESS, "The transaction was applied. Only final in a validated ledger."),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,35 +39,13 @@
|
|||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
template <class T>
|
|
||||||
TxMeta::TxMeta(
|
|
||||||
uint256 const& txid,
|
|
||||||
std::uint32_t ledger,
|
|
||||||
T const& data,
|
|
||||||
CtorHelper)
|
|
||||||
: mTransactionID(txid), mLedger(ledger), mNodes(sfAffectedNodes, 32)
|
|
||||||
{
|
|
||||||
SerialIter sit(makeSlice(data));
|
|
||||||
|
|
||||||
STObject obj(sit, sfMetadata);
|
|
||||||
mResult = obj.getFieldU8(sfTransactionResult);
|
|
||||||
mIndex = obj.getFieldU32(sfTransactionIndex);
|
|
||||||
mNodes = *dynamic_cast<STArray*>(&obj.getField(sfAffectedNodes));
|
|
||||||
|
|
||||||
if (obj.isFieldPresent(sfDeliveredAmount))
|
|
||||||
setDeliveredAmount(obj.getFieldAmount(sfDeliveredAmount));
|
|
||||||
|
|
||||||
if (obj.isFieldPresent(sfParentBatchID))
|
|
||||||
setParentBatchId(obj.getFieldH256(sfParentBatchID));
|
|
||||||
}
|
|
||||||
|
|
||||||
TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj)
|
TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj)
|
||||||
: mTransactionID(txid)
|
: transactionID_(txid)
|
||||||
, mLedger(ledger)
|
, ledgerSeq_(ledger)
|
||||||
, mNodes(obj.getFieldArray(sfAffectedNodes))
|
, nodes_(obj.getFieldArray(sfAffectedNodes))
|
||||||
{
|
{
|
||||||
mResult = obj.getFieldU8(sfTransactionResult);
|
result_ = obj.getFieldU8(sfTransactionResult);
|
||||||
mIndex = obj.getFieldU32(sfTransactionIndex);
|
index_ = obj.getFieldU32(sfTransactionIndex);
|
||||||
|
|
||||||
auto affectedNodes =
|
auto affectedNodes =
|
||||||
dynamic_cast<STArray const*>(obj.peekAtPField(sfAffectedNodes));
|
dynamic_cast<STArray const*>(obj.peekAtPField(sfAffectedNodes));
|
||||||
@@ -75,40 +53,32 @@ TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, STObject const& obj)
|
|||||||
affectedNodes,
|
affectedNodes,
|
||||||
"ripple::TxMeta::TxMeta(STObject) : type cast succeeded");
|
"ripple::TxMeta::TxMeta(STObject) : type cast succeeded");
|
||||||
if (affectedNodes)
|
if (affectedNodes)
|
||||||
mNodes = *affectedNodes;
|
nodes_ = *affectedNodes;
|
||||||
|
|
||||||
if (obj.isFieldPresent(sfDeliveredAmount))
|
setAdditionalFields(obj);
|
||||||
setDeliveredAmount(obj.getFieldAmount(sfDeliveredAmount));
|
|
||||||
|
|
||||||
if (obj.isFieldPresent(sfParentBatchID))
|
|
||||||
setParentBatchId(obj.getFieldH256(sfParentBatchID));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, Blob const& vec)
|
TxMeta::TxMeta(uint256 const& txid, std::uint32_t ledger, Blob const& vec)
|
||||||
: TxMeta(txid, ledger, vec, CtorHelper())
|
: transactionID_(txid), ledgerSeq_(ledger), nodes_(sfAffectedNodes, 32)
|
||||||
{
|
{
|
||||||
|
SerialIter sit(makeSlice(vec));
|
||||||
|
|
||||||
|
STObject obj(sit, sfMetadata);
|
||||||
|
result_ = obj.getFieldU8(sfTransactionResult);
|
||||||
|
index_ = obj.getFieldU32(sfTransactionIndex);
|
||||||
|
nodes_ = obj.getFieldArray(sfAffectedNodes);
|
||||||
|
|
||||||
|
setAdditionalFields(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
TxMeta::TxMeta(
|
TxMeta::TxMeta(uint256 const& transactionID, std::uint32_t ledger)
|
||||||
uint256 const& txid,
|
: transactionID_(transactionID)
|
||||||
std::uint32_t ledger,
|
, ledgerSeq_(ledger)
|
||||||
std::string const& data)
|
, index_(std::numeric_limits<std::uint32_t>::max())
|
||||||
: TxMeta(txid, ledger, data, CtorHelper())
|
, result_(255)
|
||||||
|
, nodes_(sfAffectedNodes)
|
||||||
{
|
{
|
||||||
}
|
nodes_.reserve(32);
|
||||||
|
|
||||||
TxMeta::TxMeta(
|
|
||||||
uint256 const& transactionID,
|
|
||||||
std::uint32_t ledger,
|
|
||||||
std::optional<uint256> parentBatchId)
|
|
||||||
: mTransactionID(transactionID)
|
|
||||||
, mLedger(ledger)
|
|
||||||
, mIndex(static_cast<std::uint32_t>(-1))
|
|
||||||
, mResult(255)
|
|
||||||
, mParentBatchId(parentBatchId)
|
|
||||||
, mNodes(sfAffectedNodes)
|
|
||||||
{
|
|
||||||
mNodes.reserve(32);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -118,7 +88,7 @@ TxMeta::setAffectedNode(
|
|||||||
std::uint16_t nodeType)
|
std::uint16_t nodeType)
|
||||||
{
|
{
|
||||||
// make sure the node exists and force its type
|
// make sure the node exists and force its type
|
||||||
for (auto& n : mNodes)
|
for (auto& n : nodes_)
|
||||||
{
|
{
|
||||||
if (n.getFieldH256(sfLedgerIndex) == node)
|
if (n.getFieldH256(sfLedgerIndex) == node)
|
||||||
{
|
{
|
||||||
@@ -128,8 +98,8 @@ TxMeta::setAffectedNode(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mNodes.push_back(STObject(type));
|
nodes_.push_back(STObject(type));
|
||||||
STObject& obj = mNodes.back();
|
STObject& obj = nodes_.back();
|
||||||
|
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
obj.getFName() == type,
|
obj.getFName() == type,
|
||||||
@@ -146,14 +116,15 @@ TxMeta::getAffectedAccounts() const
|
|||||||
|
|
||||||
// This code should match the behavior of the JS method:
|
// This code should match the behavior of the JS method:
|
||||||
// Meta#getAffectedAccounts
|
// Meta#getAffectedAccounts
|
||||||
for (auto const& it : mNodes)
|
for (auto const& node : nodes_)
|
||||||
{
|
{
|
||||||
int index = it.getFieldIndex(
|
int index = node.getFieldIndex(
|
||||||
(it.getFName() == sfCreatedNode) ? sfNewFields : sfFinalFields);
|
(node.getFName() == sfCreatedNode) ? sfNewFields : sfFinalFields);
|
||||||
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
auto inner = dynamic_cast<STObject const*>(&it.peekAtIndex(index));
|
auto const* inner =
|
||||||
|
dynamic_cast<STObject const*>(&node.peekAtIndex(index));
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
inner,
|
inner,
|
||||||
"ripple::getAffectedAccounts : STObject type cast succeeded");
|
"ripple::getAffectedAccounts : STObject type cast succeeded");
|
||||||
@@ -213,13 +184,13 @@ STObject&
|
|||||||
TxMeta::getAffectedNode(SLE::ref node, SField const& type)
|
TxMeta::getAffectedNode(SLE::ref node, SField const& type)
|
||||||
{
|
{
|
||||||
uint256 index = node->key();
|
uint256 index = node->key();
|
||||||
for (auto& n : mNodes)
|
for (auto& n : nodes_)
|
||||||
{
|
{
|
||||||
if (n.getFieldH256(sfLedgerIndex) == index)
|
if (n.getFieldH256(sfLedgerIndex) == index)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
mNodes.push_back(STObject(type));
|
nodes_.push_back(STObject(type));
|
||||||
STObject& obj = mNodes.back();
|
STObject& obj = nodes_.back();
|
||||||
|
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
obj.getFName() == type,
|
obj.getFName() == type,
|
||||||
@@ -233,7 +204,7 @@ TxMeta::getAffectedNode(SLE::ref node, SField const& type)
|
|||||||
STObject&
|
STObject&
|
||||||
TxMeta::getAffectedNode(uint256 const& node)
|
TxMeta::getAffectedNode(uint256 const& node)
|
||||||
{
|
{
|
||||||
for (auto& n : mNodes)
|
for (auto& n : nodes_)
|
||||||
{
|
{
|
||||||
if (n.getFieldH256(sfLedgerIndex) == node)
|
if (n.getFieldH256(sfLedgerIndex) == node)
|
||||||
return n;
|
return n;
|
||||||
@@ -241,7 +212,7 @@ TxMeta::getAffectedNode(uint256 const& node)
|
|||||||
// LCOV_EXCL_START
|
// LCOV_EXCL_START
|
||||||
UNREACHABLE("ripple::TxMeta::getAffectedNode(uint256) : node not found");
|
UNREACHABLE("ripple::TxMeta::getAffectedNode(uint256) : node not found");
|
||||||
Throw<std::runtime_error>("Affected node not found");
|
Throw<std::runtime_error>("Affected node not found");
|
||||||
return *(mNodes.begin()); // Silence compiler warning.
|
return *(nodes_.begin()); // Silence compiler warning.
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,15 +220,15 @@ STObject
|
|||||||
TxMeta::getAsObject() const
|
TxMeta::getAsObject() const
|
||||||
{
|
{
|
||||||
STObject metaData(sfTransactionMetaData);
|
STObject metaData(sfTransactionMetaData);
|
||||||
XRPL_ASSERT(mResult != 255, "ripple::TxMeta::getAsObject : result is set");
|
XRPL_ASSERT(result_ != 255, "ripple::TxMeta::getAsObject : result_ is set");
|
||||||
metaData.setFieldU8(sfTransactionResult, mResult);
|
metaData.setFieldU8(sfTransactionResult, result_);
|
||||||
metaData.setFieldU32(sfTransactionIndex, mIndex);
|
metaData.setFieldU32(sfTransactionIndex, index_);
|
||||||
metaData.emplace_back(mNodes);
|
metaData.emplace_back(nodes_);
|
||||||
if (hasDeliveredAmount())
|
if (deliveredAmount_.has_value())
|
||||||
metaData.setFieldAmount(sfDeliveredAmount, getDeliveredAmount());
|
metaData.setFieldAmount(sfDeliveredAmount, *deliveredAmount_);
|
||||||
|
|
||||||
if (hasParentBatchId())
|
if (parentBatchID_.has_value())
|
||||||
metaData.setFieldH256(sfParentBatchID, getParentBatchId());
|
metaData.setFieldH256(sfParentBatchID, *parentBatchID_);
|
||||||
|
|
||||||
return metaData;
|
return metaData;
|
||||||
}
|
}
|
||||||
@@ -265,13 +236,13 @@ TxMeta::getAsObject() const
|
|||||||
void
|
void
|
||||||
TxMeta::addRaw(Serializer& s, TER result, std::uint32_t index)
|
TxMeta::addRaw(Serializer& s, TER result, std::uint32_t index)
|
||||||
{
|
{
|
||||||
mResult = TERtoInt(result);
|
result_ = TERtoInt(result);
|
||||||
mIndex = index;
|
index_ = index;
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(mResult == 0) || ((mResult > 100) && (mResult <= 255)),
|
(result_ == 0) || ((result_ > 100) && (result_ <= 255)),
|
||||||
"ripple::TxMeta::addRaw : valid TER input");
|
"ripple::TxMeta::addRaw : valid TER input");
|
||||||
|
|
||||||
mNodes.sort([](STObject const& o1, STObject const& o2) {
|
nodes_.sort([](STObject const& o1, STObject const& o2) {
|
||||||
return o1.getFieldH256(sfLedgerIndex) < o2.getFieldH256(sfLedgerIndex);
|
return o1.getFieldH256(sfLedgerIndex) < o2.getFieldH256(sfLedgerIndex);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -17,15 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
#include <xrpld/shamap/SHAMapAccountStateLeafNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapNodeID.h>
|
|
||||||
#include <xrpld/shamap/SHAMapSyncFilter.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTxLeafNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTxPlusMetaLeafNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/TaggedCache.ipp>
|
#include <xrpl/basics/TaggedCache.ipp>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
#include <xrpl/shamap/SHAMapAccountStateLeafNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapNodeID.h>
|
||||||
|
#include <xrpl/shamap/SHAMapSyncFilter.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTxLeafNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTxPlusMetaLeafNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -17,10 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.ipp>
|
#include <xrpl/basics/IntrusivePointer.ipp>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
@@ -17,16 +17,15 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapInnerNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
|
||||||
#include <xrpld/shamap/detail/TaggedPointer.ipp>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.ipp>
|
#include <xrpl/basics/IntrusivePointer.ipp>
|
||||||
#include <xrpl/basics/Slice.h>
|
#include <xrpl/basics/Slice.h>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/basics/spinlock.h>
|
#include <xrpl/basics/spinlock.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
#include <xrpl/shamap/SHAMapInnerNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
#include <xrpl/shamap/detail/TaggedPointer.ipp>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapLeafNode.h>
|
#include <xrpl/shamap/SHAMapLeafNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -17,12 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
#include <xrpld/shamap/SHAMapNodeID.h>
|
|
||||||
|
|
||||||
#include <xrpl/beast/core/LexicalCast.h>
|
#include <xrpl/beast/core/LexicalCast.h>
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
#include <xrpl/protocol/Serializer.h>
|
#include <xrpl/protocol/Serializer.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
#include <xrpl/shamap/SHAMapNodeID.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -17,11 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
#include <xrpld/shamap/SHAMapLeafNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapSyncFilter.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/random.h>
|
#include <xrpl/basics/random.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
#include <xrpl/shamap/SHAMapLeafNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapSyncFilter.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -17,18 +17,17 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMapAccountStateLeafNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapInnerNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTreeNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTxLeafNode.h>
|
|
||||||
#include <xrpld/shamap/SHAMapTxPlusMetaLeafNode.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.ipp>
|
#include <xrpl/basics/IntrusivePointer.ipp>
|
||||||
#include <xrpl/basics/Slice.h>
|
#include <xrpl/basics/Slice.h>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
#include <xrpl/shamap/SHAMapAccountStateLeafNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapInnerNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTreeNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTxLeafNode.h>
|
||||||
|
#include <xrpl/shamap/SHAMapTxPlusMetaLeafNode.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -545,8 +545,7 @@ public:
|
|||||||
|
|
||||||
for (auto const& [hash, nVotes] : votes)
|
for (auto const& [hash, nVotes] : votes)
|
||||||
{
|
{
|
||||||
if (rules.enabled(fixAmendmentMajorityCalc) ? nVotes >= i
|
if (nVotes >= i)
|
||||||
: nVotes > i)
|
|
||||||
{
|
{
|
||||||
// We vote yes on this amendment
|
// We vote yes on this amendment
|
||||||
field.push_back(hash);
|
field.push_back(hash);
|
||||||
@@ -982,10 +981,6 @@ public:
|
|||||||
void
|
void
|
||||||
testChangedUNL(FeatureBitset const& feat)
|
testChangedUNL(FeatureBitset const& feat)
|
||||||
{
|
{
|
||||||
// This test doesn't work without fixAmendmentMajorityCalc enabled.
|
|
||||||
if (!feat[fixAmendmentMajorityCalc])
|
|
||||||
return;
|
|
||||||
|
|
||||||
testcase("changedUNL");
|
testcase("changedUNL");
|
||||||
|
|
||||||
auto const testAmendment = amendmentId("changedUNL");
|
auto const testAmendment = amendmentId("changedUNL");
|
||||||
@@ -1143,10 +1138,6 @@ public:
|
|||||||
void
|
void
|
||||||
testValidatorFlapping(FeatureBitset const& feat)
|
testValidatorFlapping(FeatureBitset const& feat)
|
||||||
{
|
{
|
||||||
// This test doesn't work without fixAmendmentMajorityCalc enabled.
|
|
||||||
if (!feat[fixAmendmentMajorityCalc])
|
|
||||||
return;
|
|
||||||
|
|
||||||
testcase("validatorFlapping");
|
testcase("validatorFlapping");
|
||||||
|
|
||||||
// We run a test where a validator flaps on and off every 23 hours
|
// We run a test where a validator flaps on and off every 23 hours
|
||||||
@@ -1289,14 +1280,12 @@ public:
|
|||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
FeatureBitset const all{test::jtx::testable_amendments()};
|
FeatureBitset const all{test::jtx::testable_amendments()};
|
||||||
FeatureBitset const fixMajorityCalc{fixAmendmentMajorityCalc};
|
|
||||||
|
|
||||||
testConstruct();
|
testConstruct();
|
||||||
testGet();
|
testGet();
|
||||||
testBadConfig();
|
testBadConfig();
|
||||||
testEnableVeto();
|
testEnableVeto();
|
||||||
testHasUnsupported();
|
testHasUnsupported();
|
||||||
testFeature(all - fixMajorityCalc);
|
|
||||||
testFeature(all);
|
testFeature(all);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3946,14 +3946,13 @@ class Batch_test : public beast::unit_test::suite
|
|||||||
tesSUCCESS,
|
tesSUCCESS,
|
||||||
batch::outer(gw, seq, batchFee, tfIndependent),
|
batch::outer(gw, seq, batchFee, tfIndependent),
|
||||||
batch::inner(jv1, seq + 1),
|
batch::inner(jv1, seq + 1),
|
||||||
// tecNO_DELEGATE_PERMISSION: not authorized to clear freeze
|
// terNO_DELEGATE_PERMISSION: not authorized to clear freeze
|
||||||
batch::inner(jv2, seq + 2));
|
batch::inner(jv2, seq + 2));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
std::vector<TestLedgerData> testCases = {
|
std::vector<TestLedgerData> testCases = {
|
||||||
{0, "Batch", "tesSUCCESS", batchID, std::nullopt},
|
{0, "Batch", "tesSUCCESS", batchID, std::nullopt},
|
||||||
{1, "TrustSet", "tesSUCCESS", txIDs[0], batchID},
|
{1, "TrustSet", "tesSUCCESS", txIDs[0], batchID},
|
||||||
{2, "TrustSet", "tecNO_DELEGATE_PERMISSION", txIDs[1], batchID},
|
|
||||||
};
|
};
|
||||||
validateClosedLedger(env, testCases);
|
validateClosedLedger(env, testCases);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,23 +27,27 @@ namespace test {
|
|||||||
class Delegate_test : public beast::unit_test::suite
|
class Delegate_test : public beast::unit_test::suite
|
||||||
{
|
{
|
||||||
void
|
void
|
||||||
testFeatureDisabled()
|
testFeatureDisabled(FeatureBitset features)
|
||||||
{
|
{
|
||||||
testcase("test featurePermissionDelegation not enabled");
|
testcase("test feature not enabled");
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
|
|
||||||
Env env{*this, testable_amendments() - featurePermissionDelegation};
|
Env env{*this, features};
|
||||||
Account gw{"gateway"};
|
Account gw{"gateway"};
|
||||||
Account alice{"alice"};
|
Account alice{"alice"};
|
||||||
Account bob{"bob"};
|
Account bob{"bob"};
|
||||||
env.fund(XRP(1000000), gw, alice, bob);
|
env.fund(XRP(1000000), gw, alice, bob);
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
|
auto res = features[featurePermissionDelegationV1_1] ? ter(tesSUCCESS)
|
||||||
|
: ter(temDISABLED);
|
||||||
|
|
||||||
// can not set Delegate when feature disabled
|
// can not set Delegate when feature disabled
|
||||||
env(delegate::set(gw, alice, {"Payment"}), ter(temDISABLED));
|
env(delegate::set(gw, alice, {"Payment"}), res);
|
||||||
|
env.close();
|
||||||
|
|
||||||
// can not send delegating transaction when feature disabled
|
// can not send delegating transaction when feature disabled
|
||||||
env(pay(alice, bob, XRP(100)), delegate::as(bob), ter(temDISABLED));
|
env(pay(gw, bob, XRP(100)), delegate::as(alice), res);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -217,17 +221,16 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
}
|
}
|
||||||
|
|
||||||
// non-delegatable transaction
|
// non-delegatable transaction
|
||||||
auto const res = features[fixDelegateV1_1] ? ter(temMALFORMED)
|
|
||||||
: ter(tecNO_PERMISSION);
|
|
||||||
{
|
{
|
||||||
env(delegate::set(gw, alice, {"SetRegularKey"}), res);
|
env(delegate::set(gw, alice, {"SetRegularKey"}), ter(temMALFORMED));
|
||||||
env(delegate::set(gw, alice, {"AccountSet"}), res);
|
env(delegate::set(gw, alice, {"AccountSet"}), ter(temMALFORMED));
|
||||||
env(delegate::set(gw, alice, {"SignerListSet"}), res);
|
env(delegate::set(gw, alice, {"SignerListSet"}), ter(temMALFORMED));
|
||||||
env(delegate::set(gw, alice, {"DelegateSet"}), res);
|
env(delegate::set(gw, alice, {"DelegateSet"}), ter(temMALFORMED));
|
||||||
env(delegate::set(gw, alice, {"EnableAmendment"}), res);
|
env(delegate::set(gw, alice, {"EnableAmendment"}),
|
||||||
env(delegate::set(gw, alice, {"UNLModify"}), res);
|
ter(temMALFORMED));
|
||||||
env(delegate::set(gw, alice, {"SetFee"}), res);
|
env(delegate::set(gw, alice, {"UNLModify"}), ter(temMALFORMED));
|
||||||
env(delegate::set(gw, alice, {"Batch"}), res);
|
env(delegate::set(gw, alice, {"SetFee"}), ter(temMALFORMED));
|
||||||
|
env(delegate::set(gw, alice, {"Batch"}), ter(temMALFORMED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,10 +308,6 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
{
|
{
|
||||||
// Fee should be checked before permission check,
|
|
||||||
// otherwise tecNO_DELEGATE_PERMISSION returned when permission
|
|
||||||
// check fails could cause context reset to pay fee because it is
|
|
||||||
// tec error
|
|
||||||
auto aliceBalance = env.balance(alice);
|
auto aliceBalance = env.balance(alice);
|
||||||
auto bobBalance = env.balance(bob);
|
auto bobBalance = env.balance(bob);
|
||||||
auto carolBalance = env.balance(carol);
|
auto carolBalance = env.balance(carol);
|
||||||
@@ -316,7 +315,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(pay(alice, carol, XRP(100)),
|
env(pay(alice, carol, XRP(100)),
|
||||||
fee(XRP(2000)),
|
fee(XRP(2000)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(terINSUF_FEE_B));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
||||||
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
||||||
@@ -523,12 +522,12 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob does not have permission to create check
|
// bob does not have permission to create check
|
||||||
env(check::create(alice, bob, XRP(10)),
|
env(check::create(alice, bob, XRP(10)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// carol does not have permission to create check
|
// carol does not have permission to create check
|
||||||
env(check::create(alice, bob, XRP(10)),
|
env(check::create(alice, bob, XRP(10)),
|
||||||
delegate::as(carol),
|
delegate::as(carol),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -563,9 +562,8 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// delegate ledger object is not created yet
|
// delegate ledger object is not created yet
|
||||||
env(pay(gw, alice, USD(50)),
|
env(pay(gw, alice, USD(50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.require(balance(bob, bobBalance - drops(baseFee)));
|
env.require(balance(bob, bobBalance));
|
||||||
bobBalance = env.balance(bob, XRP);
|
|
||||||
|
|
||||||
// gw gives bob burn permission
|
// gw gives bob burn permission
|
||||||
env(delegate::set(gw, bob, {"PaymentBurn"}));
|
env(delegate::set(gw, bob, {"PaymentBurn"}));
|
||||||
@@ -576,10 +574,9 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob sends a payment transaction on behalf of gw
|
// bob sends a payment transaction on behalf of gw
|
||||||
env(pay(gw, alice, USD(50)),
|
env(pay(gw, alice, USD(50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
env.require(balance(bob, bobBalance - drops(baseFee)));
|
env.require(balance(bob, bobBalance));
|
||||||
bobBalance = env.balance(bob, XRP);
|
|
||||||
|
|
||||||
// gw gives bob mint permission, alice gives bob burn permission
|
// gw gives bob mint permission, alice gives bob burn permission
|
||||||
env(delegate::set(gw, bob, {"PaymentMint"}));
|
env(delegate::set(gw, bob, {"PaymentMint"}));
|
||||||
@@ -593,10 +590,9 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// can not send XRP
|
// can not send XRP
|
||||||
env(pay(gw, alice, XRP(50)),
|
env(pay(gw, alice, XRP(50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
env.require(balance(bob, bobBalance - drops(baseFee)));
|
env.require(balance(bob, bobBalance));
|
||||||
bobBalance = env.balance(bob, XRP);
|
|
||||||
|
|
||||||
// mint 50 USD
|
// mint 50 USD
|
||||||
env(pay(gw, alice, USD(50)), delegate::as(bob));
|
env(pay(gw, alice, USD(50)), delegate::as(bob));
|
||||||
@@ -681,10 +677,9 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// permission
|
// permission
|
||||||
env(pay(gw, alice, USD(50)),
|
env(pay(gw, alice, USD(50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
env.require(balance(bob, bobBalance - drops(baseFee)));
|
env.require(balance(bob, bobBalance));
|
||||||
bobBalance = env.balance(bob, XRP);
|
|
||||||
|
|
||||||
// gw gives bob Payment permission as well
|
// gw gives bob Payment permission as well
|
||||||
env(delegate::set(gw, bob, {"PaymentBurn", "Payment"}));
|
env(delegate::set(gw, bob, {"PaymentBurn", "Payment"}));
|
||||||
@@ -723,11 +718,6 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(pay(gw, carol, USD(10000)));
|
env(pay(gw, carol, USD(10000)));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
auto const result = features[fixDelegateV1_1]
|
|
||||||
? static_cast<TER>(tecNO_DELEGATE_PERMISSION)
|
|
||||||
: static_cast<TER>(tesSUCCESS);
|
|
||||||
auto const offerCount = features[fixDelegateV1_1] ? 1 : 0;
|
|
||||||
|
|
||||||
// PaymentMint
|
// PaymentMint
|
||||||
{
|
{
|
||||||
env(offer(carol, XRP(100), USD(501)));
|
env(offer(carol, XRP(100), USD(501)));
|
||||||
@@ -735,16 +725,21 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(delegate::set(gw, bob, {"PaymentMint"}));
|
env(delegate::set(gw, bob, {"PaymentMint"}));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
// post-amendment: fixDelegateV1_1
|
|
||||||
// bob can not send cross currency payment on behalf of the gw,
|
// bob can not send cross currency payment on behalf of the gw,
|
||||||
// even with PaymentMint permission and gw being the issuer.
|
// even with PaymentMint permission and gw being the issuer.
|
||||||
env(pay(gw, alice, USD(5000)),
|
env(pay(gw, alice, USD(5000)),
|
||||||
path(~USD),
|
|
||||||
sendmax(XRP(1001)),
|
sendmax(XRP(1001)),
|
||||||
txflags(tfPartialPayment),
|
txflags(tfPartialPayment),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(result));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
BEAST_EXPECT(expectOffers(env, carol, offerCount));
|
BEAST_EXPECT(expectOffers(env, carol, 1));
|
||||||
|
|
||||||
|
env(pay(gw, alice, USD(5000)),
|
||||||
|
path(~XRP),
|
||||||
|
txflags(tfPartialPayment),
|
||||||
|
delegate::as(bob),
|
||||||
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
BEAST_EXPECT(expectOffers(env, carol, 1));
|
||||||
|
|
||||||
// succeed with direct payment
|
// succeed with direct payment
|
||||||
env(pay(gw, alice, USD(100)), delegate::as(bob));
|
env(pay(gw, alice, USD(100)), delegate::as(bob));
|
||||||
@@ -758,16 +753,21 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(delegate::set(alice, bob, {"PaymentBurn"}));
|
env(delegate::set(alice, bob, {"PaymentBurn"}));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
// post-amendment: fixDelegateV1_1
|
|
||||||
// bob can not send cross currency payment on behalf of alice,
|
// bob can not send cross currency payment on behalf of alice,
|
||||||
// even with PaymentBurn permission and gw being the issuer.
|
// even with PaymentBurn permission and gw being the issuer.
|
||||||
env(pay(alice, gw, USD(5000)),
|
env(pay(alice, gw, USD(5000)),
|
||||||
path(~USD),
|
|
||||||
sendmax(XRP(1001)),
|
sendmax(XRP(1001)),
|
||||||
txflags(tfPartialPayment),
|
txflags(tfPartialPayment),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(result));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
BEAST_EXPECT(expectOffers(env, bob, offerCount));
|
BEAST_EXPECT(expectOffers(env, bob, 1));
|
||||||
|
|
||||||
|
env(pay(alice, gw, USD(5000)),
|
||||||
|
path(~XRP),
|
||||||
|
txflags(tfPartialPayment),
|
||||||
|
delegate::as(bob),
|
||||||
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
BEAST_EXPECT(expectOffers(env, bob, 1));
|
||||||
|
|
||||||
// succeed with direct payment
|
// succeed with direct payment
|
||||||
env(pay(alice, gw, USD(100)), delegate::as(bob));
|
env(pay(alice, gw, USD(100)), delegate::as(bob));
|
||||||
@@ -802,20 +802,10 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(delegate::set(gw, bob, {"PaymentMint"}));
|
env(delegate::set(gw, bob, {"PaymentMint"}));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
if (!features[fixDelegateV1_1])
|
env(pay(gw, alice, MPT(50)), delegate::as(bob));
|
||||||
{
|
BEAST_EXPECT(env.balance(alice, MPT) == aliceMPT + MPT(50));
|
||||||
// pre-amendment: PaymentMint is not supported for MPT
|
BEAST_EXPECT(env.balance(bob, MPT) == bobMPT);
|
||||||
env(pay(gw, alice, MPT(50)),
|
aliceMPT = env.balance(alice, MPT);
|
||||||
delegate::as(bob),
|
|
||||||
ter(tefEXCEPTION));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
env(pay(gw, alice, MPT(50)), delegate::as(bob));
|
|
||||||
BEAST_EXPECT(env.balance(alice, MPT) == aliceMPT + MPT(50));
|
|
||||||
BEAST_EXPECT(env.balance(bob, MPT) == bobMPT);
|
|
||||||
aliceMPT = env.balance(alice, MPT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaymentBurn
|
// PaymentBurn
|
||||||
@@ -823,24 +813,13 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(delegate::set(alice, bob, {"PaymentBurn"}));
|
env(delegate::set(alice, bob, {"PaymentBurn"}));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
if (!features[fixDelegateV1_1])
|
env(pay(alice, gw, MPT(50)), delegate::as(bob));
|
||||||
{
|
BEAST_EXPECT(env.balance(alice, MPT) == aliceMPT - MPT(50));
|
||||||
// pre-amendment: PaymentBurn is not supported for MPT
|
BEAST_EXPECT(env.balance(bob, MPT) == bobMPT);
|
||||||
env(pay(alice, gw, MPT(50)),
|
aliceMPT = env.balance(alice, MPT);
|
||||||
delegate::as(bob),
|
|
||||||
ter(tefEXCEPTION));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
env(pay(alice, gw, MPT(50)), delegate::as(bob));
|
|
||||||
BEAST_EXPECT(env.balance(alice, MPT) == aliceMPT - MPT(50));
|
|
||||||
BEAST_EXPECT(env.balance(bob, MPT) == bobMPT);
|
|
||||||
aliceMPT = env.balance(alice, MPT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payment transaction for MPT is allowed for both pre and post
|
// Grant both granular permissions and tx level permission.
|
||||||
// amendment
|
|
||||||
{
|
{
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
alice, bob, {"PaymentBurn", "PaymentMint", "Payment"}));
|
alice, bob, {"PaymentBurn", "PaymentMint", "Payment"}));
|
||||||
@@ -878,7 +857,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// has unfreeze permission
|
// has unfreeze permission
|
||||||
env(trust(alice, gw["USD"](50)),
|
env(trust(alice, gw["USD"](50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
// alice creates trustline by herself
|
// alice creates trustline by herself
|
||||||
@@ -892,38 +871,38 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// unsupported flags
|
// unsupported flags
|
||||||
env(trust(alice, gw["USD"](50), tfSetNoRipple),
|
env(trust(alice, gw["USD"](50), tfSetNoRipple),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(trust(alice, gw["USD"](50), tfClearNoRipple),
|
env(trust(alice, gw["USD"](50), tfClearNoRipple),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(trust(gw, gw["USD"](0), alice, tfSetDeepFreeze),
|
env(trust(gw, gw["USD"](0), alice, tfSetDeepFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(trust(gw, gw["USD"](0), alice, tfClearDeepFreeze),
|
env(trust(gw, gw["USD"](0), alice, tfClearDeepFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
// supported flags with wrong permission
|
// supported flags with wrong permission
|
||||||
env(trust(gw, gw["USD"](0), alice, tfSetfAuth),
|
env(trust(gw, gw["USD"](0), alice, tfSetfAuth),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(trust(gw, gw["USD"](0), alice, tfSetFreeze),
|
env(trust(gw, gw["USD"](0), alice, tfSetFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
env(delegate::set(gw, bob, {"TrustlineAuthorize"}));
|
env(delegate::set(gw, bob, {"TrustlineAuthorize"}));
|
||||||
env.close();
|
env.close();
|
||||||
env(trust(gw, gw["USD"](0), alice, tfClearFreeze),
|
env(trust(gw, gw["USD"](0), alice, tfClearFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
// although trustline authorize is granted, bob can not change the
|
// although trustline authorize is granted, bob can not change the
|
||||||
// limit number
|
// limit number
|
||||||
env(trust(gw, gw["USD"](50), alice, tfSetfAuth),
|
env(trust(gw, gw["USD"](50), alice, tfSetfAuth),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
// supported flags with correct permission
|
// supported flags with correct permission
|
||||||
@@ -944,30 +923,30 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// permission
|
// permission
|
||||||
env(trust(gw, gw["USD"](0), alice, tfSetFreeze),
|
env(trust(gw, gw["USD"](0), alice, tfSetFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// cannot update LimitAmount with granular permission, both high and
|
// cannot update LimitAmount with granular permission, both high and
|
||||||
// low account
|
// low account
|
||||||
env(trust(alice, gw["USD"](100)),
|
env(trust(alice, gw["USD"](100)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(trust(gw, alice["USD"](100)),
|
env(trust(gw, alice["USD"](100)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// can not set QualityIn or QualityOut
|
// can not set QualityIn or QualityOut
|
||||||
auto tx = trust(alice, gw["USD"](50));
|
auto tx = trust(alice, gw["USD"](50));
|
||||||
tx["QualityIn"] = "1000";
|
tx["QualityIn"] = "1000";
|
||||||
env(tx, delegate::as(bob), ter(tecNO_DELEGATE_PERMISSION));
|
env(tx, delegate::as(bob), ter(terNO_DELEGATE_PERMISSION));
|
||||||
auto tx2 = trust(alice, gw["USD"](50));
|
auto tx2 = trust(alice, gw["USD"](50));
|
||||||
tx2["QualityOut"] = "1000";
|
tx2["QualityOut"] = "1000";
|
||||||
env(tx2, delegate::as(bob), ter(tecNO_DELEGATE_PERMISSION));
|
env(tx2, delegate::as(bob), ter(terNO_DELEGATE_PERMISSION));
|
||||||
auto tx3 = trust(gw, alice["USD"](50));
|
auto tx3 = trust(gw, alice["USD"](50));
|
||||||
tx3["QualityIn"] = "1000";
|
tx3["QualityIn"] = "1000";
|
||||||
env(tx3, delegate::as(bob), ter(tecNO_DELEGATE_PERMISSION));
|
env(tx3, delegate::as(bob), ter(terNO_DELEGATE_PERMISSION));
|
||||||
auto tx4 = trust(gw, alice["USD"](50));
|
auto tx4 = trust(gw, alice["USD"](50));
|
||||||
tx4["QualityOut"] = "1000";
|
tx4["QualityOut"] = "1000";
|
||||||
env(tx4, delegate::as(bob), ter(tecNO_DELEGATE_PERMISSION));
|
env(tx4, delegate::as(bob), ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// granting TrustSet can make it work
|
// granting TrustSet can make it work
|
||||||
env(delegate::set(gw, bob, {"TrustSet"}));
|
env(delegate::set(gw, bob, {"TrustSet"}));
|
||||||
@@ -977,7 +956,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(tx5, delegate::as(bob));
|
env(tx5, delegate::as(bob));
|
||||||
auto tx6 = trust(alice, gw["USD"](50));
|
auto tx6 = trust(alice, gw["USD"](50));
|
||||||
tx6["QualityOut"] = "1000";
|
tx6["QualityOut"] = "1000";
|
||||||
env(tx6, delegate::as(bob), ter(tecNO_DELEGATE_PERMISSION));
|
env(tx6, delegate::as(bob), ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(delegate::set(alice, bob, {"TrustSet"}));
|
env(delegate::set(alice, bob, {"TrustSet"}));
|
||||||
env.close();
|
env.close();
|
||||||
env(tx6, delegate::as(bob));
|
env(tx6, delegate::as(bob));
|
||||||
@@ -996,14 +975,14 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob does not have permission
|
// bob does not have permission
|
||||||
env(trust(alice, gw["USD"](50)),
|
env(trust(alice, gw["USD"](50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
alice, bob, {"TrustlineUnfreeze", "NFTokenCreateOffer"}));
|
alice, bob, {"TrustlineUnfreeze", "NFTokenCreateOffer"}));
|
||||||
env.close();
|
env.close();
|
||||||
// bob still does not have permission
|
// bob still does not have permission
|
||||||
env(trust(alice, gw["USD"](50)),
|
env(trust(alice, gw["USD"](50)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// add TrustSet permission and some unrelated permission
|
// add TrustSet permission and some unrelated permission
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1096,7 +1075,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
alice, bob, {"TrustlineUnfreeze", "AccountEmailHashSet"}));
|
alice, bob, {"TrustlineUnfreeze", "AccountEmailHashSet"}));
|
||||||
env.close();
|
env.close();
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// alice give granular permission of AccountDomainSet to bob
|
// alice give granular permission of AccountDomainSet to bob
|
||||||
env(delegate::set(alice, bob, {"AccountDomainSet"}));
|
env(delegate::set(alice, bob, {"AccountDomainSet"}));
|
||||||
@@ -1115,7 +1094,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
std::string const failDomain = "fail_domain_update";
|
std::string const failDomain = "fail_domain_update";
|
||||||
jt[sfFlags] = tfRequireAuth;
|
jt[sfFlags] = tfRequireAuth;
|
||||||
jt[sfDomain] = strHex(failDomain);
|
jt[sfDomain] = strHex(failDomain);
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
// reset flag number
|
// reset flag number
|
||||||
jt[sfFlags] = 0;
|
jt[sfFlags] = 0;
|
||||||
|
|
||||||
@@ -1124,7 +1103,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
jt[sfDomain] = strHex(domain);
|
jt[sfDomain] = strHex(domain);
|
||||||
std::string const mh("5F31A79367DC3137FADA860C05742EE6");
|
std::string const mh("5F31A79367DC3137FADA860C05742EE6");
|
||||||
jt[sfEmailHash] = mh;
|
jt[sfEmailHash] = mh;
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// alice give granular permission of AccountEmailHashSet to bob
|
// alice give granular permission of AccountEmailHashSet to bob
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1137,7 +1116,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob does not have permission to set message key for alice
|
// bob does not have permission to set message key for alice
|
||||||
auto const rkp = randomKeyPair(KeyType::ed25519);
|
auto const rkp = randomKeyPair(KeyType::ed25519);
|
||||||
jt[sfMessageKey] = strHex(rkp.first.slice());
|
jt[sfMessageKey] = strHex(rkp.first.slice());
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// alice give granular permission of AccountMessageKeySet to bob
|
// alice give granular permission of AccountMessageKeySet to bob
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1160,7 +1139,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob does not have permission to set transfer rate for alice
|
// bob does not have permission to set transfer rate for alice
|
||||||
env(rate(alice, 2.0),
|
env(rate(alice, 2.0),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// alice give granular permission of AccountTransferRateSet to bob
|
// alice give granular permission of AccountTransferRateSet to bob
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1178,7 +1157,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
|
|
||||||
// bob does not have permission to set ticksize for alice
|
// bob does not have permission to set ticksize for alice
|
||||||
jt[sfTickSize] = 8;
|
jt[sfTickSize] = 8;
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// alice give granular permission of AccountTickSizeSet to bob
|
// alice give granular permission of AccountTickSizeSet to bob
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1196,7 +1175,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// can not set asfRequireAuth flag for alice
|
// can not set asfRequireAuth flag for alice
|
||||||
env(fset(alice, asfRequireAuth),
|
env(fset(alice, asfRequireAuth),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// reset Delegate will delete the Delegate
|
// reset Delegate will delete the Delegate
|
||||||
// object
|
// object
|
||||||
@@ -1205,7 +1184,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// alice
|
// alice
|
||||||
env(fset(alice, asfRequireAuth),
|
env(fset(alice, asfRequireAuth),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
// alice can set for herself
|
// alice can set for herself
|
||||||
env(fset(alice, asfRequireAuth));
|
env(fset(alice, asfRequireAuth));
|
||||||
env.require(flags(alice, asfRequireAuth));
|
env.require(flags(alice, asfRequireAuth));
|
||||||
@@ -1213,7 +1192,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
|
|
||||||
// can not update tick size because bob no longer has permission
|
// can not update tick size because bob no longer has permission
|
||||||
jt[sfTickSize] = 7;
|
jt[sfTickSize] = 7;
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
alice,
|
alice,
|
||||||
@@ -1231,7 +1210,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
jv2[sfDomain] = strHex(domain);
|
jv2[sfDomain] = strHex(domain);
|
||||||
jv2[sfDelegate] = bob.human();
|
jv2[sfDelegate] = bob.human();
|
||||||
jv2[sfWalletLocator] = locator;
|
jv2[sfWalletLocator] = locator;
|
||||||
env(jv2, ter(tecNO_DELEGATE_PERMISSION));
|
env(jv2, ter(terNO_DELEGATE_PERMISSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
// can not set AccountSet flags on behalf of other account
|
// can not set AccountSet flags on behalf of other account
|
||||||
@@ -1246,7 +1225,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob can not set flag on behalf of alice
|
// bob can not set flag on behalf of alice
|
||||||
env(fset(alice, flag),
|
env(fset(alice, flag),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
// alice set by herself
|
// alice set by herself
|
||||||
env(fset(alice, flag));
|
env(fset(alice, flag));
|
||||||
env.close();
|
env.close();
|
||||||
@@ -1254,7 +1233,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob can not clear on behalf of alice
|
// bob can not clear on behalf of alice
|
||||||
env(fclear(alice, flag),
|
env(fclear(alice, flag),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
};
|
};
|
||||||
|
|
||||||
// testSetClearFlag(asfNoFreeze);
|
// testSetClearFlag(asfNoFreeze);
|
||||||
@@ -1283,19 +1262,19 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// bob can not set asfAccountTxnID on behalf of alice
|
// bob can not set asfAccountTxnID on behalf of alice
|
||||||
env(fset(alice, asfAccountTxnID),
|
env(fset(alice, asfAccountTxnID),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(fset(alice, asfAccountTxnID));
|
env(fset(alice, asfAccountTxnID));
|
||||||
env.close();
|
env.close();
|
||||||
BEAST_EXPECT(env.le(alice)->isFieldPresent(sfAccountTxnID));
|
BEAST_EXPECT(env.le(alice)->isFieldPresent(sfAccountTxnID));
|
||||||
env(fclear(alice, asfAccountTxnID),
|
env(fclear(alice, asfAccountTxnID),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// bob can not set asfAuthorizedNFTokenMinter on behalf of alice
|
// bob can not set asfAuthorizedNFTokenMinter on behalf of alice
|
||||||
Json::Value jt = fset(alice, asfAuthorizedNFTokenMinter);
|
Json::Value jt = fset(alice, asfAuthorizedNFTokenMinter);
|
||||||
jt[sfDelegate] = bob.human();
|
jt[sfDelegate] = bob.human();
|
||||||
jt[sfNFTokenMinter] = bob.human();
|
jt[sfNFTokenMinter] = bob.human();
|
||||||
env(jt, ter(tecNO_DELEGATE_PERMISSION));
|
env(jt, ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// bob gives alice some permissions
|
// bob gives alice some permissions
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1311,14 +1290,14 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
// behalf of bob.
|
// behalf of bob.
|
||||||
env(fset(alice, asfNoFreeze),
|
env(fset(alice, asfNoFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
env(fset(bob, asfNoFreeze));
|
env(fset(bob, asfNoFreeze));
|
||||||
env.close();
|
env.close();
|
||||||
env.require(flags(bob, asfNoFreeze));
|
env.require(flags(bob, asfNoFreeze));
|
||||||
// alice can not clear on behalf of bob
|
// alice can not clear on behalf of bob
|
||||||
env(fclear(alice, asfNoFreeze),
|
env(fclear(alice, asfNoFreeze),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
|
||||||
// bob can not set asfDisableMaster on behalf of alice
|
// bob can not set asfDisableMaster on behalf of alice
|
||||||
Account const bobKey{"bobKey", KeyType::secp256k1};
|
Account const bobKey{"bobKey", KeyType::secp256k1};
|
||||||
@@ -1327,7 +1306,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env(fset(alice, asfDisableMaster),
|
env(fset(alice, asfDisableMaster),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
sig(bob),
|
sig(bob),
|
||||||
ter(tecNO_DELEGATE_PERMISSION));
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
// tfFullyCanonicalSig won't block delegated transaction
|
// tfFullyCanonicalSig won't block delegated transaction
|
||||||
@@ -1377,7 +1356,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{.account = alice,
|
{.account = alice,
|
||||||
.flags = tfMPTLock,
|
.flags = tfMPTLock,
|
||||||
.delegate = bob,
|
.delegate = bob,
|
||||||
.err = tecNO_DELEGATE_PERMISSION});
|
.err = terNO_DELEGATE_PERMISSION});
|
||||||
|
|
||||||
// alice gives granular permission to bob of MPTokenIssuanceUnlock
|
// alice gives granular permission to bob of MPTokenIssuanceUnlock
|
||||||
env(delegate::set(alice, bob, {"MPTokenIssuanceUnlock"}));
|
env(delegate::set(alice, bob, {"MPTokenIssuanceUnlock"}));
|
||||||
@@ -1387,7 +1366,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{.account = alice,
|
{.account = alice,
|
||||||
.flags = tfMPTLock,
|
.flags = tfMPTLock,
|
||||||
.delegate = bob,
|
.delegate = bob,
|
||||||
.err = tecNO_DELEGATE_PERMISSION});
|
.err = terNO_DELEGATE_PERMISSION});
|
||||||
// bob now has lock permission, but does not have unlock permission
|
// bob now has lock permission, but does not have unlock permission
|
||||||
env(delegate::set(alice, bob, {"MPTokenIssuanceLock"}));
|
env(delegate::set(alice, bob, {"MPTokenIssuanceLock"}));
|
||||||
env.close();
|
env.close();
|
||||||
@@ -1396,7 +1375,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{.account = alice,
|
{.account = alice,
|
||||||
.flags = tfMPTUnlock,
|
.flags = tfMPTUnlock,
|
||||||
.delegate = bob,
|
.delegate = bob,
|
||||||
.err = tecNO_DELEGATE_PERMISSION});
|
.err = terNO_DELEGATE_PERMISSION});
|
||||||
|
|
||||||
// now bob can lock and unlock
|
// now bob can lock and unlock
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1429,7 +1408,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{.account = alice,
|
{.account = alice,
|
||||||
.flags = tfMPTUnlock,
|
.flags = tfMPTUnlock,
|
||||||
.delegate = bob,
|
.delegate = bob,
|
||||||
.err = tecNO_DELEGATE_PERMISSION});
|
.err = terNO_DELEGATE_PERMISSION});
|
||||||
|
|
||||||
// alice gives bob some unrelated permission with
|
// alice gives bob some unrelated permission with
|
||||||
// MPTokenIssuanceLock
|
// MPTokenIssuanceLock
|
||||||
@@ -1443,7 +1422,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{.account = alice,
|
{.account = alice,
|
||||||
.flags = tfMPTUnlock,
|
.flags = tfMPTUnlock,
|
||||||
.delegate = bob,
|
.delegate = bob,
|
||||||
.err = tecNO_DELEGATE_PERMISSION});
|
.err = terNO_DELEGATE_PERMISSION});
|
||||||
|
|
||||||
// alice add MPTokenIssuanceSet to permissions
|
// alice add MPTokenIssuanceSet to permissions
|
||||||
env(delegate::set(
|
env(delegate::set(
|
||||||
@@ -1519,29 +1498,96 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
testcase("test single sign with bad secret");
|
testcase("test single sign with bad secret");
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
|
|
||||||
Env env(*this);
|
{
|
||||||
Account alice{"alice"};
|
Env env(*this);
|
||||||
Account bob{"bob"};
|
Account alice{"alice"};
|
||||||
Account carol{"carol"};
|
Account bob{"bob"};
|
||||||
env.fund(XRP(100000), alice, bob, carol);
|
Account carol{"carol"};
|
||||||
env.close();
|
env.fund(XRP(100000), alice, bob, carol);
|
||||||
|
env.close();
|
||||||
|
|
||||||
env(delegate::set(alice, bob, {"Payment"}));
|
env(delegate::set(alice, bob, {"Payment"}));
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
auto aliceBalance = env.balance(alice);
|
auto aliceBalance = env.balance(alice);
|
||||||
auto bobBalance = env.balance(bob);
|
auto bobBalance = env.balance(bob);
|
||||||
auto carolBalance = env.balance(carol);
|
auto carolBalance = env.balance(carol);
|
||||||
|
|
||||||
env(pay(alice, carol, XRP(100)),
|
env(pay(alice, carol, XRP(100)),
|
||||||
fee(XRP(10)),
|
fee(XRP(10)),
|
||||||
delegate::as(bob),
|
delegate::as(bob),
|
||||||
sig(alice),
|
sig(alice),
|
||||||
ter(tefBAD_AUTH));
|
ter(tefBAD_AUTH));
|
||||||
env.close();
|
env.close();
|
||||||
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
||||||
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
||||||
BEAST_EXPECT(env.balance(carol) == carolBalance);
|
BEAST_EXPECT(env.balance(carol) == carolBalance);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Env env(*this);
|
||||||
|
Account alice{"alice"}, bob{"bob"}, carol{"carol"};
|
||||||
|
env.fund(XRP(100000), alice, bob, carol);
|
||||||
|
env.close();
|
||||||
|
|
||||||
|
env(delegate::set(alice, bob, {"TrustSet"}));
|
||||||
|
env.close();
|
||||||
|
|
||||||
|
auto aliceBalance = env.balance(alice);
|
||||||
|
auto bobBalance = env.balance(bob);
|
||||||
|
auto carolBalance = env.balance(carol);
|
||||||
|
|
||||||
|
env(pay(alice, carol, XRP(100)),
|
||||||
|
fee(XRP(10)),
|
||||||
|
delegate::as(bob),
|
||||||
|
sig(carol),
|
||||||
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
env.close();
|
||||||
|
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
||||||
|
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
||||||
|
BEAST_EXPECT(env.balance(carol) == carolBalance);
|
||||||
|
|
||||||
|
env(pay(alice, carol, XRP(100)),
|
||||||
|
fee(XRP(10)),
|
||||||
|
delegate::as(bob),
|
||||||
|
sig(alice),
|
||||||
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
env.close();
|
||||||
|
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
||||||
|
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
||||||
|
BEAST_EXPECT(env.balance(carol) == carolBalance);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Env env(*this);
|
||||||
|
Account alice{"alice"}, bob{"bob"}, carol{"carol"};
|
||||||
|
env.fund(XRP(100000), alice, bob, carol);
|
||||||
|
env.close();
|
||||||
|
|
||||||
|
auto aliceBalance = env.balance(alice);
|
||||||
|
auto bobBalance = env.balance(bob);
|
||||||
|
auto carolBalance = env.balance(carol);
|
||||||
|
|
||||||
|
env(pay(alice, carol, XRP(100)),
|
||||||
|
fee(XRP(10)),
|
||||||
|
delegate::as(bob),
|
||||||
|
sig(alice),
|
||||||
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
env.close();
|
||||||
|
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
||||||
|
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
||||||
|
BEAST_EXPECT(env.balance(carol) == carolBalance);
|
||||||
|
|
||||||
|
env(pay(alice, carol, XRP(100)),
|
||||||
|
fee(XRP(10)),
|
||||||
|
delegate::as(bob),
|
||||||
|
sig(carol),
|
||||||
|
ter(terNO_DELEGATE_PERMISSION));
|
||||||
|
env.close();
|
||||||
|
BEAST_EXPECT(env.balance(alice) == aliceBalance);
|
||||||
|
BEAST_EXPECT(env.balance(bob) == bobBalance);
|
||||||
|
BEAST_EXPECT(env.balance(carol) == carolBalance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1659,10 +1705,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
for (auto value : {0, 100000, 54321})
|
for (auto value : {0, 100000, 54321})
|
||||||
{
|
{
|
||||||
auto jv = buildRequest(value);
|
auto jv = buildRequest(value);
|
||||||
if (!features[fixDelegateV1_1])
|
env(jv, ter(temMALFORMED));
|
||||||
env(jv);
|
|
||||||
else
|
|
||||||
env(jv, ter(temMALFORMED));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1720,8 +1763,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{"VaultWithdraw", featureSingleAssetVault},
|
{"VaultWithdraw", featureSingleAssetVault},
|
||||||
{"VaultClawback", featureSingleAssetVault}};
|
{"VaultClawback", featureSingleAssetVault}};
|
||||||
|
|
||||||
// fixDelegateV1_1 post-amendment: can not delegate tx if any
|
// Can not delegate tx if any required feature disabled.
|
||||||
// required feature disabled.
|
|
||||||
{
|
{
|
||||||
auto txAmendmentDisabled = [&](FeatureBitset features,
|
auto txAmendmentDisabled = [&](FeatureBitset features,
|
||||||
std::string const& tx) {
|
std::string const& tx) {
|
||||||
@@ -1734,10 +1776,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
env.fund(XRP(100000), alice, bob);
|
env.fund(XRP(100000), alice, bob);
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
if (!features[fixDelegateV1_1])
|
env(delegate::set(alice, bob, {tx}), ter(temMALFORMED));
|
||||||
env(delegate::set(alice, bob, {tx}));
|
|
||||||
else
|
|
||||||
env(delegate::set(alice, bob, {tx}), ter(temMALFORMED));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto const& tx : txRequiredFeatures)
|
for (auto const& tx : txRequiredFeatures)
|
||||||
@@ -1786,10 +1825,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
"NFTokenCancelOffer",
|
"NFTokenCancelOffer",
|
||||||
"NFTokenAcceptOffer"})
|
"NFTokenAcceptOffer"})
|
||||||
{
|
{
|
||||||
if (!features[fixDelegateV1_1])
|
env(delegate::set(alice, bob, {tx}), ter(temMALFORMED));
|
||||||
env(delegate::set(alice, bob, {tx}));
|
|
||||||
else
|
|
||||||
env(delegate::set(alice, bob, {tx}), ter(temMALFORMED));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1823,17 +1859,16 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
{
|
{
|
||||||
FeatureBitset const all = jtx::testable_amendments();
|
FeatureBitset const all = jtx::testable_amendments();
|
||||||
|
|
||||||
testFeatureDisabled();
|
testFeatureDisabled(all - featurePermissionDelegationV1_1);
|
||||||
|
testFeatureDisabled(all);
|
||||||
testDelegateSet();
|
testDelegateSet();
|
||||||
testInvalidRequest(all);
|
testInvalidRequest(all);
|
||||||
testInvalidRequest(all - fixDelegateV1_1);
|
|
||||||
testReserve();
|
testReserve();
|
||||||
testFee();
|
testFee();
|
||||||
testSequence();
|
testSequence();
|
||||||
testAccountDelete();
|
testAccountDelete();
|
||||||
testDelegateTransaction();
|
testDelegateTransaction();
|
||||||
testPaymentGranular(all);
|
testPaymentGranular(all);
|
||||||
testPaymentGranular(all - fixDelegateV1_1);
|
|
||||||
testTrustSetGranular();
|
testTrustSetGranular();
|
||||||
testAccountSetGranular();
|
testAccountSetGranular();
|
||||||
testMPTokenIssuanceSetGranular();
|
testMPTokenIssuanceSetGranular();
|
||||||
@@ -1842,9 +1877,7 @@ class Delegate_test : public beast::unit_test::suite
|
|||||||
testMultiSign();
|
testMultiSign();
|
||||||
testMultiSignQuorumNotMet();
|
testMultiSignQuorumNotMet();
|
||||||
testPermissionValue(all);
|
testPermissionValue(all);
|
||||||
testPermissionValue(all - fixDelegateV1_1);
|
|
||||||
testTxReqireFeatures(all);
|
testTxReqireFeatures(all);
|
||||||
testTxReqireFeatures(all - fixDelegateV1_1);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
BEAST_DEFINE_TESTSUITE(Delegate, app, ripple);
|
BEAST_DEFINE_TESTSUITE(Delegate, app, ripple);
|
||||||
|
|||||||
@@ -855,9 +855,7 @@ public:
|
|||||||
|
|
||||||
// No cross:
|
// No cross:
|
||||||
{
|
{
|
||||||
TER const expectedCode = features[featureImmediateOfferKilled]
|
TER const expectedCode = tecKILLED;
|
||||||
? static_cast<TER>(tecKILLED)
|
|
||||||
: static_cast<TER>(tesSUCCESS);
|
|
||||||
env(offer(alice, XRP(1000), USD(1000)),
|
env(offer(alice, XRP(1000), USD(1000)),
|
||||||
txflags(tfImmediateOrCancel),
|
txflags(tfImmediateOrCancel),
|
||||||
ter(expectedCode));
|
ter(expectedCode));
|
||||||
@@ -5289,34 +5287,12 @@ public:
|
|||||||
testFillOrKill(features);
|
testFillOrKill(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
FeatureBitset const allFeatures{jtx::testable_amendments()};
|
||||||
run(std::uint32_t instance, bool last = false)
|
|
||||||
{
|
|
||||||
using namespace jtx;
|
|
||||||
static FeatureBitset const all{testable_amendments()};
|
|
||||||
static FeatureBitset const immediateOfferKilled{
|
|
||||||
featureImmediateOfferKilled};
|
|
||||||
FeatureBitset const fillOrKill{fixFillOrKill};
|
|
||||||
FeatureBitset const permDEX{featurePermissionedDEX};
|
|
||||||
|
|
||||||
static std::array<FeatureBitset, 5> const feats{
|
|
||||||
all - immediateOfferKilled - permDEX,
|
|
||||||
all - immediateOfferKilled - fillOrKill - permDEX,
|
|
||||||
all - fillOrKill - permDEX,
|
|
||||||
all - permDEX,
|
|
||||||
all};
|
|
||||||
|
|
||||||
if (BEAST_EXPECT(instance < feats.size()))
|
|
||||||
{
|
|
||||||
testAll(feats[instance]);
|
|
||||||
}
|
|
||||||
BEAST_EXPECT(!last || instance == feats.size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
run(0);
|
testAll(allFeatures - featurePermissionedDEX);
|
||||||
testFalseAssert();
|
testFalseAssert();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -5326,25 +5302,7 @@ class OfferWOSmallQOffers_test : public OfferBaseUtil_test
|
|||||||
void
|
void
|
||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
OfferBaseUtil_test::run(1);
|
testAll(allFeatures - fixFillOrKill - featurePermissionedDEX);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class OfferWOFillOrKill_test : public OfferBaseUtil_test
|
|
||||||
{
|
|
||||||
void
|
|
||||||
run() override
|
|
||||||
{
|
|
||||||
OfferBaseUtil_test::run(2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class OfferWOPermDEX_test : public OfferBaseUtil_test
|
|
||||||
{
|
|
||||||
void
|
|
||||||
run() override
|
|
||||||
{
|
|
||||||
OfferBaseUtil_test::run(3);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5353,7 +5311,7 @@ class OfferAllFeatures_test : public OfferBaseUtil_test
|
|||||||
void
|
void
|
||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
OfferBaseUtil_test::run(4, true);
|
testAll(allFeatures);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5364,12 +5322,9 @@ class Offer_manual_test : public OfferBaseUtil_test
|
|||||||
{
|
{
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
FeatureBitset const all{testable_amendments()};
|
FeatureBitset const all{testable_amendments()};
|
||||||
FeatureBitset const immediateOfferKilled{featureImmediateOfferKilled};
|
|
||||||
FeatureBitset const fillOrKill{fixFillOrKill};
|
FeatureBitset const fillOrKill{fixFillOrKill};
|
||||||
FeatureBitset const permDEX{featurePermissionedDEX};
|
FeatureBitset const permDEX{featurePermissionedDEX};
|
||||||
|
|
||||||
testAll(all - immediateOfferKilled - permDEX);
|
|
||||||
testAll(all - immediateOfferKilled - fillOrKill - permDEX);
|
|
||||||
testAll(all - fillOrKill - permDEX);
|
testAll(all - fillOrKill - permDEX);
|
||||||
testAll(all - permDEX);
|
testAll(all - permDEX);
|
||||||
testAll(all);
|
testAll(all);
|
||||||
@@ -5378,8 +5333,6 @@ class Offer_manual_test : public OfferBaseUtil_test
|
|||||||
|
|
||||||
BEAST_DEFINE_TESTSUITE_PRIO(OfferBaseUtil, app, ripple, 2);
|
BEAST_DEFINE_TESTSUITE_PRIO(OfferBaseUtil, app, ripple, 2);
|
||||||
BEAST_DEFINE_TESTSUITE_PRIO(OfferWOSmallQOffers, app, ripple, 2);
|
BEAST_DEFINE_TESTSUITE_PRIO(OfferWOSmallQOffers, app, ripple, 2);
|
||||||
BEAST_DEFINE_TESTSUITE_PRIO(OfferWOFillOrKill, app, ripple, 2);
|
|
||||||
BEAST_DEFINE_TESTSUITE_PRIO(OfferWOPermDEX, app, ripple, 2);
|
|
||||||
BEAST_DEFINE_TESTSUITE_PRIO(OfferAllFeatures, app, ripple, 2);
|
BEAST_DEFINE_TESTSUITE_PRIO(OfferAllFeatures, app, ripple, 2);
|
||||||
BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Offer_manual, app, ripple, 20);
|
BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Offer_manual, app, ripple, 20);
|
||||||
|
|
||||||
|
|||||||
@@ -80,12 +80,8 @@ public:
|
|||||||
auto const bob = Account{"bob"};
|
auto const bob = Account{"bob"};
|
||||||
auto const USD = gw["USD"];
|
auto const USD = gw["USD"];
|
||||||
|
|
||||||
// Make one test run without fixReducedOffersV1 and one with.
|
|
||||||
for (FeatureBitset features :
|
|
||||||
{testable_amendments() - fixReducedOffersV1,
|
|
||||||
testable_amendments() | fixReducedOffersV1})
|
|
||||||
{
|
{
|
||||||
Env env{*this, features};
|
Env env{*this, testable_amendments()};
|
||||||
|
|
||||||
// Make sure none of the offers we generate are under funded.
|
// Make sure none of the offers we generate are under funded.
|
||||||
env.fund(XRP(10'000'000), gw, alice, bob);
|
env.fund(XRP(10'000'000), gw, alice, bob);
|
||||||
@@ -208,19 +204,9 @@ public:
|
|||||||
blockedCount += exerciseOfferPair(alicesOffer, bobsOffer);
|
blockedCount += exerciseOfferPair(alicesOffer, bobsOffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If fixReducedOffersV1 is enabled, then none of the test cases
|
// None of the test cases should produce a potentially blocking
|
||||||
// should produce a potentially blocking rate.
|
// rate.
|
||||||
//
|
BEAST_EXPECT(blockedCount == 0);
|
||||||
// Also verify that if fixReducedOffersV1 is not enabled then
|
|
||||||
// some of the test cases produced a potentially blocking rate.
|
|
||||||
if (features[fixReducedOffersV1])
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedCount == 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedCount >= 170);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,13 +222,9 @@ public:
|
|||||||
auto const bob = Account{"bob"};
|
auto const bob = Account{"bob"};
|
||||||
auto const USD = gw["USD"];
|
auto const USD = gw["USD"];
|
||||||
|
|
||||||
// Make one test run without fixReducedOffersV1 and one with.
|
|
||||||
for (FeatureBitset features :
|
|
||||||
{testable_amendments() - fixReducedOffersV1,
|
|
||||||
testable_amendments() | fixReducedOffersV1})
|
|
||||||
{
|
{
|
||||||
// Make sure none of the offers we generate are under funded.
|
// Make sure none of the offers we generate are under funded.
|
||||||
Env env{*this, features};
|
Env env{*this, testable_amendments()};
|
||||||
env.fund(XRP(10'000'000), gw, alice, bob);
|
env.fund(XRP(10'000'000), gw, alice, bob);
|
||||||
env.close();
|
env.close();
|
||||||
|
|
||||||
@@ -367,19 +349,9 @@ public:
|
|||||||
blockedCount += exerciseOfferPair(aliceOffer, bobsOffer);
|
blockedCount += exerciseOfferPair(aliceOffer, bobsOffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If fixReducedOffersV1 is enabled, then none of the test cases
|
// None of the test cases should produce a potentially blocking
|
||||||
// should produce a potentially blocking rate.
|
// rate.
|
||||||
//
|
BEAST_EXPECT(blockedCount == 0);
|
||||||
// Also verify that if fixReducedOffersV1 is not enabled then
|
|
||||||
// some of the test cases produced a potentially blocking rate.
|
|
||||||
if (features[fixReducedOffersV1])
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedCount == 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedCount > 10);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,9 +361,6 @@ public:
|
|||||||
testcase("exercise underfunded XRP/IOU offer Q change");
|
testcase("exercise underfunded XRP/IOU offer Q change");
|
||||||
|
|
||||||
// Bob places an offer that is not fully funded.
|
// Bob places an offer that is not fully funded.
|
||||||
//
|
|
||||||
// This unit test compares the behavior of this situation before and
|
|
||||||
// after applying the fixReducedOffersV1 amendment.
|
|
||||||
|
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
auto const alice = Account{"alice"};
|
auto const alice = Account{"alice"};
|
||||||
@@ -399,12 +368,8 @@ public:
|
|||||||
auto const gw = Account{"gw"};
|
auto const gw = Account{"gw"};
|
||||||
auto const USD = gw["USD"];
|
auto const USD = gw["USD"];
|
||||||
|
|
||||||
// Make one test run without fixReducedOffersV1 and one with.
|
|
||||||
for (FeatureBitset features :
|
|
||||||
{testable_amendments() - fixReducedOffersV1,
|
|
||||||
testable_amendments() | fixReducedOffersV1})
|
|
||||||
{
|
{
|
||||||
Env env{*this, features};
|
Env env{*this, testable_amendments()};
|
||||||
|
|
||||||
env.fund(XRP(10000), alice, bob, gw);
|
env.fund(XRP(10000), alice, bob, gw);
|
||||||
env.close();
|
env.close();
|
||||||
@@ -470,19 +435,9 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If fixReducedOffersV1 is enabled, then none of the test cases
|
// None of the test cases should produce a potentially blocking
|
||||||
// should produce a potentially blocking rate.
|
// rate.
|
||||||
//
|
BEAST_EXPECT(blockedOrderBookCount == 0);
|
||||||
// Also verify that if fixReducedOffersV1 is not enabled then
|
|
||||||
// some of the test cases produced a potentially blocking rate.
|
|
||||||
if (features[fixReducedOffersV1])
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedOrderBookCount == 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedOrderBookCount > 15);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,9 +447,6 @@ public:
|
|||||||
testcase("exercise underfunded IOU/IOU offer Q change");
|
testcase("exercise underfunded IOU/IOU offer Q change");
|
||||||
|
|
||||||
// Bob places an IOU/IOU offer that is not fully funded.
|
// Bob places an IOU/IOU offer that is not fully funded.
|
||||||
//
|
|
||||||
// This unit test compares the behavior of this situation before and
|
|
||||||
// after applying the fixReducedOffersV1 amendment.
|
|
||||||
|
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
@@ -507,12 +459,8 @@ public:
|
|||||||
|
|
||||||
STAmount const tinyUSD(USD.issue(), /*mantissa*/ 1, /*exponent*/ -81);
|
STAmount const tinyUSD(USD.issue(), /*mantissa*/ 1, /*exponent*/ -81);
|
||||||
|
|
||||||
// Make one test run without fixReducedOffersV1 and one with.
|
|
||||||
for (FeatureBitset features :
|
|
||||||
{testable_amendments() - fixReducedOffersV1,
|
|
||||||
testable_amendments() | fixReducedOffersV1})
|
|
||||||
{
|
{
|
||||||
Env env{*this, features};
|
Env env{*this, testable_amendments()};
|
||||||
|
|
||||||
env.fund(XRP(10000), alice, bob, gw);
|
env.fund(XRP(10000), alice, bob, gw);
|
||||||
env.close();
|
env.close();
|
||||||
@@ -594,19 +542,9 @@ public:
|
|||||||
env.close();
|
env.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If fixReducedOffersV1 is enabled, then none of the test cases
|
// None of the test cases should produce a potentially blocking
|
||||||
// should produce a potentially blocking rate.
|
// rate.
|
||||||
//
|
BEAST_EXPECT(blockedOrderBookCount == 0);
|
||||||
// Also verify that if fixReducedOffersV1 is not enabled then
|
|
||||||
// some of the test cases produced a potentially blocking rate.
|
|
||||||
if (features[fixReducedOffersV1])
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedOrderBookCount == 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BEAST_EXPECT(blockedOrderBookCount > 20);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
#include <xrpld/app/misc/SHAMapStore.h>
|
#include <xrpld/app/misc/SHAMapStore.h>
|
||||||
#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
|
#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
|
||||||
#include <xrpld/core/ConfigSections.h>
|
#include <xrpld/core/ConfigSections.h>
|
||||||
#include <xrpld/nodestore/detail/DatabaseRotatingImp.h>
|
|
||||||
|
|
||||||
|
#include <xrpl/nodestore/detail/DatabaseRotatingImp.h>
|
||||||
#include <xrpl/protocol/jss.h>
|
#include <xrpl/protocol/jss.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|||||||
@@ -27,52 +27,12 @@ class SetRegularKey_test : public beast::unit_test::suite
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void
|
void
|
||||||
testDisableMasterKey()
|
testDisabledMasterKey()
|
||||||
{
|
{
|
||||||
using namespace test::jtx;
|
using namespace test::jtx;
|
||||||
|
|
||||||
testcase("Set regular key");
|
testcase("Set regular key");
|
||||||
Env env{*this, testable_amendments() - fixMasterKeyAsRegularKey};
|
Env env{*this, testable_amendments()};
|
||||||
Account const alice("alice");
|
|
||||||
Account const bob("bob");
|
|
||||||
env.fund(XRP(10000), alice, bob);
|
|
||||||
|
|
||||||
env(regkey(alice, bob));
|
|
||||||
auto const ar = env.le(alice);
|
|
||||||
BEAST_EXPECT(
|
|
||||||
ar->isFieldPresent(sfRegularKey) &&
|
|
||||||
(ar->getAccountID(sfRegularKey) == bob.id()));
|
|
||||||
|
|
||||||
env(noop(alice), sig(bob));
|
|
||||||
env(noop(alice), sig(alice));
|
|
||||||
|
|
||||||
testcase("Disable master key");
|
|
||||||
env(fset(alice, asfDisableMaster), sig(alice));
|
|
||||||
env(noop(alice), sig(bob));
|
|
||||||
env(noop(alice), sig(alice), ter(tefMASTER_DISABLED));
|
|
||||||
|
|
||||||
testcase("Re-enable master key");
|
|
||||||
env(fclear(alice, asfDisableMaster),
|
|
||||||
sig(alice),
|
|
||||||
ter(tefMASTER_DISABLED));
|
|
||||||
|
|
||||||
env(fclear(alice, asfDisableMaster), sig(bob));
|
|
||||||
env(noop(alice), sig(bob));
|
|
||||||
env(noop(alice), sig(alice));
|
|
||||||
|
|
||||||
testcase("Revoke regular key");
|
|
||||||
env(regkey(alice, disabled));
|
|
||||||
env(noop(alice), sig(bob), ter(tefBAD_AUTH_MASTER));
|
|
||||||
env(noop(alice), sig(alice));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
testDisableMasterKeyAfterFix()
|
|
||||||
{
|
|
||||||
using namespace test::jtx;
|
|
||||||
|
|
||||||
testcase("Set regular key");
|
|
||||||
Env env{*this, testable_amendments() | fixMasterKeyAsRegularKey};
|
|
||||||
Account const alice("alice");
|
Account const alice("alice");
|
||||||
Account const bob("bob");
|
Account const bob("bob");
|
||||||
env.fund(XRP(10000), alice, bob);
|
env.fund(XRP(10000), alice, bob);
|
||||||
@@ -106,44 +66,11 @@ public:
|
|||||||
{
|
{
|
||||||
using namespace test::jtx;
|
using namespace test::jtx;
|
||||||
|
|
||||||
// See https://ripplelabs.atlassian.net/browse/RIPD-1721.
|
testcase("Set regular key to master key");
|
||||||
testcase(
|
Env env{*this, testable_amendments()};
|
||||||
"Set regular key to master key (before fixMasterKeyAsRegularKey)");
|
|
||||||
Env env{*this, testable_amendments() - fixMasterKeyAsRegularKey};
|
|
||||||
Account const alice("alice");
|
Account const alice("alice");
|
||||||
env.fund(XRP(10000), alice);
|
env.fund(XRP(10000), alice);
|
||||||
|
|
||||||
// Must be possible unless amendment `fixMasterKeyAsRegularKey` enabled.
|
|
||||||
env(regkey(alice, alice), sig(alice));
|
|
||||||
env(fset(alice, asfDisableMaster), sig(alice));
|
|
||||||
|
|
||||||
// No way to sign...
|
|
||||||
env(noop(alice), ter(tefMASTER_DISABLED));
|
|
||||||
env(noop(alice), sig(alice), ter(tefMASTER_DISABLED));
|
|
||||||
|
|
||||||
// ... until now.
|
|
||||||
env.enableFeature(fixMasterKeyAsRegularKey);
|
|
||||||
env(noop(alice));
|
|
||||||
env(noop(alice), sig(alice));
|
|
||||||
|
|
||||||
env(regkey(alice, disabled), ter(tecNO_ALTERNATIVE_KEY));
|
|
||||||
env(fclear(alice, asfDisableMaster));
|
|
||||||
env(regkey(alice, disabled));
|
|
||||||
env(fset(alice, asfDisableMaster), ter(tecNO_ALTERNATIVE_KEY));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
testDisableRegularKeyAfterFix()
|
|
||||||
{
|
|
||||||
using namespace test::jtx;
|
|
||||||
|
|
||||||
testcase(
|
|
||||||
"Set regular key to master key (after fixMasterKeyAsRegularKey)");
|
|
||||||
Env env{*this, testable_amendments() | fixMasterKeyAsRegularKey};
|
|
||||||
Account const alice("alice");
|
|
||||||
env.fund(XRP(10000), alice);
|
|
||||||
|
|
||||||
// Must be possible unless amendment `fixMasterKeyAsRegularKey` enabled.
|
|
||||||
env(regkey(alice, alice), ter(temBAD_REGKEY));
|
env(regkey(alice, alice), ter(temBAD_REGKEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,10 +180,8 @@ public:
|
|||||||
void
|
void
|
||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
testDisableMasterKey();
|
testDisabledMasterKey();
|
||||||
testDisableMasterKeyAfterFix();
|
|
||||||
testDisabledRegularKey();
|
testDisabledRegularKey();
|
||||||
testDisableRegularKeyAfterFix();
|
|
||||||
testPasswordSpent();
|
testPasswordSpent();
|
||||||
testUniversalMask();
|
testUniversalMask();
|
||||||
testTicketRegularKey();
|
testTicketRegularKey();
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public:
|
|||||||
{
|
{
|
||||||
using namespace jtx;
|
using namespace jtx;
|
||||||
|
|
||||||
Env env{*this, testable_amendments() | fixMasterKeyAsRegularKey};
|
Env env{*this, testable_amendments()};
|
||||||
Account const alice("alice", KeyType::ed25519);
|
Account const alice("alice", KeyType::ed25519);
|
||||||
Account const bob("bob", KeyType::secp256k1);
|
Account const bob("bob", KeyType::secp256k1);
|
||||||
Account const carol("carol");
|
Account const carol("carol");
|
||||||
|
|||||||
@@ -20,12 +20,11 @@
|
|||||||
#include <test/nodestore/TestBase.h>
|
#include <test/nodestore/TestBase.h>
|
||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/nodestore/DummyScheduler.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
#include <xrpld/unity/rocksdb.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/ByteUtilities.h>
|
#include <xrpl/basics/ByteUtilities.h>
|
||||||
|
#include <xrpl/basics/rocksdb.h>
|
||||||
#include <xrpl/beast/utility/temp_dir.h>
|
#include <xrpl/beast/utility/temp_dir.h>
|
||||||
|
#include <xrpl/nodestore/DummyScheduler.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
#include <test/nodestore/TestBase.h>
|
#include <test/nodestore/TestBase.h>
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/DecodedBlob.h>
|
#include <xrpl/nodestore/detail/DecodedBlob.h>
|
||||||
#include <xrpld/nodestore/detail/EncodedBlob.h>
|
#include <xrpl/nodestore/detail/EncodedBlob.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace NodeStore {
|
namespace NodeStore {
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/core/DatabaseCon.h>
|
#include <xrpld/core/DatabaseCon.h>
|
||||||
#include <xrpld/nodestore/DummyScheduler.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
|
|
||||||
#include <xrpl/beast/utility/temp_dir.h>
|
#include <xrpl/beast/utility/temp_dir.h>
|
||||||
|
#include <xrpl/nodestore/DummyScheduler.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,11 @@
|
|||||||
#include <test/nodestore/TestBase.h>
|
#include <test/nodestore/TestBase.h>
|
||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/nodestore/DummyScheduler.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/BasicConfig.h>
|
#include <xrpl/basics/BasicConfig.h>
|
||||||
#include <xrpl/basics/ByteUtilities.h>
|
#include <xrpl/basics/ByteUtilities.h>
|
||||||
#include <xrpl/beast/utility/temp_dir.h>
|
#include <xrpl/beast/utility/temp_dir.h>
|
||||||
|
#include <xrpl/nodestore/DummyScheduler.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|||||||
@@ -20,15 +20,14 @@
|
|||||||
#ifndef RIPPLE_NODESTORE_BASE_H_INCLUDED
|
#ifndef RIPPLE_NODESTORE_BASE_H_INCLUDED
|
||||||
#define RIPPLE_NODESTORE_BASE_H_INCLUDED
|
#define RIPPLE_NODESTORE_BASE_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/Backend.h>
|
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
#include <xrpld/nodestore/Types.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/StringUtilities.h>
|
#include <xrpl/basics/StringUtilities.h>
|
||||||
#include <xrpl/basics/random.h>
|
#include <xrpl/basics/random.h>
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
#include <xrpl/beast/utility/rngfill.h>
|
#include <xrpl/beast/utility/rngfill.h>
|
||||||
#include <xrpl/beast/xor_shift_engine.h>
|
#include <xrpl/beast/xor_shift_engine.h>
|
||||||
|
#include <xrpl/nodestore/Backend.h>
|
||||||
|
#include <xrpl/nodestore/Database.h>
|
||||||
|
#include <xrpl/nodestore/Types.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,6 @@
|
|||||||
#include <test/nodestore/TestBase.h>
|
#include <test/nodestore/TestBase.h>
|
||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/nodestore/DummyScheduler.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/BasicConfig.h>
|
#include <xrpl/basics/BasicConfig.h>
|
||||||
#include <xrpl/basics/ByteUtilities.h>
|
#include <xrpl/basics/ByteUtilities.h>
|
||||||
#include <xrpl/basics/safe_cast.h>
|
#include <xrpl/basics/safe_cast.h>
|
||||||
@@ -30,6 +27,8 @@
|
|||||||
#include <xrpl/beast/unit_test/thread.h>
|
#include <xrpl/beast/unit_test/thread.h>
|
||||||
#include <xrpl/beast/utility/temp_dir.h>
|
#include <xrpl/beast/utility/temp_dir.h>
|
||||||
#include <xrpl/beast/xor_shift_engine.h>
|
#include <xrpl/beast/xor_shift_engine.h>
|
||||||
|
#include <xrpl/nodestore/DummyScheduler.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/codec.h>
|
|
||||||
#include <xrpld/unity/rocksdb.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
#include <xrpl/basics/rocksdb.h>
|
||||||
#include <xrpl/beast/clock/basic_seconds_clock.h>
|
#include <xrpl/beast/clock/basic_seconds_clock.h>
|
||||||
#include <xrpl/beast/core/LexicalCast.h>
|
#include <xrpl/beast/core/LexicalCast.h>
|
||||||
#include <xrpl/beast/rfc2616.h>
|
#include <xrpl/beast/rfc2616.h>
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
|
#include <xrpl/nodestore/detail/codec.h>
|
||||||
|
|
||||||
#include <boost/beast/core/string.hpp>
|
#include <boost/beast/core/string.hpp>
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
|
|||||||
@@ -17,9 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include <xrpld/nodestore/detail/varint.h>
|
|
||||||
|
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
|
#include <xrpl/nodestore/detail/varint.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include <xrpld/overlay/detail/Handshake.h>
|
#include <xrpld/overlay/detail/Handshake.h>
|
||||||
#include <xrpld/overlay/detail/ProtocolMessage.h>
|
#include <xrpld/overlay/detail/ProtocolMessage.h>
|
||||||
#include <xrpld/overlay/detail/ZeroCopyStream.h>
|
#include <xrpld/overlay/detail/ZeroCopyStream.h>
|
||||||
#include <xrpld/shamap/SHAMapNodeID.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/random.h>
|
#include <xrpl/basics/random.h>
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
@@ -42,6 +41,7 @@
|
|||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
#include <xrpl/protocol/jss.h>
|
#include <xrpl/protocol/jss.h>
|
||||||
#include <xrpl/protocol/messages.h>
|
#include <xrpl/protocol/messages.h>
|
||||||
|
#include <xrpl/shamap/SHAMapNodeID.h>
|
||||||
|
|
||||||
#include <boost/asio/ip/address_v4.hpp>
|
#include <boost/asio/ip/address_v4.hpp>
|
||||||
#include <boost/beast/core/multi_buffer.hpp>
|
#include <boost/beast/core/multi_buffer.hpp>
|
||||||
|
|||||||
@@ -332,23 +332,6 @@ class Feature_test : public beast::unit_test::suite
|
|||||||
result[jss::error_message] ==
|
result[jss::error_message] ==
|
||||||
"You don't have permission for this command.");
|
"You don't have permission for this command.");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
std::string const feature =
|
|
||||||
"C4483A1896170C66C098DEA5B0E024309C60DC960DE5F01CD7AF986AA3D9AD"
|
|
||||||
"37";
|
|
||||||
Json::Value params;
|
|
||||||
params[jss::feature] = feature;
|
|
||||||
auto const result =
|
|
||||||
env.rpc("json", "feature", to_string(params))[jss::result];
|
|
||||||
BEAST_EXPECT(result.isMember(feature));
|
|
||||||
auto const amendmentResult = result[feature];
|
|
||||||
BEAST_EXPECT(amendmentResult[jss::enabled].asBool() == false);
|
|
||||||
BEAST_EXPECT(amendmentResult[jss::supported].asBool() == true);
|
|
||||||
BEAST_EXPECT(
|
|
||||||
amendmentResult[jss::name].asString() ==
|
|
||||||
"fixMasterKeyAsRegularKey");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -20,15 +20,14 @@
|
|||||||
#include <test/shamap/common.h>
|
#include <test/shamap/common.h>
|
||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
#include <xrpld/shamap/SHAMapSyncFilter.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/UnorderedContainers.h>
|
#include <xrpl/basics/UnorderedContainers.h>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/basics/random.h>
|
#include <xrpl/basics/random.h>
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
#include <xrpl/beast/xor_shift_engine.h>
|
#include <xrpl/beast/xor_shift_engine.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
#include <xrpl/shamap/SHAMapSyncFilter.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|||||||
@@ -20,12 +20,11 @@
|
|||||||
#include <test/shamap/common.h>
|
#include <test/shamap/common.h>
|
||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
#include <xrpld/shamap/SHAMapItem.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/random.h>
|
#include <xrpl/basics/random.h>
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
#include <xrpl/beast/xor_shift_engine.h>
|
#include <xrpl/beast/xor_shift_engine.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
#include <xrpl/shamap/SHAMapItem.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace tests {
|
namespace tests {
|
||||||
|
|||||||
@@ -20,12 +20,11 @@
|
|||||||
#include <test/shamap/common.h>
|
#include <test/shamap/common.h>
|
||||||
#include <test/unit_test/SuiteJournal.h>
|
#include <test/unit_test/SuiteJournal.h>
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/Blob.h>
|
#include <xrpl/basics/Blob.h>
|
||||||
#include <xrpl/basics/Buffer.h>
|
#include <xrpl/basics/Buffer.h>
|
||||||
#include <xrpl/beast/unit_test.h>
|
#include <xrpl/beast/unit_test.h>
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace tests {
|
namespace tests {
|
||||||
|
|||||||
@@ -20,11 +20,10 @@
|
|||||||
#ifndef RIPPLE_SHAMAP_TESTS_COMMON_H_INCLUDED
|
#ifndef RIPPLE_SHAMAP_TESTS_COMMON_H_INCLUDED
|
||||||
#define RIPPLE_SHAMAP_TESTS_COMMON_H_INCLUDED
|
#define RIPPLE_SHAMAP_TESTS_COMMON_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/nodestore/DummyScheduler.h>
|
|
||||||
#include <xrpld/nodestore/Manager.h>
|
|
||||||
#include <xrpld/shamap/Family.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/chrono.h>
|
#include <xrpl/basics/chrono.h>
|
||||||
|
#include <xrpl/nodestore/DummyScheduler.h>
|
||||||
|
#include <xrpl/nodestore/Manager.h>
|
||||||
|
#include <xrpl/shamap/Family.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace tests {
|
namespace tests {
|
||||||
|
|||||||
@@ -20,9 +20,8 @@
|
|||||||
#ifndef RIPPLE_APP_CONSENSUS_RCLCENSORSHIPDETECTOR_H_INCLUDED
|
#ifndef RIPPLE_APP_CONSENSUS_RCLCENSORSHIPDETECTOR_H_INCLUDED
|
||||||
#define RIPPLE_APP_CONSENSUS_RCLCENSORSHIPDETECTOR_H_INCLUDED
|
#define RIPPLE_APP_CONSENSUS_RCLCENSORSHIPDETECTOR_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/algorithm.h>
|
#include <xrpl/basics/algorithm.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|||||||
@@ -28,10 +28,10 @@
|
|||||||
#include <xrpld/app/misc/NegativeUNLVote.h>
|
#include <xrpld/app/misc/NegativeUNLVote.h>
|
||||||
#include <xrpld/consensus/Consensus.h>
|
#include <xrpld/consensus/Consensus.h>
|
||||||
#include <xrpld/core/JobQueue.h>
|
#include <xrpld/core/JobQueue.h>
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
|
||||||
|
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
#include <xrpl/protocol/RippleLedgerHash.h>
|
#include <xrpl/protocol/RippleLedgerHash.h>
|
||||||
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef RIPPLE_APP_CONSENSUS_RCLCXTX_H_INCLUDED
|
#ifndef RIPPLE_APP_CONSENSUS_RCLCXTX_H_INCLUDED
|
||||||
#define RIPPLE_APP_CONSENSUS_RCLCXTX_H_INCLUDED
|
#define RIPPLE_APP_CONSENSUS_RCLCXTX_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/shamap/SHAMap.h>
|
#include <xrpl/shamap/SHAMap.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,9 @@
|
|||||||
#define RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED
|
#define RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/app/ledger/AbstractFetchPackContainer.h>
|
#include <xrpld/app/ledger/AbstractFetchPackContainer.h>
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
#include <xrpld/shamap/SHAMapSyncFilter.h>
|
#include <xrpl/nodestore/Database.h>
|
||||||
|
#include <xrpl/shamap/SHAMapSyncFilter.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
#include <xrpld/app/misc/NetworkOPs.h>
|
#include <xrpld/app/misc/NetworkOPs.h>
|
||||||
#include <xrpld/app/misc/Transaction.h>
|
#include <xrpld/app/misc/Transaction.h>
|
||||||
#include <xrpld/core/JobQueue.h>
|
#include <xrpld/core/JobQueue.h>
|
||||||
#include <xrpld/nodestore/Database.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/Log.h>
|
#include <xrpl/basics/Log.h>
|
||||||
|
#include <xrpl/nodestore/Database.h>
|
||||||
#include <xrpl/protocol/HashPrefix.h>
|
#include <xrpl/protocol/HashPrefix.h>
|
||||||
#include <xrpl/protocol/digest.h>
|
#include <xrpl/protocol/digest.h>
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
#define RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED
|
#define RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpld/app/main/Application.h>
|
#include <xrpld/app/main/Application.h>
|
||||||
#include <xrpld/shamap/SHAMapSyncFilter.h>
|
|
||||||
|
|
||||||
#include <xrpl/basics/TaggedCache.h>
|
#include <xrpl/basics/TaggedCache.h>
|
||||||
|
#include <xrpl/shamap/SHAMapSyncFilter.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user