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