Skip to content

Commit

Permalink
add mpt id
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Oct 16, 2024
1 parent 0bf5b42 commit 21061e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/test/rpc/LedgerRPC_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,9 @@ class LedgerRPC_test : public beast::unit_test::suite
BEAST_EXPECT(
jrr[jss::node][sfMPTokenMetadata.jsonName] ==
strHex(std::string{"123"}));
BEAST_EXPECT(
jrr[jss::node][jss::mpt_issuance_id] ==
strHex(mptAlice.issuanceID()));
}
{
// Request an index that is not a MPTIssuance.
Expand Down
7 changes: 6 additions & 1 deletion src/xrpld/rpc/handlers/LedgerEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,12 @@ doLedgerEntry(RPC::JsonContext& context)
}
else
{
jvResult[jss::node] = sleNode->getJson(JsonOptions::none);
auto sleJson = sleNode->getJson(JsonOptions::none);
if (sleNode->getType() == ltMPTOKEN_ISSUANCE)
sleJson[jss::mpt_issuance_id] = to_string(makeMptID(
(*sleNode)[sfSequence], sleNode->getAccountID(sfIssuer)));

jvResult[jss::node] = sleJson;
jvResult[jss::index] = to_string(uNodeIndex);
}
}
Expand Down

0 comments on commit 21061e2

Please sign in to comment.