Clarify anchor names (#1955)

When we're naming the anchors without the corresponding type or struct,
it's not clear if they are shared or per spend.

Rename the fields as `shared_anchor` or `per_spend_anchor`.
This commit is contained in:
teor 2021-03-30 09:22:07 +10:00 committed by GitHub
parent 4e754089a6
commit 0562fa7e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ We use `AnchorVariant` in `ShieldedData` to model the anchor differences between
```rust ```rust
struct sapling::ShieldedData<AnchorV: AnchorVariant> { struct sapling::ShieldedData<AnchorV: AnchorVariant> {
value_balance: Amount, value_balance: Amount,
anchor: AnchorV::Shared, shared_anchor: AnchorV::Shared,
first: Either<Spend<AnchorV>, Output>, first: Either<Spend<AnchorV>, Output>,
rest_spends: Vec<Spend<AnchorV>>, rest_spends: Vec<Spend<AnchorV>>,
rest_outputs: Vec<Output>, rest_outputs: Vec<Output>,
@ -135,7 +135,7 @@ Sapling spend code is located at `zebra-chain/src/sapling/spend.rs`. We use `Anc
```rust ```rust
struct Spend<AnchorV: AnchorVariant> { struct Spend<AnchorV: AnchorVariant> {
cv: commitment::ValueCommitment, cv: commitment::ValueCommitment,
anchor: AnchorV::PerSpend, per_spend_anchor: AnchorV::PerSpend,
nullifier: note::Nullifier, nullifier: note::Nullifier,
rk: redjubjub::VerificationKeyBytes<SpendAuth>, rk: redjubjub::VerificationKeyBytes<SpendAuth>,
zkproof: Groth16Proof, zkproof: Groth16Proof,
@ -191,7 +191,7 @@ The new V5 structure will create a new `orchard::ShieldedData` type. This new ty
struct orchard::ShieldedData { struct orchard::ShieldedData {
flags: Flags, flags: Flags,
value_balance: Amount, value_balance: Amount,
anchor: tree::Root, shared_anchor: tree::Root,
proof: Halo2Proof, proof: Halo2Proof,
/// An authorized action description. /// An authorized action description.
/// ///