zebra/zebrad/tests/common/configs
Arya e5d4d739b7
add(consensus/network): Adds `new_regtest()` constructors to `testnet::Parameters` and `Network` (#8413)
* minor cleanup and rename

* Adds an empty NetworkParameters struct to Network::Testnet variant, updates production code.

* Updates tests

* Adds `NetworkKind` and uses it instead of `Network` in `HistoryTreeParts` and `transparent::Address`

* Adds a [network.testnet_parameters] section to the config, uses `NetworkKind` as zebra_network::Config::network field type, and converts 'Network' to `NetworkKind` before serializing

* Applies some suggestions from code review

* Applies suggestions from code review

* returns b58 prefix constants directly to remove From<NetworkKind> impl for zcash_primitives::consensus::Network

* Applies more suggestions from code review.

* moves conversions to zcash_primitives::consensus::Network to where they're used.

* Apply suggestions from code review

Co-authored-by: Marek <mail@marek.onl>

* rename `network` variables and method names typed as NetworkKind to `network_kind`

* use only test block heights for the network associated with them

* Applies more suggestions from code review.

* Rename `NetworkParameters` to `Parameters` and move it a new `testnet` module

* adds activation heights field

* updates stored test config, adds a quicker test for checking that stored configs can be parsed, adds an intermediate representation of activation heights

* implement Parameters for Network

* Passes &Network directly instead of converting to zp_consensus::Network where there were conversions

* fixes a bad merge (removes a network conversion in zcash_note_encryption)

* Adds a test for the Parameters impl for zebra_chain::Network

* fixes doc links

* - Makes the `activation_heights` config field optional by adding a #[serde(default)]
- Panics if a non-zero activation height is provided for the `Genesis` network upgrade
- Always sets the `Genesis` and `BeforeOverwinter` network upgrade activation heights to 0 and 1, `BeforeOverwinter` could be overwritten by a later network upgrade
- Makes the `activation_heights` field on `Parameters` private, adds/uses an accessor method instead, and adds a builder struct and `build()` method

* small refactor of activation_heights() method

* check that activation heights are in the right order

* Updates `NetworkUpgrade::activation_height()` to return the height of the next NetworkUpgrade if it doesn't find the activation height of `&self`

* checks that the miner address is of TestnetKind on Regtest and update assertion message

* Adds a DNetworkUpgradeActivationHeights struct for better control over how activation heights can be configured

* moves all ordered network upgrades to a constant, adds a no_duplicates test, moves struct with activation heights outside deserialization impl and accepts it in `ParametersBuilder::activation_heights()` instead of a Vec

* panics if any network upgrades are configured to activate at Height(0) because it's reserved for Genesis

* Simplifies the `ParametersBuilder::activation_heights()` method and removes an unnecessary test.

* Adds Sapling HRPs as fields on testnet params. (#8398)

* Applies suggestions from code review.

* Update zebra-chain/src/parameters/network_upgrade.rs

Co-authored-by: Marek <mail@marek.onl>

* Adds `network_name` field and accessor method on `Parameters`, uses it in the `Display` impl for `Network`

* Removes unnecessary `.filter()`

* adds constraints on valid network names and a test

* adds config field for setting network name, adds "with_" prefix to ParameterBuilder setter methods

* Adds `MainnetKind`, `TestnetKind`, and `RegtestKind` to reserved network names

* updates stored test configs and fixes `network_name()` docs

* Adds a `new_regtest()` method on `Network` and `testnet::Parameters`, updates config deserialization to return an error if the initial_testnet_peers include any default initial peers AND contain configured activation heights

* Updates `activates_network_upgrades_correctly` test to check Regtest activation heights (and default Mainnet/Testnet)

* Refactors if-let & match statement into general match statement, removes constraint against including `testnet_parameters` field/section in the config when using `Mainnet` or `Regtest`

* Removes outdated TODO

* Restores `testnet_parameters` section of the latest stored config.

* Adds `with_sapling_hrps()` method and uses it to set the Regtest HRPs in `new_regtest()`.

Adds a test for Sapling HRP validation

* Checks that default Mainnet/Testnet/Regtest Sapling HRPs pass validation in `with_sapling_hrps()`

* Uses the correct constant in test

* Adds `is_regtest()` methods

* Updates test docs

* drop custom panic hooks after expected panics

---------

Co-authored-by: Marek <mail@marek.onl>
2024-04-25 04:04:05 +00:00
..
getblocktemplate-v1.0.0-rc.1.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
getblocktemplate-v1.0.0-rc.2.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
getblocktemplate-v1.0.0-rc.3.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
getblocktemplate-v1.0.0-rc.4.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
getblocktemplate-v1.0.0-rc.5.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
getblocktemplate-v1.0.0-rc.9.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
getblocktemplate-v1.0.1.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
net-cache-custom-v1.0.0-rc.9.toml feat(net): Cache a list of useful peers on disk (#6739) 2023-06-06 08:28:14 +00:00
net-cache-disabled-v1.0.0-rc.9.toml feat(net): Cache a list of useful peers on disk (#6739) 2023-06-06 08:28:14 +00:00
net-cache-enabled-v1.0.0-rc.9.toml feat(net): Cache a list of useful peers on disk (#6739) 2023-06-06 08:28:14 +00:00
shieldedscan-v1.5.0.toml avoid starting the scan task if no keys to scan are present (#8059) 2023-12-06 01:56:43 +00:00
shieldedscan-v1.6.0.toml add(docs): Note default path to config in docs (#8143) 2024-01-10 06:53:32 +00:00
v1.0.0-beta.12.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.0-beta.13.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.0-beta.15.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.0-rc.0.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.0-rc.2.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.0-rc.4.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.0-rc.9.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.0.1.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.3.0-progress-bars.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.4.0.toml change(docs): Replace doc.zebra.zfnd.org API documentation with docs.rs (#7886) 2023-11-01 22:09:40 +00:00
v1.6.0.toml add(docs): Note default path to config in docs (#8143) 2024-01-10 06:53:32 +00:00
v1.7.0.toml add(consensus/network): Adds `new_regtest()` constructors to `testnet::Parameters` and `Network` (#8413) 2024-04-25 04:04:05 +00:00