2020-08-15 22:57:27 +00:00
|
|
|
package conformance
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-09-07 06:08:53 +00:00
|
|
|
|
2020-09-07 03:49:10 +00:00
|
|
|
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
|
2020-08-15 22:57:27 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/go-address"
|
2020-10-07 11:45:11 +00:00
|
|
|
|
2020-08-15 22:57:27 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/state"
|
|
|
|
"github.com/filecoin-project/lotus/chain/vm"
|
|
|
|
|
2020-09-07 03:49:10 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/crypto"
|
2020-08-15 22:57:27 +00:00
|
|
|
"github.com/filecoin-project/specs-actors/actors/runtime"
|
|
|
|
|
|
|
|
cbor "github.com/ipfs/go-ipld-cbor"
|
|
|
|
)
|
|
|
|
|
|
|
|
type testSyscalls struct {
|
|
|
|
runtime.Syscalls
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO VerifySignature this will always succeed; but we want to be able to test failures too.
|
|
|
|
func (fss *testSyscalls) VerifySignature(_ crypto.Signature, _ address.Address, _ []byte) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO VerifySeal this will always succeed; but we want to be able to test failures too.
|
2020-09-07 03:49:10 +00:00
|
|
|
func (fss *testSyscalls) VerifySeal(_ proof.SealVerifyInfo) error {
|
2020-08-15 22:57:27 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO VerifyPoSt this will always succeed; but we want to be able to test failures too.
|
2020-09-07 03:49:10 +00:00
|
|
|
func (fss *testSyscalls) VerifyPoSt(_ proof.WindowPoStVerifyInfo) error {
|
2020-08-15 22:57:27 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func mkFakedSigSyscalls(base vm.SyscallBuilder) vm.SyscallBuilder {
|
|
|
|
return func(ctx context.Context, cstate *state.StateTree, cst cbor.IpldStore) runtime.Syscalls {
|
|
|
|
return &testSyscalls{
|
|
|
|
base(ctx, cstate, cst),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|