chromaway / ngcccbase

next-gen colored coin client base
MIT License
85 stars 46 forks source link

ColorValue #125

Closed killerstorm closed 10 years ago

killerstorm commented 10 years ago

ColorValue should encapsulate colorvalue. It should include reference to color definition.

We should use ColorValue everywhere where we work with colorvalue.

Base class ColorValue should be abstract, it only provides to get colordef. Its subclass AdditiveColorValue should be used as parent class for colorvalues which are additive.

A concrete class, let's say SimpeColorValue or IntegerColorValue should keep track of value as an integer amount and implement arithmetic operators like + - < ==.

We convert from satoshi amounts to colorvalues in ColorDefinition.run_kernel. We convert from colorvalues to satoshi amounts in ColorDefinition.compose_tx_spec.

Thus they are largely opaque.

ColorDataStore's functions should return data in ColorValue format.

killerstorm commented 10 years ago

This one is for Jimmy, requires lots of changes all over the code...

jimmysong commented 10 years ago

Can we close this?