core: add nonce field to transaction
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.
This commit is contained in:
parent
d1f92a585b
commit
65503aa9b4
34 changed files with 354 additions and 332 deletions
|
@ -77,20 +77,8 @@ func getTX(t *testing.B, wif *keys.WIF) *transaction.Transaction {
|
|||
fromAddressHash, err := address.StringToUint160(fromAddress)
|
||||
require.NoError(t, err)
|
||||
|
||||
tx := &transaction.Transaction{
|
||||
Type: transaction.InvocationType,
|
||||
Version: 0,
|
||||
Data: &transaction.InvocationTX{
|
||||
Script: []byte{0x51},
|
||||
Gas: 1,
|
||||
Version: 1,
|
||||
},
|
||||
Attributes: []transaction.Attribute{},
|
||||
Inputs: []transaction.Input{},
|
||||
Outputs: []transaction.Output{},
|
||||
Scripts: []transaction.Witness{},
|
||||
Trimmed: false,
|
||||
}
|
||||
tx := transaction.NewInvocationTX([]byte{0x51}, 1)
|
||||
tx.Version = 0
|
||||
tx.Attributes = append(tx.Attributes,
|
||||
transaction.Attribute{
|
||||
Usage: transaction.Description,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue