Documentation ¶
Index ¶
- func Equal(block, other Block) bool
- func Validate(prev, current Block) error
- type Basic
- func (block Basic) Blockhash() []byte
- func (block Basic) Data() []byte
- func (block Basic) Hash() []byte
- func (block Basic) Index() int
- func (block Basic) JSON() BlockJSON
- func (block *Basic) MarshalJSON() ([]byte, error)
- func (block Basic) Parenthash() []byte
- func (block Basic) Serialize() ([]byte, error)
- func (block Basic) Timestamp() int64
- func (block *Basic) UnmarshalJSON(bytes []byte) error
- type Block
- type BlockJSON
- type SHA512
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Basic ¶
type Basic struct {
// contains filtered or unexported fields
}
Basic is the skeleton used to implement a block
func (*Basic) MarshalJSON ¶
MarshalJSON marshals a block JSON
func (Basic) Parenthash ¶
Parenthash returns the parent block's hash
func (*Basic) UnmarshalJSON ¶
UnmarshalJSON unmarshals a block JSON
type Block ¶
type Block interface { Serialize() ([]byte, error) Hash() []byte JSON() BlockJSON Index() int Timestamp() int64 Parenthash() []byte Blockhash() []byte Data() []byte // contains filtered or unexported methods }
Block the interface used to implement a block
type BlockJSON ¶
Click to show internal directories.
Click to hide internal directories.