mirror of
https://github.com/Xahau/xahaud.git
synced 2026-09-26 07:10:15 +00:00
Compare commits
2 Commits
dev
...
manifestKe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c235ec8b1 | ||
|
|
37dfdc64b3 |
@@ -38,6 +38,7 @@
|
||||
#define KEYLET_HOOK_DEFINITION 24
|
||||
#define KEYLET_HOOK_STATE_DIR 25
|
||||
#define KEYLET_CRON 26
|
||||
#define KEYLET_MANIFEST 37
|
||||
|
||||
#define COMPARE_EQUAL 1U
|
||||
#define COMPARE_LESS 2U
|
||||
|
||||
@@ -313,6 +313,7 @@ enum keylet_code : uint32_t {
|
||||
MPTOKEN = 34,
|
||||
CREDENTIAL = 35,
|
||||
PERMISSIONED_DOMAIN = 36,
|
||||
MANIFEST = 37,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -2212,6 +2212,35 @@ DEFINE_HOOK_FUNCTION(
|
||||
return serialize_keylet(kl, memory, write_ptr, write_len);
|
||||
}
|
||||
|
||||
// keylets that take a validator public key
|
||||
case keylet_code::MANIFEST: {
|
||||
if (!applyCtx.view().rules().enabled(featureOnChainManifests))
|
||||
return INVALID_ARGUMENT;
|
||||
|
||||
if (a == 0 || b == 0)
|
||||
return INVALID_ARGUMENT;
|
||||
|
||||
if (c != 0 || d != 0 || e != 0 || f != 0)
|
||||
return INVALID_ARGUMENT;
|
||||
|
||||
uint32_t read_ptr = a, read_len = b;
|
||||
|
||||
if (NOT_IN_BOUNDS(read_ptr, read_len, memory_length))
|
||||
return OUT_OF_BOUNDS;
|
||||
|
||||
ripple::Slice const pkSlice{memory + read_ptr, read_len};
|
||||
|
||||
// Reject anything that is not a well-formed public key before
|
||||
// constructing one: the PublicKey ctor throws on bad input.
|
||||
if (!publicKeyType(pkSlice))
|
||||
return INVALID_ARGUMENT;
|
||||
|
||||
ripple::Keylet kl =
|
||||
ripple::keylet::manifest(ripple::PublicKey(pkSlice));
|
||||
|
||||
return serialize_keylet(kl, memory, write_ptr, write_len);
|
||||
}
|
||||
|
||||
// keylets that take 20 byte account id, and (4 byte uint for 32
|
||||
// byte hash)
|
||||
case keylet_code::ORACLE: {
|
||||
|
||||
Reference in New Issue
Block a user