NV18: FEVM: Basic smoke test (#9635)

* unknown return types should not be treated as errors from WaitForMessage

* simplecoin FEVM smoke test

* add itest-fevm to circle matrix

* use a named error for metadata lookup failures

* hand-write the fevm basic test

* make gen

* address nits
This commit is contained in:
vyzo
2022-11-14 21:06:55 +02:00
committed by GitHub
parent 8a7367f1c9
commit af39ec27b8
6 changed files with 229 additions and 9 deletions
+16 -7
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"strconv"
@@ -617,14 +618,22 @@ func (m *StateModule) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence
t, err := stmgr.GetReturnType(ctx, m.StateManager, vmsg.To, vmsg.Method, ts)
if err != nil {
return nil, xerrors.Errorf("failed to get return type: %w", err)
if errors.Is(err, stmgr.ErrMetadataNotFound) {
// This is not nececessary an error -- EVM methods (and in the future native actors) may
// return just bytes, and in the not so distant future we'll have native wasm actors
// that are by definition not in the registry.
// So in this case, log a debug message and retun the raw bytes.
log.Debugf("failed to get return type: %s", err)
returndec = recpt.Return
} else {
return nil, xerrors.Errorf("failed to get return type: %w", err)
}
} else {
if err := t.UnmarshalCBOR(bytes.NewReader(recpt.Return)); err != nil {
return nil, err
}
returndec = t
}
if err := t.UnmarshalCBOR(bytes.NewReader(recpt.Return)); err != nil {
return nil, err
}
returndec = t
}
return &api.MsgLookup{