Implement DID (#967)

Fix #918
This commit is contained in:
cyan317
2023-11-03 09:40:40 +00:00
committed by GitHub
parent 25d9e3cc36
commit fa660ef400
12 changed files with 95 additions and 29 deletions

View File

@@ -1486,6 +1486,22 @@ static auto
generateTransactionTypeTestValues()
{
return std::vector<AccountTxTransactionBundle>{
AccountTxTransactionBundle{
"DIDSet",
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated",
"tx_type": "DIDSet"
})",
"[]"},
AccountTxTransactionBundle{
"DIDDelete",
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated",
"tx_type": "DIDDelete"
})",
"[]"},
AccountTxTransactionBundle{
"AccountSet",
R"({

View File

@@ -82,6 +82,14 @@ generateTestValuesForParametersTest()
"malformedAddress",
"Malformed address."},
ParamTestCaseBundle{
"InvalidDidFormat",
R"({
"did": "invalid"
})",
"malformedAddress",
"Malformed address."},
ParamTestCaseBundle{
"InvalidAccountRootNotString",
R"({
@@ -1041,6 +1049,17 @@ generateTestValuesForNormalPathTest()
),
ripple::keylet::account(GetAccountIDWithString(ACCOUNT)).key,
CreateAccountRootObject(ACCOUNT, 0, 1, 1, 1, INDEX1, 1)},
NormalPathTestBundle{
"DID",
fmt::format(
R"({{
"binary": true,
"did": "{}"
}})",
ACCOUNT
),
ripple::keylet::did(GetAccountIDWithString(ACCOUNT)).key,
CreateDidObject(ACCOUNT, "mydocument", "myURI", "mydata")},
NormalPathTestBundle{
"DirectoryViaDirRoot",
fmt::format(