mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add modification type to GetLedger gRPC method
* Specify whether a ledger object was created, modified or deleted.
This commit is contained in:
@@ -45,6 +45,16 @@ message RawLedgerObject
|
||||
|
||||
// Key of the ledger object
|
||||
bytes key = 2;
|
||||
|
||||
enum ModificationType
|
||||
{
|
||||
UNSPECIFIED = 0;
|
||||
CREATED = 1;
|
||||
MODIFIED = 2;
|
||||
DELETED = 3;
|
||||
}
|
||||
|
||||
ModificationType mod_type = 3;
|
||||
}
|
||||
|
||||
message RawLedgerObjects
|
||||
|
||||
@@ -205,6 +205,13 @@ doLedgerGrpc(RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerRequest>& context)
|
||||
assert(inDesired->size() > 0);
|
||||
obj->set_data(inDesired->data(), inDesired->size());
|
||||
}
|
||||
if (inBase && inDesired)
|
||||
obj->set_mod_type(
|
||||
org::xrpl::rpc::v1::RawLedgerObject::MODIFIED);
|
||||
else if (inBase && !inDesired)
|
||||
obj->set_mod_type(org::xrpl::rpc::v1::RawLedgerObject::DELETED);
|
||||
else
|
||||
obj->set_mod_type(org::xrpl::rpc::v1::RawLedgerObject::CREATED);
|
||||
}
|
||||
response.set_skiplist_included(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user