fixup! first pass at integrating chain-validation

This commit is contained in:
frrist 2019-11-12 11:23:59 -08:00
parent 60a19a1155
commit 6545c20666
2 changed files with 27 additions and 19 deletions

View File

@ -11,30 +11,11 @@ import (
"github.com/stretchr/testify/require"
"github.com/filecoin-project/chain-validation/pkg/state"
"github.com/filecoin-project/chain-validation/pkg/suites"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/address"
)
func TestStorageMinerValidation(t *testing.T) {
factory := NewFactories()
suites.CreateStorageMinerAndUpdatePeerIDTest(t, factory)
}
func TestValueTransfer(t *testing.T) {
factory := NewFactories()
suites.AccountValueTransferSuccess(t, factory, 126)
suites.AccountValueTransferZeroFunds(t, factory, 112)
suites.AccountValueTransferOverBalanceNonZero(t, factory, 0)
suites.AccountValueTransferOverBalanceZero(t, factory, 0)
suites.AccountValueTransferToSelf(t, factory, 0)
suites.AccountValueTransferFromKnownToUnknownAccount(t, factory, 0)
suites.AccountValueTransferFromUnknownToKnownAccount(t, factory, 0)
suites.AccountValueTransferFromUnknownToUnknownAccount(t, factory, 0)
}
//
// some helpers tests to verify chain-validation can encode parameters to the CBOR lotus uses
//

View File

@ -0,0 +1,27 @@
package vm_test
import (
"testing"
"github.com/filecoin-project/chain-validation/pkg/suites"
"github.com/filecoin-project/lotus/chain/validation"
)
func TestStorageMinerValidation(t *testing.T) {
factory := validation.NewFactories()
suites.CreateStorageMinerAndUpdatePeerIDTest(t, factory)
}
func TestValueTransfer(t *testing.T) {
factory := validation.NewFactories()
suites.AccountValueTransferSuccess(t, factory, 126)
suites.AccountValueTransferZeroFunds(t, factory, 112)
suites.AccountValueTransferOverBalanceNonZero(t, factory, 0)
suites.AccountValueTransferOverBalanceZero(t, factory, 0)
suites.AccountValueTransferToSelf(t, factory, 0)
suites.AccountValueTransferFromKnownToUnknownAccount(t, factory, 0)
suites.AccountValueTransferFromUnknownToKnownAccount(t, factory, 0)
suites.AccountValueTransferFromUnknownToUnknownAccount(t, factory, 0)
}