Add modification type to GetLedger gRPC method

* Specify whether a ledger object was created, modified or deleted.
This commit is contained in:
CJ Cobb
2021-01-20 14:30:47 -05:00
committed by manojsdoshi
parent a5c4684273
commit 8c78c83d05
2 changed files with 17 additions and 0 deletions

View File

@@ -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

View File

@@ -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);
}