You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the struct CCcontract_info is defined in CCinclude.h. This struct contains a number of generic fields for different contracts, as well as pointers to functions for validation and checking a CScript. To create an "Asset" contract object, requires the following (taken from faucet.cpp::FaucetInfo())
This requires the creation of an object, and a method with a large case statement. In addition there are macros to help build the ismyvin function.
I believe all this to be unnecessary, and fairly easy to fix.
CCcontract_info should be moved to CCcontract_info.h
CCcontract_info will become a virtual struct which requires the definition of validate()
CCAssetContract_info should be defined in CCassets.h, and derives from CCcontract_info, defining its own validate method (in CCassets.cpp probably)
CCcustom.inc is no longer necessary, nor are the defines to make it work, as the ismyvin method can be moved into CCcontract_info. Any object-specific customizations can override this.
Existing methods that take in a CCcontract_info pointer should not need modification.
Classes that would like to take a subset of object types can overload methods. Invalid combinations could be caught a compile time.
CCinit is no longer necessary and should be replaced by simply creating the object desired. New way:
CCAssetContract_info C;
The text was updated successfully, but these errors were encountered:
I will use an "Asset" as an example.
Currently the struct CCcontract_info is defined in CCinclude.h. This struct contains a number of generic fields for different contracts, as well as pointers to functions for validation and checking a CScript. To create an "Asset" contract object, requires the following (taken from faucet.cpp::FaucetInfo())
This requires the creation of an object, and a method with a large case statement. In addition there are macros to help build the ismyvin function.
I believe all this to be unnecessary, and fairly easy to fix.
The text was updated successfully, but these errors were encountered: