diff --git a/cli/testdata/verify.nef b/cli/testdata/verify.nef index f8bf2ff48..5bb3c8bbe 100755 Binary files a/cli/testdata/verify.nef and b/cli/testdata/verify.nef differ diff --git a/pkg/rpc/server/server_test.go b/pkg/rpc/server/server_test.go index 1c203176a..42bd9a93c 100644 --- a/pkg/rpc/server/server_test.go +++ b/pkg/rpc/server/server_test.go @@ -57,7 +57,7 @@ type rpcTestCase struct { } const testContractHash = "743ed26f78e29ecd595535b74a943b1f9ccbc444" -const deploymentTxHash = "3f81bc99525ed4b1cbb4a3535feadf73176db646a2879aaf975737348a425edc" +const deploymentTxHash = "9ecf1273fe0d8868cc024c8270b569a12edd7ea9d675c88554b937134efb03f8" const genesisBlockHash = "a496577895eb8c227bb866dc44f99f21c0cf06417ca8f2a877cc5d761a50dac0" const verifyContractHash = "a2eb22340979804cb10cc1add0b8822c201f4d8a" @@ -1345,7 +1345,7 @@ func checkNep17Balances(t *testing.T, e *executor, acc interface{}) { }, { Asset: e.chain.UtilityTokenHash(), - Amount: "80009730770", + Amount: "80009698770", LastUpdated: 7, }}, Address: testchain.PrivateKeyByID(0).GetScriptHash().StringLE(), diff --git a/pkg/rpc/server/testdata/testblocks.acc b/pkg/rpc/server/testdata/testblocks.acc index 999cb641f..444446512 100644 Binary files a/pkg/rpc/server/testdata/testblocks.acc and b/pkg/rpc/server/testdata/testblocks.acc differ diff --git a/pkg/smartcontract/nef/nef.go b/pkg/smartcontract/nef/nef.go index e0a172b0d..af2a42024 100644 --- a/pkg/smartcontract/nef/nef.go +++ b/pkg/smartcontract/nef/nef.go @@ -18,7 +18,7 @@ import ( // +------------+-----------+------------------------------------------------------------+ // | Magic | 4 bytes | Magic header | // | Compiler | 32 bytes | Compiler used | -// | Version | 16 bytes | Compiler version | +// | Version | 32 bytes | Compiler version | // +------------+-----------+------------------------------------------------------------+ // | Script | Var bytes | Var bytes for the payload | // +------------+-----------+------------------------------------------------------------+ @@ -30,10 +30,8 @@ const ( Magic uint32 = 0x3346454E // MaxScriptLength is the maximum allowed contract script length. MaxScriptLength = 1024 * 1024 - // compilerFieldSize is the length of `Compiler` File header field in bytes. + // compilerFieldSize is the length of `Compiler` and `Version` File header fields in bytes. compilerFieldSize = 32 - // versionFieldSize is the length of `Version` File header field in bytes. - versionFieldSize = 16 ) // File represents compiled contract file structure according to the NEF3 standard. @@ -60,7 +58,7 @@ func NewFile(script []byte) (*File, error) { }, Script: script, } - if len(config.Version) > versionFieldSize { + if len(config.Version) > compilerFieldSize { return nil, errors.New("too long version") } file.Checksum = file.CalculateChecksum() @@ -77,7 +75,6 @@ func (h *Header) EncodeBinary(w *io.BinWriter) { var b = make([]byte, compilerFieldSize) copy(b, []byte(h.Compiler)) w.WriteBytes(b) - b = b[:versionFieldSize] for i := range b { b[i] = 0 } @@ -98,7 +95,7 @@ func (h *Header) DecodeBinary(r *io.BinReader) { return r == 0 }) h.Compiler = string(buf) - buf = buf[:versionFieldSize] + buf = buf[:compilerFieldSize] r.ReadBytes(buf) buf = bytes.TrimRightFunc(buf, func(r rune) bool { return r == 0