mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 13:58:05 +00:00
65503aa9b4
1. Closes #840: added Nonce field to transaction.Transaction and removed Nonce field from transaction.MinerTx 2. Added following methods to different tx types: - NewMinerTx() - NewMinerTxWithNonce(...) - NewEnrollmentTx(...) - NewIssueTx() - NewPublishTx(...) - NewRegisterTx(...) - NewStateTx(...) in order to avoid code duplication when new transaction is created. 3. Commented out test cases where binary transaction/block are used. These test cases marked with `TODO NEO3.0: Update binary` and need to be updated. 4. Updated other tests 5. Added constant Nonce to GoveringTockenTx, UtilityTokenTx and genesis block to avoid data variability. Also marked with TODO.
34 lines
768 B
Go
34 lines
768 B
Go
package transaction
|
|
|
|
import (
|
|
"math/rand"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/io"
|
|
)
|
|
|
|
// ContractTX represents a contract transaction.
|
|
// This TX has not special attributes.
|
|
type ContractTX struct{}
|
|
|
|
// NewContractTX creates Transaction of ContractType type.
|
|
func NewContractTX() *Transaction {
|
|
return &Transaction{
|
|
Type: ContractType,
|
|
Version: 0,
|
|
Nonce: rand.Uint32(),
|
|
Data: &ContractTX{},
|
|
Attributes: []Attribute{},
|
|
Inputs: []Input{},
|
|
Outputs: []Output{},
|
|
Scripts: []Witness{},
|
|
Trimmed: false,
|
|
}
|
|
}
|
|
|
|
// DecodeBinary implements Serializable interface.
|
|
func (tx *ContractTX) DecodeBinary(r *io.BinReader) {
|
|
}
|
|
|
|
// EncodeBinary implements Serializable interface.
|
|
func (tx *ContractTX) EncodeBinary(w *io.BinWriter) {
|
|
}
|