2018-03-04 13:56:49 +00:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
2020-03-03 14:21:42 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/io"
|
2018-03-04 13:56:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// MinerTX represents a miner transaction.
|
|
|
|
type MinerTX struct {
|
2018-03-25 10:45:54 +00:00
|
|
|
// Random number to avoid hash collision.
|
2018-03-04 13:56:49 +00:00
|
|
|
Nonce uint32
|
|
|
|
}
|
|
|
|
|
2019-09-16 16:31:49 +00:00
|
|
|
// DecodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) DecodeBinary(r *io.BinReader) {
|
2019-12-12 15:52:23 +00:00
|
|
|
tx.Nonce = r.ReadU32LE()
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|
|
|
|
|
2019-09-16 16:31:49 +00:00
|
|
|
// EncodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) EncodeBinary(w *io.BinWriter) {
|
2019-12-12 15:52:23 +00:00
|
|
|
w.WriteU32LE(tx.Nonce)
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|