2018-03-04 14:56:49 +01:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
2019-09-16 12:18:13 +03:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/io"
|
2018-03-04 14:56:49 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// MinerTX represents a miner transaction.
|
|
|
|
type MinerTX struct {
|
2018-03-25 12:45:54 +02:00
|
|
|
// Random number to avoid hash collision.
|
2018-03-04 14:56:49 +01:00
|
|
|
Nonce uint32
|
|
|
|
}
|
|
|
|
|
2019-09-16 19:31:49 +03:00
|
|
|
// DecodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) DecodeBinary(r *io.BinReader) {
|
2019-09-16 12:18:13 +03:00
|
|
|
r.ReadLE(&tx.Nonce)
|
2018-03-04 14:56:49 +01:00
|
|
|
}
|
|
|
|
|
2019-09-16 19:31:49 +03:00
|
|
|
// EncodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) EncodeBinary(w *io.BinWriter) {
|
2019-09-16 12:18:13 +03:00
|
|
|
w.WriteLE(tx.Nonce)
|
2018-03-04 14:56:49 +01:00
|
|
|
}
|