diff --git a/pkg/core/transaction/contract_test.go b/pkg/core/transaction/contract_test.go index 6d6ed4ef0..28bc42032 100644 --- a/pkg/core/transaction/contract_test.go +++ b/pkg/core/transaction/contract_test.go @@ -17,7 +17,7 @@ func TestEncodeDecodeContract(t *testing.T) { assert.Equal(t, ContractType, tx.Type) assert.IsType(t, tx.Data, &ContractTX{}) assert.Equal(t, 0, int(tx.Version)) - assert.Equal(t, 1, int(len(tx.Inputs))) + assert.Equal(t, 1, len(tx.Inputs)) input := tx.Inputs[0] diff --git a/pkg/vm/compiler/emit.go b/pkg/vm/compiler/emit.go index 584979e5d..92be632f8 100644 --- a/pkg/vm/compiler/emit.go +++ b/pkg/vm/compiler/emit.go @@ -85,7 +85,7 @@ func emitSyscall(w *bytes.Buffer, api string) error { } buf := make([]byte, len(api)+1) buf[0] = byte(len(api)) - copy(buf[1:], []byte(api)) + copy(buf[1:], api) return emit(w, vm.SYSCALL, buf) } diff --git a/pkg/vm/emit.go b/pkg/vm/emit.go index 14556b039..db76fc238 100644 --- a/pkg/vm/emit.go +++ b/pkg/vm/emit.go @@ -91,7 +91,7 @@ func EmitSyscall(w *bytes.Buffer, api string) error { } buf := make([]byte, len(api)+1) buf[0] = byte(len(api)) - copy(buf[1:], []byte(api)) + copy(buf[1:], api) return Emit(w, SYSCALL, buf) }