From 3d2a8dc978fa5f0ae5579172fb200f79737b0079 Mon Sep 17 00:00:00 2001 From: jimboj Date: Mon, 27 Mar 2023 15:12:43 -0600 Subject: [PATCH] respond to PR feedback --- lib/runtime/newWasmer/memory.go | 10 +++++----- lib/runtime/newWasmer/memory_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/runtime/newWasmer/memory.go b/lib/runtime/newWasmer/memory.go index 3c4586b5442..e18f8856eee 100644 --- a/lib/runtime/newWasmer/memory.go +++ b/lib/runtime/newWasmer/memory.go @@ -1,14 +1,14 @@ // Copyright 2023 ChainSafe Systems (ON) // SPDX-License-Identifier: LGPL-3.0-only -package wasmer +package latestwasmer import ( "errors" "fmt" "math" - wasmgo "github.com/wasmerio/wasmer-go/wasmer" + "github.com/wasmerio/wasmer-go/wasmer" ) var ( @@ -19,7 +19,7 @@ var ( // Memory is a thin wrapper around Wasmer memory to support // Gossamer runtime.Memory interface type Memory struct { - memory *wasmgo.Memory + memory *wasmer.Memory } func checkBounds(value uint64) (uint32, error) { @@ -45,9 +45,9 @@ func (m Memory) Length() uint32 { // Grow grows the memory by the given number of pages func (m Memory) Grow(numPages uint32) error { - ok := m.memory.Grow(wasmgo.Pages(numPages)) + ok := m.memory.Grow(wasmer.Pages(numPages)) if !ok { - return fmt.Errorf("%w", errCantGrowMemory) + return fmt.Errorf("%w: by %d pages", errCantGrowMemory, numPages) } return nil } diff --git a/lib/runtime/newWasmer/memory_test.go b/lib/runtime/newWasmer/memory_test.go index 6907f1a13aa..6e3bfe94ec3 100644 --- a/lib/runtime/newWasmer/memory_test.go +++ b/lib/runtime/newWasmer/memory_test.go @@ -1,14 +1,14 @@ // Copyright 2023 ChainSafe Systems (ON) // SPDX-License-Identifier: LGPL-3.0-only -package wasmer +package latestwasmer import ( - "github.com/stretchr/testify/assert" "math" "testing" "unsafe" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/wasmerio/wasmer-go/wasmer" )