mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use macros to instantiate most SField instances:
There have been cases in the past where SFields have been defined in such a way that they did not follow our conventions. In particular, the string representation of an SField should match the in-code name of the SField. This change leverages the preprocessor to encourage SFields to be properly constructed. The suffixes of SField types are changed to be the same as the suffixes of corresponding SerializedTypeIDs. This allows The preprocessor to match types using simple name pasting. Since the string representation of the SField is part of our stable API, the name of sfPayChannel was changed to sfChannel. This change allows sfChannel to follow our conventions while making no changes to our external API.
This commit is contained in:
committed by
Nik Bougalis
parent
f239050054
commit
17abca1caa
@@ -368,7 +368,7 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
payChanFund[jss::TransactionType] = jss::PaymentChannelFund;
|
||||
payChanFund[jss::Flags] = tfUniversal;
|
||||
payChanFund[jss::Account] = alice.human();
|
||||
payChanFund[sfPayChannel.jsonName] = payChanIndex;
|
||||
payChanFund[sfChannel.jsonName] = payChanIndex;
|
||||
payChanFund[jss::Amount] =
|
||||
XRP(200).value().getJson(JsonOptions::none);
|
||||
env(payChanFund, sig(alie));
|
||||
@@ -379,7 +379,7 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
payChanClaim[jss::TransactionType] = jss::PaymentChannelClaim;
|
||||
payChanClaim[jss::Flags] = tfClose;
|
||||
payChanClaim[jss::Account] = gw.human();
|
||||
payChanClaim[sfPayChannel.jsonName] = payChanIndex;
|
||||
payChanClaim[sfChannel.jsonName] = payChanIndex;
|
||||
payChanClaim[sfPublicKey.jsonName] = strHex(alice.pk().slice());
|
||||
env(payChanClaim);
|
||||
env.close();
|
||||
|
||||
Reference in New Issue
Block a user