zingolabs / zingolib

An API and test-app that exposes zcash functionality for app consumption
MIT License
15 stars 19 forks source link

Any pool output #1225

Closed zancas closed 2 months ago

zancas commented 2 months ago

Add the notes::AnyPoolOutput enum. This type provides one variant per pool. All variants wrap a relevant type:

Transparent(TransparentOutput) Sapling(SaplingNote) Orchard(OrchardNote)

All wrapped types implement OutputInterface.

The enum-dispatch crate provides derive procedural macros that dispatch from methods of the AnyPoolOutput to the wrapped type OutputInterface trait method this provides an ergonomic interface to access pool agnostic output functionality.

At a high level this functionality will replace the older do_list_notes interface.

As do_list_notes is replaces with AnyPoolOutputs constructor calls in test, the AnyPoolOutput logic will be integrated (first) into test logic.

fluidvanadium commented 2 months ago

7823aa190116bea95511f94c103e54555908fa7b

maybe i dont truly understand why OutputInterface and OutputConstructors are different traits....

b4098cb1d4aaacf03d65fc5517d1246c76d25c4d

is there any reason to use more mutable vecs at transaction_record.rs:146? why dont we continue to just extend the one?

64319209924bf7fd2554123a1ed36c36d7fe7764

commit message is misleading

77a38d758a18daa51c4ea5e49ff6a15015d69d12

wonder if there is a way we could keep the unit test and put it to the replacement for pool_value_received