Exports wasm.ValueType and makes Functions interfaces for signature verification (#284)

This moves code for `ValueType` constants public, so that we can
centralize discussion on how values are encoded. We'll need this when
re-introducing a Globals API.

To keep complexity down in consideration that there are only 4 types, I
copied the constants into the internalwasm package. This reduces the
import complexity otherwise would have caused.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Takaya Saeki <takaya@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-02-24 10:04:15 +08:00
committed by GitHub
parent 80d0c348be
commit 7c92cf4ca3
19 changed files with 203 additions and 151 deletions

View File

@@ -214,7 +214,7 @@ func TestFunction_Context(t *testing.T) {
require.NoError(t, err)
// This fails if the function wasn't invoked, or had an unexpected context.
results, err := exports.Function(functionName)(tc.ctx)
results, err := exports.Function(functionName).Call(tc.ctx)
require.NoError(t, err)
require.Equal(t, expectedResult, results[0])
})