Refactor fee initialization and configuration: (#4319)

* Create the FeeSettings object in genesis ledger.
* Initialize with default values from the config. Removes the need to
  pass a Config down into the Ledger initialization functions, including
  setup().
* Drop the undocumented fee config settings in favor of the [voting]
  section.
  * Fix #3734.
  * If you previously used fee_account_reserve and/or fee_owner_reserve,
    you should change to using the [voting] section instead. Example:

```
[voting]
account_reserve=10000000
owner_reserve=2000000
```

* Because old Mainnet ledgers (prior to 562177 - yes, I looked it up)
  don't have FeeSettings, some of the other ctors will default them to
  the config values before setup() tries to load the object.
* Update default Config fee values to match Mainnet.
* Fix unit tests:
  * Updated fees: Some tests are converted to use computed values of fee
    object, but the default Env config was also updated to fix the rest.
  * Unit tests that check the structure of the ledger have updated
    hashes and counts.
This commit is contained in:
Ed Hennis
2023-03-28 09:03:25 -07:00
committed by GitHub
parent 7aad6e5127
commit 66627b26cf
34 changed files with 289 additions and 199 deletions

View File

@@ -37,7 +37,7 @@ public:
auto lc_result = env.rpc("ledger_closed")[jss::result];
BEAST_EXPECT(
lc_result[jss::ledger_hash] ==
"A15F7FBE0B06286915D971BF9802C9431CD7DE40E2AC7D07C409EDB1C0715C60");
"CCC3B3E88CCAC17F1BE6B4A648A55999411F19E3FE55EB721960EB0DF28EDDA5");
BEAST_EXPECT(lc_result[jss::ledger_index] == 2);
env.close();
@@ -52,7 +52,7 @@ public:
lc_result = env.rpc("ledger_closed")[jss::result];
BEAST_EXPECT(
lc_result[jss::ledger_hash] ==
"2E81FC6EC0DD943197E0C7E3FBE9AE307F2775F2F7485BB37307984C3C0F2340");
"E86DE7F3D7A4D9CE17EF7C8BA08A8F4D8F643B9552F0D895A31CDA78F541DE4E");
BEAST_EXPECT(lc_result[jss::ledger_index] == 3);
}