Skip to content

Commit

Permalink
reuse metadata helper
Browse files Browse the repository at this point in the history
  • Loading branch information
radkomih committed Jan 15, 2024
1 parent fd288ff commit a411322
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 37 deletions.
2 changes: 1 addition & 1 deletion gossamer
33 changes: 0 additions & 33 deletions runtime/benchmark_runtime_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion runtime/benchmark_timestamp_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func BenchmarkTimestampSetStep1(b *testing.B) {
func benchmarkTimestampSet(b *testing.B) {
rt, storage := newBenchmarkingRuntime(b)

metadata := newBenchmarkingRuntimeMetadata(b, rt)
metadata := runtimeMetadata(b, rt)

// Setup the input params
now := uint64(time.Now().UnixMilli())
Expand Down
7 changes: 6 additions & 1 deletion runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ func newTestRuntime(t *testing.T) (*wazero_runtime.Instance, *runtime.Storage) {
return runtime, &runtime.Context.Storage
}

func runtimeMetadata(t *testing.T, instance *wazero_runtime.Instance) *ctypes.Metadata {
func newBenchmarkingRuntime(b *testing.B) (*wazero_runtime.Instance, *runtime.Storage) {
runtime := wazero_runtime.NewBenchInstanceWithTrie(b, WASM_RUNTIME, trie.NewEmptyTrie())
return runtime, &runtime.Context.Storage
}

func runtimeMetadata(t assert.TestingT, instance *wazero_runtime.Instance) *ctypes.Metadata {
bMetadata, err := instance.Metadata()
assert.NoError(t, err)

Expand Down
2 changes: 1 addition & 1 deletion tinygo

0 comments on commit a411322

Please sign in to comment.