Add DeliverMax for Tx streams (#980)

This commit is contained in:
cyan317
2023-11-13 13:29:36 +00:00
committed by GitHub
parent feae85782c
commit ca16858878
2 changed files with 7 additions and 0 deletions

View File

@@ -174,6 +174,8 @@ SubscriptionManager::pubTransaction(data::TransactionAndMetadata const& blobs, r
pubObj["transaction"] = rpc::toJson(*tx);
pubObj["meta"] = rpc::toJson(*meta);
rpc::insertDeliveredAmount(pubObj["meta"].as_object(), tx, meta, blobs.date);
// hardcode api_version to 1 for now, until https://github.com/XRPLF/clio/issues/978 fixed
rpc::insertDeliverMaxAlias(pubObj["transaction"].as_object(), 1);
pubObj["type"] = "transaction";
pubObj["validated"] = true;
pubObj["status"] = "closed";

View File

@@ -397,6 +397,7 @@ TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerTransaction)
"transaction":{
"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount":"1",
"DeliverMax":"1",
"Destination":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"Fee":"1",
"Sequence":32,
@@ -636,6 +637,7 @@ TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerAccount)
"transaction":{
"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount":"1",
"DeliverMax":"1",
"Destination":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"Fee":"1",
"Sequence":32,
@@ -695,6 +697,7 @@ TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerOrderBook)
"transaction":{
"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount":"1",
"DeliverMax":"1",
"Destination":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"Fee":"1",
"Sequence":32,
@@ -752,6 +755,7 @@ TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerOrderBook)
"transaction":{
"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount":"1",
"DeliverMax":"1",
"Destination":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"Fee":"1",
"Sequence":32,
@@ -795,6 +799,7 @@ TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerOrderBook)
"transaction":{
"Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount":"1",
"DeliverMax":"1",
"Destination":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"Fee":"1",
"Sequence":32,