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:
Anna Shaleva 2020-04-15 09:50:13 +03:00
parent 1e3c36433f
commit 5fa11987d2
16 changed files with 280 additions and 126 deletions

View file

@ -1,19 +1,16 @@
package block
import (
"encoding/hex"
"testing"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
"github.com/nspcc-dev/neo-go/pkg/internal/testserdes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// Test blocks are blocks from mainnet with their corresponding index.
// TODO NEO3.0: Update binary
/*
func TestDecodeBlock1(t *testing.T) {
data, err := getBlockData(1)
require.NoError(t, err)
@ -67,7 +64,7 @@ func TestTrimmedBlock(t *testing.T) {
assert.True(t, trimmedBlock.Transactions[i].Trimmed)
}
}
*/
func newDumbBlock() *Block {
return &Block{
Base: Base{