Skip to content

Commit 62955f3

Browse files
committed
Reduce migration guide.
1 parent 3bb585d commit 62955f3

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

src/lib.md

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,7 @@ The prior functions on `ChainParameters` have been removed, and should be migrat
7575
The `ChainParameters::common_update_keys()` function was removed.
7676
Instead `keys.level_2_keys : Option<Level2Keys>` should be used.
7777
The [`Level2Keys`](v2::Level2Keys) `struct` provides the level 2 keys and access structures.
78-
For signing chain updates, use [`construct_update_signer()`](v2::Level2Keys::construct_update_signer), for instance as:
79-
80-
```rust,no_compile
81-
let params = client
82-
.get_block_chain_parameters(&BlockIdentifier::LastFinal)
83-
.await
84-
.context("Could not obtain chain parameters")?;
85-
86-
let keys = params
87-
.response
88-
.keys
89-
.level_2_keys
90-
.context("No level 2 keys in chain parameters.")?;
91-
92-
let signer = keys
93-
.construct_update_signer(
94-
keys.micro_ccd_per_euro
95-
.as_ref()
96-
.context("Missing uCCD:EUR exchange rate update keys.")?,
97-
kps,
98-
)
99-
.context("Invalid keys supplied.")?;
100-
101-
let block_item: BlockItem<Payload> =
102-
update::update(&signer, seq_number, effective_time, timeout, payload).into();
103-
```
104-
105-
Constructing updates to the level 2 keys requires an [`AuthorizationsV1`](types::AuthorizationsV1) (or for old protocol versions, [`AuthorizationsV0`](types::AuthorizationsV0)) which can be obtained with `Level2Keys::try_into()`.
78+
For signing chain updates, use [`construct_update_signer()`](v2::Level2Keys::construct_update_signer).
10679

10780
The `ChainParameters::micro_ccd_per_energy()` and `ChainParameters::ccd_cost()` functions were removed.
10881
Instead, use [`energy_rate()`](v2::ChainParameters::energy_rate) to obtain an [`EnergyRate`](v2::EnergyRate), which encapsulates the [`micro_ccd_per_energy`](v2::EnergyRate::micro_ccd_per_energy) exchange rate.

0 commit comments

Comments
 (0)