Refactoring: SproutNote member variable value moved to BaseNote.
All notes have a value, so the member variable has been moved to the base class, and direct member access has been replaced with a getter.
This commit is contained in:
@@ -9,19 +9,23 @@
|
||||
namespace libzcash {
|
||||
|
||||
class BaseNote {
|
||||
protected:
|
||||
uint64_t value_ = 0;
|
||||
public:
|
||||
BaseNote() {}
|
||||
BaseNote(uint64_t value) : value_(value) {};
|
||||
virtual uint256 cm() const {};
|
||||
inline uint64_t value() const { return value_; };
|
||||
};
|
||||
|
||||
class SproutNote : public BaseNote {
|
||||
public:
|
||||
uint256 a_pk;
|
||||
uint64_t value;
|
||||
uint256 rho;
|
||||
uint256 r;
|
||||
|
||||
SproutNote(uint256 a_pk, uint64_t value, uint256 rho, uint256 r)
|
||||
: a_pk(a_pk), value(value), rho(rho), r(r) {}
|
||||
: BaseNote(value), a_pk(a_pk), rho(rho), r(r) {}
|
||||
|
||||
SproutNote();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user