2018-03-04 13:56:49 +00:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
2020-04-10 10:41:49 +00:00
|
|
|
"math/rand"
|
|
|
|
|
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.
|
2020-04-10 10:41:49 +00:00
|
|
|
type MinerTX struct{}
|
|
|
|
|
|
|
|
// NewMinerTX creates Transaction of MinerType type.
|
|
|
|
func NewMinerTX() *Transaction {
|
|
|
|
return NewMinerTXWithNonce(rand.Uint32())
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewMinerTXWithNonce creates Transaction of MinerType type with specified nonce.
|
|
|
|
func NewMinerTXWithNonce(nonce uint32) *Transaction {
|
|
|
|
return &Transaction{
|
|
|
|
Type: MinerType,
|
|
|
|
Version: 0,
|
|
|
|
Nonce: nonce,
|
|
|
|
Data: &MinerTX{},
|
|
|
|
Attributes: []Attribute{},
|
|
|
|
Inputs: []Input{},
|
|
|
|
Outputs: []Output{},
|
|
|
|
Scripts: []Witness{},
|
|
|
|
Trimmed: false,
|
|
|
|
}
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|
|
|
|
|
2019-09-16 16:31:49 +00:00
|
|
|
// DecodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) DecodeBinary(r *io.BinReader) {
|
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) {
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|