Refactor * No more decorators, but rather types.AntiHandler * No more handlers, but rather types.MsgHandler * Ability to pass "stores" in NewXYZHandler() * Coins live in types, and Accounts have coins * Coinstore -> bank
15 lines
271 B
Go
15 lines
271 B
Go
package types
|
|
|
|
// A generic codec for a fixed type.
|
|
type Codec interface {
|
|
|
|
// Returns a prototype (empty) object.
|
|
Prototype() interface{}
|
|
|
|
// Encodes the object.
|
|
Encode(o interface{}) ([]byte, error)
|
|
|
|
// Decodes an object.
|
|
Decode(bz []byte) (interface{}, error)
|
|
}
|