core: add validUntilBlock field to transaction
1. closes #841 2. Commented out test cases where binary transaction are used. These test cases marked with `TODO NEO3.0: Update binary` and need to be updated. 3. Updated other tests. 4. Added cache to calculateValidUntilBlock() RPC-client method.
This commit is contained in:
parent
1e3c36433f
commit
5fa11987d2
16 changed files with 280 additions and 126 deletions
|
@ -264,6 +264,11 @@ func claimGas(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
tx := transaction.NewClaimTX(&claim)
|
||||
validUntilBlock, err := c.CalculateValidUntilBlock()
|
||||
if err != nil {
|
||||
return cli.NewExitError(err, 1)
|
||||
}
|
||||
tx.ValidUntilBlock = validUntilBlock
|
||||
|
||||
tx.AddOutput(&transaction.Output{
|
||||
AssetID: core.UtilityTokenID(),
|
||||
|
@ -510,6 +515,11 @@ func transferAsset(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
tx := transaction.NewContractTX()
|
||||
validUntilBlock, err := c.CalculateValidUntilBlock()
|
||||
if err != nil {
|
||||
return cli.NewExitError(err, 1)
|
||||
}
|
||||
tx.ValidUntilBlock = validUntilBlock
|
||||
if err := request.AddInputsAndUnspentsToTx(tx, fromFlag.String(), asset, amount, c); err != nil {
|
||||
return cli.NewExitError(err, 1)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue