neoneo-go/pkg/core/transaction/miner.go
Roman Khimov a9b9c9226d *: add/fix godoc comments to satisfy golint
Fixes things like:
 * exported type/method/function X should have comment or be unexported
 * comment on exported type/method/function X should be of the form "X ..."
   (with optional leading article)

Refs. #213.
2019-09-03 17:57:51 +03:00

27 lines
619 B
Go

package transaction
import (
"encoding/binary"
"io"
)
// MinerTX represents a miner transaction.
type MinerTX struct {
// Random number to avoid hash collision.
Nonce uint32
}
// DecodeBinary implements the Payload interface.
func (tx *MinerTX) DecodeBinary(r io.Reader) error {
return binary.Read(r, binary.LittleEndian, &tx.Nonce)
}
// EncodeBinary implements the Payload interface.
func (tx *MinerTX) EncodeBinary(w io.Writer) error {
return binary.Write(w, binary.LittleEndian, tx.Nonce)
}
// Size returns serialized binary size for this transaction.
func (tx *MinerTX) Size() int {
return 4 // Nonce
}