diff --git a/api/api_test.go b/api/api_test.go index 1316d9fa4ca..0565835d775 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -1,4 +1,3 @@ -// stm: #unit package api import ( @@ -30,7 +29,6 @@ func goCmd() string { } func TestDoesntDependOnFFI(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_001 deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output() if err != nil { t.Fatal(err) @@ -43,7 +41,6 @@ func TestDoesntDependOnFFI(t *testing.T) { } func TestDoesntDependOnBuild(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_002 deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output() if err != nil { t.Fatal(err) @@ -56,7 +53,6 @@ func TestDoesntDependOnBuild(t *testing.T) { } func TestReturnTypes(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_001 errType := reflect.TypeOf(new(error)).Elem() bareIface := reflect.TypeOf(new(interface{})).Elem() jmarsh := reflect.TypeOf(new(json.Marshaler)).Elem() @@ -122,7 +118,6 @@ func TestReturnTypes(t *testing.T) { } func TestPermTags(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_PERM_TAGS_001 _ = PermissionedFullAPI(&FullNodeStruct{}) _ = PermissionedStorMinerAPI(&StorageMinerStruct{}) _ = PermissionedWorkerAPI(&WorkerStruct{}) diff --git a/api/proxy_util_test.go b/api/proxy_util_test.go index adc78a7d15c..3cbc466b6a4 100644 --- a/api/proxy_util_test.go +++ b/api/proxy_util_test.go @@ -1,4 +1,3 @@ -// stm: #unit package api import ( @@ -30,7 +29,6 @@ type StrC struct { } func TestGetInternalStructs(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001 var proxy StrA sts := GetInternalStructs(&proxy) @@ -46,7 +44,6 @@ func TestGetInternalStructs(t *testing.T) { } func TestNestedInternalStructs(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001 var proxy StrC // check that only the top-level internal struct gets picked up diff --git a/blockstore/badger/blockstore_test.go b/blockstore/badger/blockstore_test.go index d253f37d95d..00153fea8e2 100644 --- a/blockstore/badger/blockstore_test.go +++ b/blockstore/badger/blockstore_test.go @@ -1,4 +1,3 @@ -// stm: #unit package badgerbs import ( @@ -19,8 +18,6 @@ import ( ) func TestBadgerBlockstore(t *testing.T) { - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 (&Suite{ NewBlockstore: newBlockstore(DefaultOptions), OpenBlockstore: openBlockstore(DefaultOptions), @@ -39,8 +36,6 @@ func TestBadgerBlockstore(t *testing.T) { } func TestStorageKey(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_STORAGE_KEY_001 bs, _ := newBlockstore(DefaultOptions)(t) bbs := bs.(*Blockstore) defer bbs.Close() //nolint:errcheck @@ -254,16 +249,10 @@ func testMove(t *testing.T, optsF func(string) Options) { } func TestMoveNoPrefix(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001 testMove(t, DefaultOptions) } func TestMoveWithPrefix(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001 testMove(t, func(path string) Options { opts := DefaultOptions(path) opts.Prefix = "/prefixed/" diff --git a/blockstore/badger/blockstore_test_suite.go b/blockstore/badger/blockstore_test_suite.go index 92b854ab34d..25936201b67 100644 --- a/blockstore/badger/blockstore_test_suite.go +++ b/blockstore/badger/blockstore_test_suite.go @@ -1,4 +1,3 @@ -// stm: #unit package badgerbs import ( @@ -46,8 +45,6 @@ func (s *Suite) RunTests(t *testing.T, prefix string) { } func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { @@ -61,8 +58,6 @@ func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) { } func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_GET_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { @@ -74,9 +69,6 @@ func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) { } func (s *Suite) TestPutThenGetBlock(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_GET_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { @@ -94,8 +86,6 @@ func (s *Suite) TestPutThenGetBlock(t *testing.T) { } func (s *Suite) TestHas(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { @@ -117,9 +107,6 @@ func (s *Suite) TestHas(t *testing.T) { } func (s *Suite) TestCidv0v1(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_GET_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { @@ -137,9 +124,6 @@ func (s *Suite) TestCidv0v1(t *testing.T) { } func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_GET_SIZE_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) @@ -172,8 +156,6 @@ func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) { } func (s *Suite) TestAllKeysSimple(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { defer func() { require.NoError(t, c.Close()) }() @@ -190,9 +172,6 @@ func (s *Suite) TestAllKeysSimple(t *testing.T) { } func (s *Suite) TestAllKeysRespectsContext(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001 bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { defer func() { require.NoError(t, c.Close()) }() @@ -223,7 +202,6 @@ func (s *Suite) TestAllKeysRespectsContext(t *testing.T) { } func (s *Suite) TestDoubleClose(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 bs, _ := s.NewBlockstore(t) c, ok := bs.(io.Closer) if !ok { @@ -234,9 +212,6 @@ func (s *Suite) TestDoubleClose(t *testing.T) { } func (s *Suite) TestReopenPutGet(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_GET_001 ctx := context.Background() bs, path := s.NewBlockstore(t) c, ok := bs.(io.Closer) @@ -263,10 +238,6 @@ func (s *Suite) TestReopenPutGet(t *testing.T) { } func (s *Suite) TestPutMany(t *testing.T) { - //stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001 - //stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_PUT_MANY_001 - //stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) if c, ok := bs.(io.Closer); ok { @@ -299,10 +270,6 @@ func (s *Suite) TestPutMany(t *testing.T) { } func (s *Suite) TestDelete(t *testing.T) { - //stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001 - //stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_POOLED_STORAGE_HAS_001 - //stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001, @SPLITSTORE_BADGER_HAS_001 - //stm: @SPLITSTORE_BADGER_PUT_MANY_001 ctx := context.Background() bs, _ := s.NewBlockstore(t) diff --git a/blockstore/splitstore/markset_test.go b/blockstore/splitstore/markset_test.go index 6cc481852e6..25dff48e1e8 100644 --- a/blockstore/splitstore/markset_test.go +++ b/blockstore/splitstore/markset_test.go @@ -1,4 +1,3 @@ -// stm: #unit package splitstore import ( @@ -9,8 +8,6 @@ import ( ) func TestMapMarkSet(t *testing.T) { - //stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001 - //stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001 testMarkSet(t, "map") testMarkSetRecovery(t, "map") testMarkSetMarkMany(t, "map") @@ -19,8 +16,6 @@ func TestMapMarkSet(t *testing.T) { } func TestBadgerMarkSet(t *testing.T) { - //stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001 - //stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001 bs := badgerMarkSetBatchSize badgerMarkSetBatchSize = 1 t.Cleanup(func() { @@ -42,7 +37,6 @@ func testMarkSet(t *testing.T, lsType string) { } defer env.Close() //nolint:errcheck - // stm: @SPLITSTORE_MARKSET_CREATE_001 hotSet, err := env.New("hot", 0) if err != nil { t.Fatal(err) @@ -62,7 +56,6 @@ func testMarkSet(t *testing.T, lsType string) { return cid.NewCidV1(cid.Raw, h) } - // stm: @SPLITSTORE_MARKSET_HAS_001 mustHave := func(s MarkSet, cid cid.Cid) { t.Helper() has, err := s.Has(cid) @@ -92,7 +85,6 @@ func testMarkSet(t *testing.T, lsType string) { k3 := makeCid("c") k4 := makeCid("d") - // stm: @SPLITSTORE_MARKSET_MARK_001 hotSet.Mark(k1) //nolint hotSet.Mark(k2) //nolint coldSet.Mark(k3) //nolint @@ -143,7 +135,6 @@ func testMarkSet(t *testing.T, lsType string) { mustNotHave(coldSet, k3) mustNotHave(coldSet, k4) - //stm: @SPLITSTORE_MARKSET_CLOSE_001 err = hotSet.Close() if err != nil { t.Fatal(err) @@ -164,7 +155,6 @@ func testMarkSetVisitor(t *testing.T, lsType string) { } defer env.Close() //nolint:errcheck - //stm: @SPLITSTORE_MARKSET_CREATE_VISITOR_001 visitor, err := env.New("test", 0) if err != nil { t.Fatal(err) diff --git a/blockstore/splitstore/splitstore_test.go b/blockstore/splitstore/splitstore_test.go index b28f45c8441..23eadec1fbe 100644 --- a/blockstore/splitstore/splitstore_test.go +++ b/blockstore/splitstore/splitstore_test.go @@ -1,4 +1,3 @@ -// stm: #unit package splitstore import ( @@ -223,16 +222,10 @@ func testSplitStore(t *testing.T, cfg *Config) { } func TestSplitStoreCompaction(t *testing.T) { - //stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001 - //stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001 - //stm: @SPLITSTORE_SPLITSTORE_CLOSE_001 testSplitStore(t, &Config{MarkSetType: "map", UniversalColdBlocks: true}) } func TestSplitStoreCompactionWithBadger(t *testing.T) { - //stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001 - //stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001 - //stm: @SPLITSTORE_SPLITSTORE_CLOSE_001 bs := badgerMarkSetBatchSize badgerMarkSetBatchSize = 1 t.Cleanup(func() { @@ -242,9 +235,6 @@ func TestSplitStoreCompactionWithBadger(t *testing.T) { } func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) { - //stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001 - //stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001 - //stm: @SPLITSTORE_SPLITSTORE_CLOSE_001 ctx := context.Background() chain := &mockChain{t: t} diff --git a/blockstore/timed_test.go b/blockstore/timed_test.go index 931f145075b..9190f166bc8 100644 --- a/blockstore/timed_test.go +++ b/blockstore/timed_test.go @@ -1,4 +1,3 @@ -// stm: #unit package blockstore import ( @@ -13,9 +12,6 @@ import ( ) func TestTimedCacheBlockstoreSimple(t *testing.T) { - //stm: @SPLITSTORE_TIMED_BLOCKSTORE_START_001 - //stm: @SPLITSTORE_TIMED_BLOCKSTORE_PUT_001, @SPLITSTORE_TIMED_BLOCKSTORE_HAS_001, @SPLITSTORE_TIMED_BLOCKSTORE_GET_001 - //stm: @SPLITSTORE_TIMED_BLOCKSTORE_ALL_KEYS_CHAN_001 tc := NewTimedCacheBlockstore(10 * time.Millisecond) mClock := clock.NewMock() mClock.Set(time.Now()) diff --git a/blockstore/union_test.go b/blockstore/union_test.go index 57948994770..1db38356b9d 100644 --- a/blockstore/union_test.go +++ b/blockstore/union_test.go @@ -1,4 +1,3 @@ -// stm: #unit package blockstore import ( @@ -17,7 +16,6 @@ var ( ) func TestUnionBlockstore_Get(t *testing.T) { - //stm: @SPLITSTORE_UNION_BLOCKSTORE_GET_001 ctx := context.Background() m1 := NewMemory() m2 := NewMemory() @@ -37,9 +35,6 @@ func TestUnionBlockstore_Get(t *testing.T) { } func TestUnionBlockstore_Put_PutMany_Delete_AllKeysChan(t *testing.T) { - //stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_001, @SPLITSTORE_UNION_BLOCKSTORE_HAS_001 - //stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_MANY_001, @SPLITSTORE_UNION_BLOCKSTORE_DELETE_001 - //stm: @SPLITSTORE_UNION_BLOCKSTORE_ALL_KEYS_CHAN_001 ctx := context.Background() m1 := NewMemory() m2 := NewMemory() diff --git a/build/openrpc_test.go b/build/openrpc_test.go index 05119fd5d70..45e143f18e5 100644 --- a/build/openrpc_test.go +++ b/build/openrpc_test.go @@ -1,4 +1,3 @@ -// stm: #unit package build import ( @@ -8,7 +7,6 @@ import ( ) func TestOpenRPCDiscoverJSON_Version(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_OPENRPC_VERSION_001 // openRPCDocVersion is the current OpenRPC version of the API docs. openRPCDocVersion := "1.2.6" diff --git a/chain/actors/adt/diff_adt_test.go b/chain/actors/adt/diff_adt_test.go index 7ea3c53e556..0121ed58084 100644 --- a/chain/actors/adt/diff_adt_test.go +++ b/chain/actors/adt/diff_adt_test.go @@ -1,4 +1,3 @@ -// stm: #unit package adt import ( @@ -43,7 +42,6 @@ func TestDiffAdtArray(t *testing.T) { changes := new(TestDiffArray) - //stm: @CHAIN_ADT_ARRAY_DIFF_001 assert.NoError(t, DiffAdtArray(arrA, arrB, changes)) assert.NotNil(t, changes) @@ -98,7 +96,6 @@ func TestDiffAdtMap(t *testing.T) { changes := new(TestDiffMap) - //stm: @CHAIN_ADT_MAP_DIFF_001 assert.NoError(t, DiffAdtMap(mapA, mapB, changes)) assert.NotNil(t, changes) diff --git a/chain/actors/aerrors/error_test.go b/chain/actors/aerrors/error_test.go index 8c3738c8816..fffc27ec984 100644 --- a/chain/actors/aerrors/error_test.go +++ b/chain/actors/aerrors/error_test.go @@ -1,4 +1,3 @@ -// stm: #unit package aerrors_test import ( @@ -13,7 +12,6 @@ import ( ) func TestFatalError(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_ACTOR_ERRORS_001 e1 := xerrors.New("out of disk space") e2 := xerrors.Errorf("could not put node: %w", e1) e3 := xerrors.Errorf("could not save head: %w", e2) @@ -27,7 +25,6 @@ func TestFatalError(t *testing.T) { assert.True(t, IsFatal(aw4), "should be fatal") } func TestAbsorbeError(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_ACTOR_ERRORS_001 e1 := xerrors.New("EOF") e2 := xerrors.Errorf("could not decode: %w", e1) ae := Absorb(e2, 35, "failed to decode CBOR") diff --git a/chain/actors/policy/policy_test.go b/chain/actors/policy/policy_test.go index 5fd4bd7b094..24e47aaa035 100644 --- a/chain/actors/policy/policy_test.go +++ b/chain/actors/policy/policy_test.go @@ -1,4 +1,3 @@ -// stm: #unit package policy import ( @@ -22,7 +21,6 @@ func TestSupportedProofTypes(t *testing.T) { for t := range miner0.SupportedProofTypes { oldTypes = append(oldTypes, t) } - //stm: @BLOCKCHAIN_POLICY_SET_MAX_SUPPORTED_PROOF_TYPES_001 t.Cleanup(func() { SetSupportedProofTypes(oldTypes...) }) @@ -34,7 +32,6 @@ func TestSupportedProofTypes(t *testing.T) { abi.RegisteredSealProof_StackedDrg2KiBV1: {}, }, ) - //stm: @BLOCKCHAIN_POLICY_ADD_MAX_SUPPORTED_PROOF_TYPES_001 AddSupportedProofTypes(abi.RegisteredSealProof_StackedDrg8MiBV1) require.EqualValues(t, miner0.SupportedProofTypes, @@ -47,7 +44,6 @@ func TestSupportedProofTypes(t *testing.T) { // Tests assumptions about policies being the same between actor versions. func TestAssumptions(t *testing.T) { - //stm: @BLOCKCHAIN_POLICY_ASSUMPTIONS_001 require.EqualValues(t, miner0.SupportedProofTypes, miner2.PreCommitSealProofTypesV0) require.Equal(t, miner0.PreCommitChallengeDelay, miner2.PreCommitChallengeDelay) require.Equal(t, miner0.MaxSectorExpirationExtension, miner2.MaxSectorExpirationExtension) @@ -61,7 +57,6 @@ func TestAssumptions(t *testing.T) { } func TestPartitionSizes(t *testing.T) { - //stm: @CHAIN_ACTOR_PARTITION_SIZES_001 for _, p := range abi.SealProofInfos { sizeNew, err := builtin2.PoStProofWindowPoStPartitionSectors(p.WindowPoStProof) require.NoError(t, err) diff --git a/chain/beacon/drand/drand_test.go b/chain/beacon/drand/drand_test.go index a5f4a6117d0..9b55135760f 100644 --- a/chain/beacon/drand/drand_test.go +++ b/chain/beacon/drand/drand_test.go @@ -1,4 +1,3 @@ -// stm: ignore // Only tests external library behavior, therefore it should not be annotated package drand diff --git a/chain/events/events_test.go b/chain/events/events_test.go index cb54a77ac36..8ce21053bda 100644 --- a/chain/events/events_test.go +++ b/chain/events/events_test.go @@ -1,4 +1,3 @@ -// stm: #unit package events import ( @@ -361,7 +360,6 @@ func (fcs *fakeCS) advance(rev, app, drop int, msgs map[int]cid.Cid, nulls ...in var _ EventHelperAPI = &fakeCS{} func TestAt(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) require.NoError(t, err) @@ -422,7 +420,6 @@ func TestAt(t *testing.T) { } func TestAtNullTrigger(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) require.NoError(t, err) @@ -452,7 +449,6 @@ func TestAtNullTrigger(t *testing.T) { } func TestAtNullConf(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001, @EVENTS_HEIGHT_REVERT_001 ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -491,7 +487,6 @@ func TestAtNullConf(t *testing.T) { } func TestAtStart(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -522,7 +517,6 @@ func TestAtStart(t *testing.T) { } func TestAtStartConfidence(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -549,7 +543,6 @@ func TestAtStartConfidence(t *testing.T) { } func TestAtChained(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -580,7 +573,6 @@ func TestAtChained(t *testing.T) { } func TestAtChainedConfidence(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -611,7 +603,6 @@ func TestAtChainedConfidence(t *testing.T) { } func TestAtChainedConfidenceNull(t *testing.T) { - //stm: @EVENTS_HEIGHT_CHAIN_AT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -643,7 +634,6 @@ func matchAddrMethod(to address.Address, m abi.MethodNum) func(msg *types.Messag } func TestCalled(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -849,7 +839,6 @@ func TestCalled(t *testing.T) { } func TestCalledTimeout(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -910,7 +899,6 @@ func TestCalledTimeout(t *testing.T) { } func TestCalledOrder(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -967,7 +955,6 @@ func TestCalledOrder(t *testing.T) { } func TestCalledNull(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -1026,7 +1013,6 @@ func TestCalledNull(t *testing.T) { } func TestRemoveTriggersOnMessage(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -1110,7 +1096,6 @@ type testStateChange struct { } func TestStateChanged(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -1196,7 +1181,6 @@ func TestStateChanged(t *testing.T) { } func TestStateChangedRevert(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -1273,7 +1257,6 @@ func TestStateChangedRevert(t *testing.T) { } func TestStateChangedTimeout(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 timeoutHeight := abi.ChainEpoch(20) confidence := 3 @@ -1351,7 +1334,6 @@ func TestStateChangedTimeout(t *testing.T) { } func TestCalledMultiplePerEpoch(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) events, err := NewEvents(context.Background(), fcs) @@ -1404,7 +1386,6 @@ func TestCalledMultiplePerEpoch(t *testing.T) { } func TestCachedSameBlock(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 fcs := newFakeCS(t) _, err := NewEvents(context.Background(), fcs) @@ -1439,7 +1420,6 @@ func (t *testObserver) Revert(_ context.Context, from, to *types.TipSet) error { } func TestReconnect(t *testing.T) { - //stm: @EVENTS_EVENTS_CALLED_001, @EVENTS_HEIGHT_REVERT_001 ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/chain/events/state/predicates_test.go b/chain/events/state/predicates_test.go index 79c1d2e0eae..4975f9983ce 100644 --- a/chain/events/state/predicates_test.go +++ b/chain/events/state/predicates_test.go @@ -1,4 +1,3 @@ -// stm: #unit package state import ( @@ -33,12 +32,7 @@ func init() { } func TestMarketPredicates(t *testing.T) { - //stm: @EVENTS_PREDICATES_ON_ACTOR_STATE_CHANGED_001, @EVENTS_PREDICATES_DEAL_STATE_CHANGED_001 - //stm: @EVENTS_PREDICATES_DEAL_CHANGED_FOR_IDS - //stm: @EVENTS_PREDICATES_ON_BALANCE_CHANGED_001, @EVENTS_PREDICATES_BALANCE_CHANGED_FOR_ADDRESS_001 - //stm: @EVENTS_PREDICATES_ON_DEAL_PROPOSAL_CHANGED_001, @EVENTS_PREDICATES_PROPOSAL_AMT_CHANGED_001 - //stm: @EVENTS_PREDICATES_DEAL_STATE_CHANGED_001, @EVENTS_PREDICATES_DEAL_AMT_CHANGED_001 ctx := context.Background() bs := bstore.NewMemorySync() store := adt2.WrapStore(ctx, cbornode.NewCborStore(bs)) @@ -337,8 +331,6 @@ func TestMarketPredicates(t *testing.T) { } func TestMinerSectorChange(t *testing.T) { - //stm: @EVENTS_PREDICATES_ON_ACTOR_STATE_CHANGED_001, @EVENTS_PREDICATES_MINER_ACTOR_CHANGE_001 - //stm: @EVENTS_PREDICATES_MINER_SECTOR_CHANGE_001 ctx := context.Background() bs := bstore.NewMemorySync() store := adt2.WrapStore(ctx, cbornode.NewCborStore(bs)) diff --git a/chain/events/tscache_test.go b/chain/events/tscache_test.go index ec312740b7e..9b2d284d2f5 100644 --- a/chain/events/tscache_test.go +++ b/chain/events/tscache_test.go @@ -1,4 +1,3 @@ -// stm: #unit package events import ( @@ -94,7 +93,6 @@ func (h *cacheHarness) skip(n abi.ChainEpoch) { } func TestTsCache(t *testing.T) { - //stm: @EVENTS_CACHE_GET_CHAIN_HEAD_001, @EVENTS_CACHE_GET_001, @EVENTS_CACHE_ADD_001 h := newCacheharness(t) for i := 0; i < 9000; i++ { @@ -107,8 +105,6 @@ func TestTsCache(t *testing.T) { } func TestTsCacheNulls(t *testing.T) { - //stm: @EVENTS_CACHE_GET_CHAIN_HEAD_001, @EVENTS_CACHE_GET_CHAIN_TIPSET_BEFORE_001, @EVENTS_CACHE_GET_CHAIN_TIPSET_AFTER_001 - //stm: @EVENTS_CACHE_GET_001, @EVENTS_CACHE_ADD_001 ctx := context.Background() h := newCacheharness(t) @@ -187,7 +183,6 @@ func (tc *tsCacheAPIStorageCallCounter) ChainGetTipSet(ctx context.Context, tsk } func TestTsCacheEmpty(t *testing.T) { - //stm: @EVENTS_CACHE_GET_CHAIN_HEAD_001 // Calling best on an empty cache should just call out to the chain API callCounter := &tsCacheAPIStorageCallCounter{t: t} tsc := newTSCache(callCounter, 50) @@ -197,7 +192,6 @@ func TestTsCacheEmpty(t *testing.T) { } func TestTsCacheSkip(t *testing.T) { - //stm: @EVENTS_CACHE_GET_CHAIN_HEAD_001, @EVENTS_CACHE_GET_001, @EVENTS_CACHE_ADD_001 h := newCacheharness(t) ts, err := types.NewTipSet([]*types.BlockHeader{{ diff --git a/chain/gen/gen_test.go b/chain/gen/gen_test.go index d04e55a265a..8c38328d072 100644 --- a/chain/gen/gen_test.go +++ b/chain/gen/gen_test.go @@ -1,4 +1,3 @@ -// stm: #unit package gen import ( @@ -35,7 +34,6 @@ func testGeneration(t testing.TB, n int, msgs int, sectors int) { } func TestChainGeneration(t *testing.T) { - //stm: @CHAIN_GEN_NEW_GEN_WITH_SECTORS_001, @CHAIN_GEN_NEXT_TIPSET_001 t.Run("10-20-1", func(t *testing.T) { testGeneration(t, 10, 20, 1) }) t.Run("10-20-25", func(t *testing.T) { testGeneration(t, 10, 20, 25) }) } diff --git a/chain/market/fundmanager_test.go b/chain/market/fundmanager_test.go index fb359aa0767..e7163dd338e 100644 --- a/chain/market/fundmanager_test.go +++ b/chain/market/fundmanager_test.go @@ -1,4 +1,3 @@ -// stm: #unit package market import ( @@ -26,7 +25,6 @@ import ( // TestFundManagerBasic verifies that the basic fund manager operations work func TestFundManagerBasic(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001, @MARKET_RELEASE_FUNDS_001, @MARKET_WITHDRAW_FUNDS_001 s := setup(t) defer s.fm.Stop() @@ -111,7 +109,6 @@ func TestFundManagerBasic(t *testing.T) { // TestFundManagerParallel verifies that operations can be run in parallel func TestFundManagerParallel(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001, @MARKET_RELEASE_FUNDS_001, @MARKET_WITHDRAW_FUNDS_001 s := setup(t) defer s.fm.Stop() @@ -203,7 +200,6 @@ func TestFundManagerParallel(t *testing.T) { // TestFundManagerReserveByWallet verifies that reserve requests are grouped by wallet func TestFundManagerReserveByWallet(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001 s := setup(t) defer s.fm.Stop() @@ -297,7 +293,6 @@ func TestFundManagerReserveByWallet(t *testing.T) { // TestFundManagerWithdrawalLimit verifies that as many withdraw operations as // possible are processed func TestFundManagerWithdrawalLimit(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001, @MARKET_RELEASE_FUNDS_001, @MARKET_WITHDRAW_FUNDS_001 s := setup(t) defer s.fm.Stop() @@ -392,7 +387,6 @@ func TestFundManagerWithdrawalLimit(t *testing.T) { // TestFundManagerWithdrawByWallet verifies that withdraw requests are grouped by wallet func TestFundManagerWithdrawByWallet(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001, @MARKET_RELEASE_FUNDS_001, @MARKET_WITHDRAW_FUNDS_001 s := setup(t) defer s.fm.Stop() @@ -502,7 +496,6 @@ func TestFundManagerWithdrawByWallet(t *testing.T) { // TestFundManagerRestart verifies that waiting for incomplete requests resumes // on restart func TestFundManagerRestart(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001 s := setup(t) defer s.fm.Stop() @@ -569,7 +562,6 @@ func TestFundManagerRestart(t *testing.T) { // 3. Deal B completes, reducing addr1 by 7: reserved 12 available 12 -> 5 // 4. Deal A releases 5 from addr1: reserved 12 -> 7 available 5 func TestFundManagerReleaseAfterPublish(t *testing.T) { - //stm: @MARKET_RESERVE_FUNDS_001, @MARKET_RELEASE_FUNDS_001 s := setup(t) defer s.fm.Stop() diff --git a/chain/messagepool/block_proba_test.go b/chain/messagepool/block_proba_test.go index 2dc1dc25d72..6447048453c 100644 --- a/chain/messagepool/block_proba_test.go +++ b/chain/messagepool/block_proba_test.go @@ -1,4 +1,3 @@ -// stm: #unit package messagepool import ( @@ -8,7 +7,6 @@ import ( ) func TestBlockProbability(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_BLOCK_PROB_001 mp := &MessagePool{} bp := mp.blockProbabilities(1 - 0.15) t.Logf("%+v\n", bp) @@ -21,7 +19,6 @@ func TestBlockProbability(t *testing.T) { } func TestWinnerProba(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_BLOCK_PROB_002 const N = 1000000 winnerProba := noWinnersProb() sum := 0 diff --git a/chain/messagepool/check_test.go b/chain/messagepool/check_test.go index 8458bdb0f6b..378c42f4e9d 100644 --- a/chain/messagepool/check_test.go +++ b/chain/messagepool/check_test.go @@ -1,4 +1,3 @@ -// stm: #unit package messagepool import ( @@ -34,7 +33,6 @@ func getCheckMessageStatus(statusCode api.CheckStatusCode, msgStatuses []api.Mes } func TestCheckMessages(t *testing.T) { - //stm: @CHAIN_MEMPOOL_CHECK_MESSAGES_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -88,7 +86,6 @@ func TestCheckMessages(t *testing.T) { } func TestCheckPendingMessages(t *testing.T) { - //stm: @CHAIN_MEMPOOL_CHECK_PENDING_MESSAGES_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -145,7 +142,6 @@ func TestCheckPendingMessages(t *testing.T) { } func TestCheckReplaceMessages(t *testing.T) { - //stm: @CHAIN_MEMPOOL_CHECK_REPLACE_MESSAGES_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) diff --git a/chain/messagepool/messagepool_test.go b/chain/messagepool/messagepool_test.go index 77bd1679146..4161550b057 100644 --- a/chain/messagepool/messagepool_test.go +++ b/chain/messagepool/messagepool_test.go @@ -1,4 +1,3 @@ -// stm: #unit package messagepool import ( @@ -232,7 +231,6 @@ func (tma *testMpoolAPI) ChainComputeBaseFee(ctx context.Context, ts *types.TipS func assertNonce(t *testing.T, mp *MessagePool, addr address.Address, val uint64) { t.Helper() - // stm: @CHAIN_MEMPOOL_GET_NONCE_001 n, err := mp.GetNonce(context.TODO(), addr, types.EmptyTSK) if err != nil { t.Fatal(err) @@ -251,7 +249,6 @@ func mustAdd(t *testing.T, mp *MessagePool, msg *types.SignedMessage) { } func TestMessagePool(t *testing.T) { - // stm: @CHAIN_MEMPOOL_GET_NONCE_001 tma := newTestMpoolAPI() @@ -354,7 +351,6 @@ func TestCheckMessageBig(t *testing.T) { Message: *msg, Signature: *sig, } - // stm: @CHAIN_MEMPOOL_PUSH_001 err = mp.Add(context.TODO(), sm) assert.ErrorIs(t, err, ErrMessageTooBig) } @@ -396,10 +392,8 @@ func TestMessagePoolMessagesInEachBlock(t *testing.T) { tma.applyBlock(t, a) tsa := mock.TipSet(a) - // stm: @CHAIN_MEMPOOL_PENDING_001 _, _ = mp.Pending(context.TODO()) - // stm: @CHAIN_MEMPOOL_SELECT_001 selm, _ := mp.SelectMessages(context.Background(), tsa, 1) if len(selm) == 0 { t.Fatal("should have returned the rest of the messages") @@ -460,7 +454,6 @@ func TestRevertMessages(t *testing.T) { assertNonce(t, mp, sender, 4) - // stm: @CHAIN_MEMPOOL_PENDING_001 p, _ := mp.Pending(context.TODO()) fmt.Printf("%+v\n", p) if len(p) != 3 { @@ -519,7 +512,6 @@ func TestPruningSimple(t *testing.T) { mp.Prune() - // stm: @CHAIN_MEMPOOL_PENDING_001 msgs, _ := mp.Pending(context.TODO()) if len(msgs) != 5 { t.Fatal("expected only 5 messages in pool, got: ", len(msgs)) @@ -592,7 +584,6 @@ func TestLoadLocal(t *testing.T) { msgs := make(map[cid.Cid]struct{}) for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) - // stm: @CHAIN_MEMPOOL_PUSH_001 cid, err := mp.Push(context.TODO(), m, true) if err != nil { t.Fatal(err) @@ -609,7 +600,6 @@ func TestLoadLocal(t *testing.T) { t.Fatal(err) } - // stm: @CHAIN_MEMPOOL_PENDING_001 pmsgs, _ := mp.Pending(context.TODO()) if len(msgs) != len(pmsgs) { t.Fatalf("expected %d messages, but got %d", len(msgs), len(pmsgs)) @@ -665,7 +655,6 @@ func TestClearAll(t *testing.T) { gasLimit := gasguess.Costs[gasguess.CostKey{Code: builtin2.StorageMarketActorCodeID, M: 2}] for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) - // stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m, true) if err != nil { t.Fatal(err) @@ -677,10 +666,8 @@ func TestClearAll(t *testing.T) { mustAdd(t, mp, m) } - // stm: @CHAIN_MEMPOOL_CLEAR_001 mp.Clear(context.Background(), true) - // stm: @CHAIN_MEMPOOL_PENDING_001 pending, _ := mp.Pending(context.TODO()) if len(pending) > 0 { t.Fatalf("cleared the mpool, but got %d pending messages", len(pending)) @@ -723,7 +710,6 @@ func TestClearNonLocal(t *testing.T) { gasLimit := gasguess.Costs[gasguess.CostKey{Code: builtin2.StorageMarketActorCodeID, M: 2}] for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) - // stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m, true) if err != nil { t.Fatal(err) @@ -735,10 +721,8 @@ func TestClearNonLocal(t *testing.T) { mustAdd(t, mp, m) } - // stm: @CHAIN_MEMPOOL_CLEAR_001 mp.Clear(context.Background(), false) - // stm: @CHAIN_MEMPOOL_PENDING_001 pending, _ := mp.Pending(context.TODO()) if len(pending) != 10 { t.Fatalf("expected 10 pending messages, but got %d instead", len(pending)) @@ -796,7 +780,6 @@ func TestUpdates(t *testing.T) { for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) - // stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m, true) if err != nil { t.Fatal(err) @@ -820,7 +803,6 @@ func TestUpdates(t *testing.T) { } func TestMessageBelowMinGasFee(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -866,7 +848,6 @@ func TestMessageBelowMinGasFee(t *testing.T) { } func TestMessageValueTooHigh(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -914,7 +895,6 @@ func TestMessageValueTooHigh(t *testing.T) { } func TestMessageSignatureInvalid(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -959,7 +939,6 @@ func TestMessageSignatureInvalid(t *testing.T) { } func TestAddMessageTwice(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -1005,7 +984,6 @@ func TestAddMessageTwice(t *testing.T) { } func TestAddMessageTwiceNonceGap(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -1059,7 +1037,6 @@ func TestAddMessageTwiceCidDiff(t *testing.T) { // Create message with different data, so CID is different sm2 := makeTestMessage(w, from, to, 0, 50_000_001, minimumBaseFee.Uint64()) - // stm: @CHAIN_MEMPOOL_PUSH_001 // then try to add message again err = mp.Add(context.TODO(), sm2) // assert.Contains(t, err.Error(), "replace by fee has too low GasPremium") @@ -1068,7 +1045,6 @@ func TestAddMessageTwiceCidDiff(t *testing.T) { } func TestAddMessageTwiceCidDiffReplaced(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -1097,7 +1073,6 @@ func TestAddMessageTwiceCidDiffReplaced(t *testing.T) { } func TestRemoveMessage(t *testing.T) { - // stm: @CHAIN_MEMPOOL_PUSH_001 tma := newTestMpoolAPI() w, err := wallet.NewWallet(wallet.NewMemKeyStore()) @@ -1119,11 +1094,9 @@ func TestRemoveMessage(t *testing.T) { sm := makeTestMessage(w, from, to, 0, 50_000_000, minimumBaseFee.Uint64()) mustAdd(t, mp, sm) - // stm: @CHAIN_MEMPOOL_REMOVE_001 // remove message for sender mp.Remove(context.TODO(), from, sm.Message.Nonce, true) - // stm: @CHAIN_MEMPOOL_PENDING_FOR_001 // check messages in pool: should be none present msgs := mp.pendingFor(context.TODO(), from) assert.Len(t, msgs, 0) diff --git a/chain/messagepool/repub_test.go b/chain/messagepool/repub_test.go index 9cdabc02fac..9a90dc7c227 100644 --- a/chain/messagepool/repub_test.go +++ b/chain/messagepool/repub_test.go @@ -1,4 +1,3 @@ -// stm: #unit package messagepool import ( @@ -17,7 +16,6 @@ import ( ) func TestRepubMessages(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001 oldRepublishBatchDelay := RepublishBatchDelay RepublishBatchDelay = time.Microsecond defer func() { @@ -59,7 +57,6 @@ func TestRepubMessages(t *testing.T) { for i := 0; i < 10; i++ { m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) - //stm: @CHAIN_MEMPOOL_PUSH_001 _, err := mp.Push(context.TODO(), m, true) if err != nil { t.Fatal(err) diff --git a/chain/messagepool/selection_test.go b/chain/messagepool/selection_test.go index 6f6901a3528..97f91ce83b0 100644 --- a/chain/messagepool/selection_test.go +++ b/chain/messagepool/selection_test.go @@ -1,4 +1,3 @@ -// stm: #unit package messagepool import ( @@ -74,8 +73,6 @@ func makeTestMpool() (*MessagePool, *testMpoolAPI) { } func TestMessageChains(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001 - //stm: @CHAIN_MEMPOOL_CREATE_MSG_CHAINS_001 mp, tma := makeTestMpool() // the actors @@ -312,7 +309,6 @@ func TestMessageChains(t *testing.T) { } func TestMessageChainSkipping(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_CREATE_MSG_CHAINS_001 // regression test for chain skip bug @@ -386,7 +382,6 @@ func TestMessageChainSkipping(t *testing.T) { } func TestBasicMessageSelection(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 oldMaxNonceGap := MaxNonceGap MaxNonceGap = 1000 defer func() { @@ -537,7 +532,6 @@ func TestBasicMessageSelection(t *testing.T) { } func TestMessageSelectionTrimmingGas(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -601,7 +595,6 @@ func TestMessageSelectionTrimmingGas(t *testing.T) { } func TestMessageSelectionTrimmingMsgsBasic(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -648,7 +641,6 @@ func TestMessageSelectionTrimmingMsgsBasic(t *testing.T) { } func TestMessageSelectionTrimmingMsgsTwoSendersBasic(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -715,7 +707,6 @@ func TestMessageSelectionTrimmingMsgsTwoSendersBasic(t *testing.T) { } func TestMessageSelectionTrimmingMsgsTwoSendersAdvanced(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -797,7 +788,6 @@ func TestMessageSelectionTrimmingMsgsTwoSendersAdvanced(t *testing.T) { } func TestPriorityMessageSelection(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -877,7 +867,6 @@ func TestPriorityMessageSelection(t *testing.T) { } func TestPriorityMessageSelection2(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -945,7 +934,6 @@ func TestPriorityMessageSelection2(t *testing.T) { } func TestPriorityMessageSelection3(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 mp, tma := makeTestMpool() // the actors @@ -1040,7 +1028,6 @@ func TestPriorityMessageSelection3(t *testing.T) { } func TestOptimalMessageSelection1(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 // this test uses just a single actor sending messages with a low tq // the chain depenent merging algorithm should pick messages from the actor @@ -1108,7 +1095,6 @@ func TestOptimalMessageSelection1(t *testing.T) { } func TestOptimalMessageSelection2(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 // this test uses two actors sending messages to each other, with the first // actor paying (much) higher gas premium than the second. @@ -1189,7 +1175,6 @@ func TestOptimalMessageSelection2(t *testing.T) { } func TestOptimalMessageSelection3(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 // this test uses 10 actors sending a block of messages to each other, with the first // actors paying higher gas premium than the subsequent actors. @@ -1434,7 +1419,6 @@ func makeZipfPremiumDistribution(rng *rand.Rand) func() uint64 { } func TestCompetitiveMessageSelectionExp(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 if testing.Short() { t.Skip("skipping in short mode") @@ -1459,7 +1443,6 @@ func TestCompetitiveMessageSelectionExp(t *testing.T) { } func TestCompetitiveMessageSelectionZipf(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @CHAIN_MEMPOOL_SELECT_001 if testing.Short() { t.Skip("skipping in short mode") @@ -1484,7 +1467,6 @@ func TestCompetitiveMessageSelectionZipf(t *testing.T) { } func TestGasReward(t *testing.T) { - //stm: @CHAIN_MEMPOOL_GET_GAS_REWARD_001 tests := []struct { Premium uint64 FeeCap uint64 @@ -1517,7 +1499,6 @@ func TestGasReward(t *testing.T) { } func TestRealWorldSelection(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @TOKEN_WALLET_SIGN_001, @CHAIN_MEMPOOL_SELECT_001 // load test-messages.json.gz and rewrite the messages so that // 1) we map each real actor to a test actor so that we can sign the messages @@ -1693,7 +1674,6 @@ readLoop: } func TestRealWorldSelectionTiming(t *testing.T) { - //stm: @TOKEN_WALLET_NEW_001, @TOKEN_WALLET_SIGN_001, @CHAIN_MEMPOOL_SELECT_001 // load test-messages.json.gz and rewrite the messages so that // 1) we map each real actor to a test actor so that we can sign the messages diff --git a/chain/messagesigner/messagesigner_test.go b/chain/messagesigner/messagesigner_test.go index 637f17b46cd..196469f3337 100644 --- a/chain/messagesigner/messagesigner_test.go +++ b/chain/messagesigner/messagesigner_test.go @@ -1,4 +1,3 @@ -// stm: #unit package messagesigner import ( @@ -59,7 +58,6 @@ func TestMessageSignerSignMessage(t *testing.T) { to2, err := w.WalletNew(ctx, types.KTSecp256k1) require.NoError(t, err) - //stm: @CHAIN_MESSAGE_SIGNER_NEW_SIGNER_001, @CHAIN_MESSAGE_SIGNER_SIGN_MESSAGE_001, @CHAIN_MESSAGE_SIGNER_SIGN_MESSAGE_005 type msgSpec struct { msg *types.Message mpoolNonce [1]uint64 diff --git a/chain/rand/rand_test.go b/chain/rand/rand_test.go index e2e7221658b..10cec68fe7d 100644 --- a/chain/rand/rand_test.go +++ b/chain/rand/rand_test.go @@ -1,4 +1,3 @@ -// stm:#unit package rand_test import ( @@ -53,13 +52,11 @@ func TestNullRandomnessV1(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 - //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V1_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01, @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_TIPSET_02 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } - //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(beforeNullHeight)+offset) select { @@ -68,7 +65,6 @@ func TestNullRandomnessV1(t *testing.T) { t.Fatal(resp.Err) } - //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01 rand2, err := rand.DrawRandomnessFromBase(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { t.Fatal(err) @@ -132,13 +128,11 @@ func TestNullRandomnessV2(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 - //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V2_01 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } - //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(ts.TipSet.TipSet().Height())+offset) select { @@ -147,7 +141,6 @@ func TestNullRandomnessV2(t *testing.T) { t.Fatal(resp.Err) } - //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01, @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_TIPSET_03 // note that the randEpoch passed to DrawRandomnessFromBase is still randEpoch (not the latest ts height) rand2, err := rand.DrawRandomnessFromBase(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { @@ -216,13 +209,11 @@ func TestNullRandomnessV3(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 - //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V3_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } - //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(randEpoch)+offset) select { @@ -231,7 +222,6 @@ func TestNullRandomnessV3(t *testing.T) { t.Fatal(resp.Err) } - //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01 rand2, err := rand.DrawRandomnessFromBase(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { t.Fatal(err) diff --git a/chain/state/statetree_test.go b/chain/state/statetree_test.go index 46dd15f6d15..c9f2748620c 100644 --- a/chain/state/statetree_test.go +++ b/chain/state/statetree_test.go @@ -1,4 +1,3 @@ -// stm: #unit package state import ( @@ -18,7 +17,6 @@ import ( ) func BenchmarkStateTreeSet(b *testing.B) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001 cst := cbor.NewMemCborStore() st, err := NewStateTree(cst, types.StateTreeVersion1) if err != nil { @@ -46,7 +44,6 @@ func BenchmarkStateTreeSet(b *testing.B) { } func BenchmarkStateTreeSetFlush(b *testing.B) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001 cst := cbor.NewMemCborStore() sv, err := VersionForNetwork(buildconstants.TestNetworkVersion) if err != nil { @@ -82,8 +79,6 @@ func BenchmarkStateTreeSetFlush(b *testing.B) { } func TestResolveCache(t *testing.T) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 - //stm: @CHAIN_STATETREE_SNAPSHOT_001, @CHAIN_STATETREE_SNAPSHOT_CLEAR_001 cst := cbor.NewMemCborStore() sv, err := VersionForNetwork(buildconstants.TestNetworkVersion) if err != nil { @@ -186,8 +181,6 @@ func TestResolveCache(t *testing.T) { } func BenchmarkStateTree10kGetActor(b *testing.B) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 - //stm: @CHAIN_STATETREE_FLUSH_001 cst := cbor.NewMemCborStore() sv, err := VersionForNetwork(buildconstants.TestNetworkVersion) if err != nil { @@ -235,7 +228,6 @@ func BenchmarkStateTree10kGetActor(b *testing.B) { } func TestSetCache(t *testing.T) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 cst := cbor.NewMemCborStore() sv, err := VersionForNetwork(buildconstants.TestNetworkVersion) if err != nil { @@ -277,8 +269,6 @@ func TestSetCache(t *testing.T) { } func TestSnapshots(t *testing.T) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001 - //stm: @CHAIN_STATETREE_FLUSH_001, @CHAIN_STATETREE_SNAPSHOT_REVERT_001, CHAIN_STATETREE_SNAPSHOT_CLEAR_001 ctx := context.Background() cst := cbor.NewMemCborStore() @@ -369,7 +359,6 @@ func assertNotHas(t *testing.T, st *StateTree, addr address.Address) { } func TestStateTreeConsistency(t *testing.T) { - //stm: @CHAIN_STATETREE_SET_ACTOR_001, @CHAIN_STATETREE_VERSION_FOR_NETWORK_001, @CHAIN_STATETREE_FLUSH_001 cst := cbor.NewMemCborStore() // TODO: ActorUpgrade: this test tests pre actors v2 diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index 1c9183731f3..4af90d40766 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -1,4 +1,3 @@ -// stm: #integration package stmgr_test import ( @@ -113,9 +112,6 @@ func (ta *testActor) TestMethod(rt rt2.Runtime, params *abi.EmptyValue) *abi.Emp } func TestForkHeightTriggers(t *testing.T) { - //stm: @CHAIN_STATETREE_GET_ACTOR_001, @CHAIN_STATETREE_FLUSH_001, @TOKEN_WALLET_SIGN_001 - //stm: @CHAIN_GEN_NEXT_TIPSET_001 - //stm: @CHAIN_STATE_RESOLVE_TO_KEY_ADDR_001, @CHAIN_STATE_SET_VM_CONSTRUCTOR_001 logging.SetAllLoggers(logging.LevelInfo) ctx := context.TODO() @@ -252,8 +248,6 @@ func TestForkHeightTriggers(t *testing.T) { } func TestForkRefuseCall(t *testing.T) { - //stm: @CHAIN_GEN_NEXT_TIPSET_001, @CHAIN_GEN_NEXT_TIPSET_FROM_MINERS_001 - //stm: @CHAIN_STATE_RESOLVE_TO_KEY_ADDR_001, @CHAIN_STATE_SET_VM_CONSTRUCTOR_001, @CHAIN_STATE_CALL_001 logging.SetAllLoggers(logging.LevelInfo) for after := 0; after < 3; after++ { @@ -388,8 +382,6 @@ func TestForkPreMigration(t *testing.T) { t.Fatalf("failed to restore LOTUS_DISABLE_PRE_MIGRATIONS: %v", err) } }() - //stm: @CHAIN_GEN_NEXT_TIPSET_001, - //stm: @CHAIN_STATE_RESOLVE_TO_KEY_ADDR_001, @CHAIN_STATE_SET_VM_CONSTRUCTOR_001 logging.SetAllLoggers(logging.LevelInfo) cg, err := gen.NewGenerator() diff --git a/chain/stmgr/searchwait_test.go b/chain/stmgr/searchwait_test.go index b23b22376c6..b8cd7ddcf77 100644 --- a/chain/stmgr/searchwait_test.go +++ b/chain/stmgr/searchwait_test.go @@ -1,4 +1,3 @@ -// stm: #unit package stmgr_test import ( @@ -13,8 +12,6 @@ import ( ) func TestSearchForMessageReplacements(t *testing.T) { - //stm: @CHAIN_GEN_NEXT_TIPSET_001 - //stm: @CHAIN_STATE_SEARCH_MSG_001 ctx := context.Background() cg, err := gen.NewGenerator() if err != nil { diff --git a/chain/store/basefee_test.go b/chain/store/basefee_test.go index 809bea15c22..6529802796e 100644 --- a/chain/store/basefee_test.go +++ b/chain/store/basefee_test.go @@ -1,5 +1,3 @@ -//stm: #unit - package store import ( @@ -13,7 +11,6 @@ import ( ) func TestBaseFee(t *testing.T) { - //stm: @CHAIN_STORE_COMPUTE_NEXT_BASE_FEE_001 tests := []struct { basefee uint64 limitUsed int64 diff --git a/chain/store/checkpoint_test.go b/chain/store/checkpoint_test.go index 4629affdaed..54ba4efdada 100644 --- a/chain/store/checkpoint_test.go +++ b/chain/store/checkpoint_test.go @@ -1,4 +1,3 @@ -// stm: #unit package store_test import ( @@ -12,9 +11,6 @@ import ( ) func TestChainCheckpoint(t *testing.T) { - //stm: @CHAIN_GEN_NEXT_TIPSET_FROM_MINERS_001 - //stm: @CHAIN_STORE_GET_TIPSET_FROM_KEY_001, @CHAIN_STORE_SET_HEAD_001, @CHAIN_STORE_GET_HEAVIEST_TIPSET_001 - //stm: @CHAIN_STORE_SET_CHECKPOINT_001, @CHAIN_STORE_MAYBE_TAKE_HEAVIER_TIPSET_001, @CHAIN_STORE_REMOVE_CHECKPOINT_001 ctx := context.Background() cg, err := gen.NewGenerator() diff --git a/chain/store/coalescer_test.go b/chain/store/coalescer_test.go index 278e6b18103..d462851086e 100644 --- a/chain/store/coalescer_test.go +++ b/chain/store/coalescer_test.go @@ -1,4 +1,3 @@ -// stm: #unit package store import ( @@ -10,7 +9,6 @@ import ( ) func TestHeadChangeCoalescer(t *testing.T) { - //stm: @CHAIN_STORE_COALESCE_HEAD_CHANGE_001 notif := make(chan headChange, 1) c := NewHeadChangeCoalescer(func(revert, apply []*types.TipSet) error { notif <- headChange{apply: apply, revert: revert} diff --git a/chain/store/index_test.go b/chain/store/index_test.go index 3cde400626a..90146d68b0e 100644 --- a/chain/store/index_test.go +++ b/chain/store/index_test.go @@ -1,4 +1,3 @@ -// stm: #unit package store_test import ( @@ -21,9 +20,6 @@ import ( ) func TestIndexSeeks(t *testing.T) { - //stm: @CHAIN_STORE_IMPORT_001 - //stm: @CHAIN_STORE_GET_TIPSET_BY_HEIGHT_001, @CHAIN_STORE_PUT_TIPSET_001, @CHAIN_STORE_SET_GENESIS_BLOCK_001 - //stm: @CHAIN_STORE_CLOSE_001 cg, err := gen.NewGenerator() if err != nil { t.Fatal(err) diff --git a/chain/store/store_test.go b/chain/store/store_test.go index 81569149c01..5329371ae33 100644 --- a/chain/store/store_test.go +++ b/chain/store/store_test.go @@ -1,4 +1,3 @@ -// stm: #unit package store_test import ( @@ -32,8 +31,6 @@ func init() { } func BenchmarkGetRandomness(b *testing.B) { - //stm: @CHAIN_GEN_NEXT_TIPSET_001 - //stm: @CHAIN_STATE_GET_RANDOMNESS_FROM_TICKETS_001 cg, err := gen.NewGenerator() if err != nil { b.Fatal(err) @@ -91,8 +88,6 @@ func BenchmarkGetRandomness(b *testing.B) { } func TestChainExportImport(t *testing.T) { - //stm: @CHAIN_GEN_NEXT_TIPSET_001 - //stm: @CHAIN_STORE_IMPORT_001 cg, err := gen.NewGenerator() if err != nil { t.Fatal(err) @@ -173,9 +168,6 @@ func TestChainImportTipsetKeyCid(t *testing.T) { } func TestChainExportImportFull(t *testing.T) { - //stm: @CHAIN_GEN_NEXT_TIPSET_001 - //stm: @CHAIN_STORE_IMPORT_001, @CHAIN_STORE_EXPORT_001, @CHAIN_STORE_SET_HEAD_001 - //stm: @CHAIN_STORE_GET_TIPSET_BY_HEIGHT_001 cg, err := gen.NewGenerator() if err != nil { t.Fatal(err) diff --git a/chain/sub/incoming_test.go b/chain/sub/incoming_test.go index d8ee99b7f12..dbb0c398b22 100644 --- a/chain/sub/incoming_test.go +++ b/chain/sub/incoming_test.go @@ -1,4 +1,3 @@ -// stm: #unit package sub import ( @@ -61,7 +60,6 @@ func TestFetchCidsWithDedup(t *testing.T) { } g := &getter{msgs} - //stm: @CHAIN_INCOMING_FETCH_MESSAGES_BY_CID_001 // the cids have a duplicate res, err := FetchMessagesByCids(context.TODO(), g, append(cids, cids[0])) diff --git a/chain/sync_manager_test.go b/chain/sync_manager_test.go index 737845ae2fa..02b35fe009f 100644 --- a/chain/sync_manager_test.go +++ b/chain/sync_manager_test.go @@ -1,4 +1,3 @@ -// stm: #unit package chain import ( @@ -80,7 +79,6 @@ func assertGetSyncOp(t *testing.T, c chan *syncOp, ts *types.TipSet) { } func TestSyncManagerEdgeCase(t *testing.T) { - //stm: @CHAIN_SYNCER_SET_PEER_HEAD_001 ctx := context.Background() a := mock.TipSet(mock.MkBlock(genTs, 1, 1)) @@ -164,7 +162,6 @@ func TestSyncManagerEdgeCase(t *testing.T) { } func TestSyncManager(t *testing.T) { - //stm: @CHAIN_SYNCER_SET_PEER_HEAD_001 ctx := context.Background() a := mock.TipSet(mock.MkBlock(genTs, 1, 1)) @@ -253,7 +250,6 @@ func TestSyncManagerBucketSet(t *testing.T) { bucketSet := syncBucketSet{buckets: []*syncTargetBucket{bucket1}} // inserting a tipset (potential sync target) from an existing chain, should add to an existing bucket - //stm: @CHAIN_SYNCER_ADD_SYNC_TARGET_001 ts3 := mock.TipSet(mock.MkBlock(ts2, 2, 0)) bucketSet.Insert(ts3) require.Equal(t, 1, len(bucketSet.buckets)) @@ -267,7 +263,6 @@ func TestSyncManagerBucketSet(t *testing.T) { require.Equal(t, 1, len(bucketSet.buckets[1].tips)) // Pop removes the best bucket (best sync target), e.g. bucket1 - //stm: @CHAIN_SYNCER_SELECT_SYNC_TARGET_001 popped := bucketSet.Pop() require.Equal(t, popped, bucket1) require.Equal(t, 1, len(bucketSet.buckets)) diff --git a/chain/sync_test.go b/chain/sync_test.go index 1b72bf5a9c9..4e792fc31d6 100644 --- a/chain/sync_test.go +++ b/chain/sync_test.go @@ -1,4 +1,3 @@ -// stm: #unit package chain_test import ( @@ -464,8 +463,6 @@ func (tu *syncTestUtil) waitUntilSyncTarget(to int, target *types.TipSet) { } func TestSyncSimple(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -482,8 +479,6 @@ func TestSyncSimple(t *testing.T) { } func TestSyncMining(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -506,8 +501,6 @@ func TestSyncMining(t *testing.T) { } func TestSyncBadTimestamp(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -562,8 +555,6 @@ func (wpp badWpp) ComputeProof(context.Context, []prooftypes.ExtendedSectorInfo, } func TestSyncBadWinningPoSt(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 15 tu := prepSyncTest(t, H) @@ -593,9 +584,6 @@ func (tu *syncTestUtil) loadChainToNode(to int) { } func TestSyncFork(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -663,9 +651,6 @@ func TestSyncFork(t *testing.T) { // A and B both include _different_ messages from sender X with nonce N (where N is the correct nonce for X). // We can confirm that the state can be correctly computed, and that `MessagesForTipset` behaves as expected. func TestDuplicateNonce(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -720,7 +705,6 @@ func TestDuplicateNonce(t *testing.T) { var includedMsg cid.Cid var skippedMsg cid.Cid - //stm: @CHAIN_STATE_SEARCH_MSG_001 r0, err0 := tu.nds[0].StateSearchMsg(context.TODO(), ts2.TipSet().Key(), msgs[0][0].Cid(), api.LookbackNoLimit, true) r1, err1 := tu.nds[0].StateSearchMsg(context.TODO(), ts2.TipSet().Key(), msgs[1][0].Cid(), api.LookbackNoLimit, true) @@ -762,9 +746,6 @@ func TestDuplicateNonce(t *testing.T) { // This test asserts that a block that includes a message with bad nonce can't be synced. A nonce is "bad" if it can't // be applied on the parent state. func TestBadNonce(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -812,9 +793,6 @@ func TestBadNonce(t *testing.T) { // One of the messages uses the sender's robust address, the other uses the ID address. // Such a block is invalid and should not sync. func TestMismatchedNoncesRobustID(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 v5h := abi.ChainEpoch(4) tu := prepSyncTestWithV5Height(t, int(v5h+5), v5h) @@ -827,7 +805,6 @@ func TestMismatchedNoncesRobustID(t *testing.T) { require.NoError(t, err) // Produce a message from the banker - //stm: @CHAIN_STATE_LOOKUP_ID_001 makeMsg := func(id bool) *types.SignedMessage { sender := tu.g.Banker() if id { @@ -870,9 +847,6 @@ func TestMismatchedNoncesRobustID(t *testing.T) { // One of the messages uses the sender's robust address, the other uses the ID address. // Such a block is valid and should sync. func TestMatchedNoncesRobustID(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 v5h := abi.ChainEpoch(4) tu := prepSyncTestWithV5Height(t, int(v5h+5), v5h) @@ -885,7 +859,6 @@ func TestMatchedNoncesRobustID(t *testing.T) { require.NoError(t, err) // Produce a message from the banker with specified nonce - //stm: @CHAIN_STATE_LOOKUP_ID_001 makeMsg := func(n uint64, id bool) *types.SignedMessage { sender := tu.g.Banker() if id { @@ -945,8 +918,6 @@ func runSyncBenchLength(b *testing.B, l int) { } func TestSyncInputs(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_VALIDATE_BLOCK_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -974,9 +945,6 @@ func TestSyncInputs(t *testing.T) { } func TestSyncCheckpointHead(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -996,7 +964,6 @@ func TestSyncCheckpointHead(t *testing.T) { a = tu.mineOnBlock(a, p1, []int{0}, true, false, nil, 0, true) tu.waitUntilSyncTarget(p1, a.TipSet()) - //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, a.TipSet().Key()) require.NoError(t, tu.g.ResyncBankerNonce(a1.TipSet())) @@ -1016,11 +983,9 @@ func TestSyncCheckpointHead(t *testing.T) { tu.waitUntilNodeHasTs(p1, b.TipSet().Key()) p1Head := tu.getHead(p1) require.True(tu.t, p1Head.Equals(a.TipSet())) - //stm: @CHAIN_SYNCER_CHECK_BAD_001 tu.assertBad(p1, b.TipSet()) // Should be able to switch forks. - //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, b.TipSet().Key()) p1Head = tu.getHead(p1) require.True(tu.t, p1Head.Equals(b.TipSet())) @@ -1121,9 +1086,6 @@ func TestSyncCheckpointSubmitOneOfTheBlocks(t *testing.T) { } func TestSyncCheckpointEarlierThanHead(t *testing.T) { - //stm: @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01, @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_SYNC_001, @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001 - //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001, @CHAIN_SYNCER_STOP_001 H := 10 tu := prepSyncTest(t, H) @@ -1143,7 +1105,6 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) { a = tu.mineOnBlock(a, p1, []int{0}, true, false, nil, 0, true) tu.waitUntilSyncTarget(p1, a.TipSet()) - //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, a1.TipSet().Key()) require.NoError(t, tu.g.ResyncBankerNonce(a1.TipSet())) @@ -1163,19 +1124,15 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) { tu.waitUntilNodeHasTs(p1, b.TipSet().Key()) p1Head := tu.getHead(p1) require.True(tu.t, p1Head.Equals(a.TipSet())) - //stm: @CHAIN_SYNCER_CHECK_BAD_001 tu.assertBad(p1, b.TipSet()) // Should be able to switch forks. - //stm: @CHAIN_SYNCER_CHECKPOINT_001 tu.checkpointTs(p1, b.TipSet().Key()) p1Head = tu.getHead(p1) require.True(tu.t, p1Head.Equals(b.TipSet())) } func TestInvalidHeight(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, @CHAIN_SYNCER_START_001 - //stm: @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 H := 50 tu := prepSyncTest(t, H) @@ -1203,7 +1160,6 @@ func TestIncomingBlocks(t *testing.T) { require.NoError(t, tu.mn.LinkAll()) clientNode := tu.nds[client] - //stm: @CHAIN_SYNCER_INCOMING_BLOCKS_001 incoming, err := clientNode.SyncIncomingBlocks(tu.ctx) require.NoError(tu.t, err) @@ -1247,7 +1203,6 @@ func TestSyncManualBadTS(t *testing.T) { require.True(tu.t, !sourceHead.Equals(clientHead), "source and client should be out of sync in test setup") - //stm: @CHAIN_SYNCER_MARK_BAD_001 err = tu.nds[client].SyncMarkBad(tu.ctx, sourceHead.Cids()[0]) require.NoError(tu.t, err) @@ -1255,7 +1210,6 @@ func TestSyncManualBadTS(t *testing.T) { err = tu.nds[client].SyncMarkBad(tu.ctx, sourceHeadParent) require.NoError(tu.t, err) - //stm: @CHAIN_SYNCER_CHECK_BAD_001 reason, err := tu.nds[client].SyncCheckBad(tu.ctx, sourceHead.Cids()[0]) require.NoError(tu.t, err) require.NotEqual(tu.t, "", reason, "block is not bad after manually marking") @@ -1277,7 +1231,6 @@ func TestSyncManualBadTS(t *testing.T) { // Assertion 2: // - after unmarking blocks as bad and reconnecting, source & client should be in sync - //stm: @CHAIN_SYNCER_UNMARK_BAD_001 err = tu.nds[client].SyncUnmarkBad(tu.ctx, sourceHead.Cids()[0]) require.NoError(tu.t, err) @@ -1322,7 +1275,6 @@ func TestSyncState(t *testing.T) { activeSyncs := []api.ActiveSync{} for len(activeSyncs) == 0 { - //stm: @CHAIN_SYNCER_STATE_001 state, err = clientNode.SyncState(tu.ctx) require.NoError(tu.t, err) activeSyncs = state.ActiveSyncs diff --git a/chain/types/bigint_test.go b/chain/types/bigint_test.go index 348724953a3..3c10d588a6d 100644 --- a/chain/types/bigint_test.go +++ b/chain/types/bigint_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -14,7 +13,6 @@ import ( ) func TestBigIntSerializationRoundTrip(t *testing.T) { - //stm: @CHAIN_TYPES_PARSE_BIGINT_001 testValues := []string{ "0", "1", "10", "-10", "9999", "12345678901234567891234567890123456789012345678901234567890", } @@ -43,7 +41,6 @@ func TestBigIntSerializationRoundTrip(t *testing.T) { } func TestFilRoundTrip(t *testing.T) { - //stm: @TYPES_FIL_PARSE_001 testValues := []string{ "0 FIL", "1 FIL", "1.001 FIL", "100.10001 FIL", "101100 FIL", "5000.01 FIL", "5000 FIL", } @@ -61,7 +58,6 @@ func TestFilRoundTrip(t *testing.T) { } func TestSizeStr(t *testing.T) { - //stm: @CHAIN_TYPES_SIZE_BIGINT_001 cases := []struct { in uint64 out string @@ -82,7 +78,6 @@ func TestSizeStr(t *testing.T) { } func TestSizeStrUnitsSymmetry(t *testing.T) { - //stm: @CHAIN_TYPES_SIZE_BIGINT_001 s := rand.NewSource(time.Now().UnixNano()) r := rand.New(s) @@ -99,7 +94,6 @@ func TestSizeStrUnitsSymmetry(t *testing.T) { } func TestSizeStrBig(t *testing.T) { - //stm: @CHAIN_TYPES_SIZE_BIGINT_001 ZiB := big.NewInt(50000) ZiB = ZiB.Lsh(ZiB, 70) diff --git a/chain/types/blockheader_test.go b/chain/types/blockheader_test.go index b7af86d3c3c..1f4c9e0674e 100644 --- a/chain/types/blockheader_test.go +++ b/chain/types/blockheader_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -51,7 +50,6 @@ func testBlockHeader(t testing.TB) *BlockHeader { } func TestBlockHeaderSerialization(t *testing.T) { - //stm: @CHAIN_TYPES_BLOCK_HEADER_FROM_CBOR_001, @CHAIN_TYPES_BLOCK_HEADER_TO_CBOR_001 bh := testBlockHeader(t) buf := new(bytes.Buffer) @@ -72,7 +70,6 @@ func TestBlockHeaderSerialization(t *testing.T) { } func TestInteropBH(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_BLOCK_INTEROP_001 newAddr, err := address.NewSecp256k1Address([]byte("address0")) if err != nil { diff --git a/chain/types/electionproof_test.go b/chain/types/electionproof_test.go index 3a06460fe1d..21385868ca2 100644 --- a/chain/types/electionproof_test.go +++ b/chain/types/electionproof_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -12,7 +11,6 @@ import ( ) func TestPoissonFunction(t *testing.T) { - //stm: @CHAIN_TYPES_POISSON_001 tests := []struct { lambdaBase uint64 lambdaShift uint @@ -49,7 +47,6 @@ func TestPoissonFunction(t *testing.T) { } func TestLambdaFunction(t *testing.T) { - //stm: @CHAIN_TYPES_LAMBDA_001 tests := []struct { power string totalPower string @@ -75,7 +72,6 @@ func TestLambdaFunction(t *testing.T) { } func TestExpFunction(t *testing.T) { - //stm: @CHAIN_TYPES_NEGATIVE_EXP_001 const N = 256 step := big.NewInt(5) @@ -104,7 +100,6 @@ func q256ToF(x *big.Int) float64 { } func TestElectionLam(t *testing.T) { - //stm: @CHAIN_TYPES_LAMBDA_001 p := big.NewInt(64) tot := big.NewInt(128) lam := lambda(p, tot) @@ -133,7 +128,6 @@ func BenchmarkWinCounts(b *testing.B) { } func TestWinCounts(t *testing.T) { - //stm: @TYPES_ELECTION_PROOF_COMPUTE_WIN_COUNT_001 totalPower := NewInt(100) power := NewInt(20) diff --git a/chain/types/fil_test.go b/chain/types/fil_test.go index 85054ed9831..7bf2a802ede 100644 --- a/chain/types/fil_test.go +++ b/chain/types/fil_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -8,7 +7,6 @@ import ( ) func TestFilShort(t *testing.T) { - //stm: @TYPES_FIL_PARSE_001 for _, s := range []struct { fil string expect string diff --git a/chain/types/message_test.go b/chain/types/message_test.go index abb9c946e3d..a5a00f66beb 100644 --- a/chain/types/message_test.go +++ b/chain/types/message_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -72,7 +71,6 @@ func TestEqualCall(t *testing.T) { Params: []byte("hai"), } - //stm: @TYPES_MESSAGE_EQUAL_CALL_001 require.True(t, m1.EqualCall(m2)) require.True(t, m1.EqualCall(m3)) require.False(t, m1.EqualCall(m4)) @@ -99,13 +97,11 @@ func TestMessageJson(t *testing.T) { exp := []byte("{\"Version\":0,\"To\":\"f04\",\"From\":\"f00\",\"Nonce\":34,\"Value\":\"0\",\"GasLimit\":123,\"GasFeeCap\":\"234\",\"GasPremium\":\"234\",\"Method\":6,\"Params\":\"aGFp\",\"CID\":{\"/\":\"bafy2bzaced5rdpz57e64sc7mdwjn3blicglhpialnrph2dlbufhf6iha63dmc\"}}") fmt.Println(string(b)) - //stm: @TYPES_MESSAGE_JSON_EQUAL_CALL_001 require.Equal(t, exp, b) var um Message require.NoError(t, json.Unmarshal(b, &um)) - //stm: @TYPES_MESSAGE_JSON_EQUAL_CALL_002 require.EqualValues(t, *m, um) } @@ -135,12 +131,10 @@ func TestSignedMessageJson(t *testing.T) { exp := []byte("{\"Message\":{\"Version\":0,\"To\":\"f04\",\"From\":\"f00\",\"Nonce\":34,\"Value\":\"0\",\"GasLimit\":123,\"GasFeeCap\":\"234\",\"GasPremium\":\"234\",\"Method\":6,\"Params\":\"aGFp\",\"CID\":{\"/\":\"bafy2bzaced5rdpz57e64sc7mdwjn3blicglhpialnrph2dlbufhf6iha63dmc\"}},\"Signature\":{\"Type\":0,\"Data\":null},\"CID\":{\"/\":\"bafy2bzacea5ainifngxj3rygaw2hppnyz2cw72x5pysqty2x6dxmjs5qg2uus\"}}") fmt.Println(string(b)) - //stm: @TYPES_MESSAGE_JSON_EQUAL_CALL_001 require.Equal(t, exp, b) var um SignedMessage require.NoError(t, json.Unmarshal(b, &um)) - //stm: @TYPES_MESSAGE_JSON_EQUAL_CALL_002 require.EqualValues(t, *sm, um) } diff --git a/chain/types/signature_test.go b/chain/types/signature_test.go index abc7a369bff..9ade3c04645 100644 --- a/chain/types/signature_test.go +++ b/chain/types/signature_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -9,7 +8,6 @@ import ( ) func TestSignatureSerializeRoundTrip(t *testing.T) { - //stm: @CHAIN_TYPES_SIGNATURE_SERIALIZATION_001 s := &crypto.Signature{ Data: []byte("foo bar cat dog"), Type: crypto.SigTypeBLS, diff --git a/chain/types/tipset_key_test.go b/chain/types/tipset_key_test.go index d7a933b54a2..a727dba9671 100644 --- a/chain/types/tipset_key_test.go +++ b/chain/types/tipset_key_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( @@ -16,7 +15,6 @@ import ( ) func TestTipSetKey(t *testing.T) { - //stm: @TYPES_TIPSETKEY_FROM_BYTES_001, @TYPES_TIPSETKEY_NEW_001 cb := cid.V1Builder{Codec: cid.DagCBOR, MhType: multihash.BLAKE2B_MIN + 31} // distinct, but arbitrary CIDs, pretending dag-cbor encoding but they are just a multihash over bytes c1, _ := cb.Sum([]byte("a")) diff --git a/chain/types/types_test.go b/chain/types/types_test.go index 4e08a0d881b..1056fc430e1 100644 --- a/chain/types/types_test.go +++ b/chain/types/types_test.go @@ -1,4 +1,3 @@ -// stm: #unit package types import ( diff --git a/chain/types_test.go b/chain/types_test.go index 692c932a575..d7cf56a585b 100644 --- a/chain/types_test.go +++ b/chain/types_test.go @@ -1,4 +1,3 @@ -// stm: #unit package chain import ( @@ -13,7 +12,6 @@ import ( ) func TestSignedMessageJsonRoundtrip(t *testing.T) { - //stm: @TYPES_MESSAGE_JSON_EQUAL_CALL_002 to, _ := address.NewIDAddress(5234623) from, _ := address.NewIDAddress(603911192) smsg := &types.SignedMessage{ @@ -42,7 +40,6 @@ func TestSignedMessageJsonRoundtrip(t *testing.T) { } func TestAddressType(t *testing.T) { - //stm: @CHAIN_TYPES_ADDRESS_PREFIX_001 buildconstants.SetAddressNetwork(address.Testnet) addr, err := makeRandomAddress() if err != nil { diff --git a/chain/vectors/vectors_test.go b/chain/vectors/vectors_test.go index 8e73ec01278..974a2c8def9 100644 --- a/chain/vectors/vectors_test.go +++ b/chain/vectors/vectors_test.go @@ -1,4 +1,3 @@ -// stm: #unit package vectors import ( @@ -27,7 +26,6 @@ func LoadVector(t *testing.T, f string, out interface{}) { } func TestBlockHeaderVectors(t *testing.T) { - //stm: @CHAIN_TYPES_SERIALIZATION_BLOCK_001 var headers []HeaderVector LoadVector(t, "block_headers.json", &headers) @@ -48,7 +46,6 @@ func TestBlockHeaderVectors(t *testing.T) { } func TestMessageSigningVectors(t *testing.T) { - //stm: @CHAIN_TYPES_SERIALIZATION_SIGNED_MESSAGE_001 var msvs []MessageSigningVector LoadVector(t, "message_signing.json", &msvs) @@ -67,7 +64,6 @@ func TestMessageSigningVectors(t *testing.T) { } func TestUnsignedMessageVectors(t *testing.T) { - //stm: @CHAIN_TYPES_SERIALIZATION_MESSAGE_001 var msvs []UnsignedMessageVector LoadVector(t, "unsigned_messages.json", &msvs) diff --git a/chain/vm/burn_test.go b/chain/vm/burn_test.go index 46bc7f5de43..543e893eb20 100644 --- a/chain/vm/burn_test.go +++ b/chain/vm/burn_test.go @@ -1,4 +1,3 @@ -// stm: #unit package vm import ( @@ -11,7 +10,6 @@ import ( ) func TestGasBurn(t *testing.T) { - //stm: @BURN_ESTIMATE_GAS_OVERESTIMATION_BURN_001 tests := []struct { used int64 limit int64 @@ -43,7 +41,6 @@ func TestGasBurn(t *testing.T) { } func TestGasOutputs(t *testing.T) { - //stm: @BURN_ESTIMATE_GAS_OUTPUTS_001 baseFee := types.NewInt(10) tests := []struct { used int64 diff --git a/chain/vm/gas_v0_test.go b/chain/vm/gas_v0_test.go index bd527a7799c..447e4f70c5c 100644 --- a/chain/vm/gas_v0_test.go +++ b/chain/vm/gas_v0_test.go @@ -1,4 +1,3 @@ -// stm: #unit package vm import ( diff --git a/chain/vm/invoker_test.go b/chain/vm/invoker_test.go index d3e6dcd7fd4..bb3e4d88e55 100644 --- a/chain/vm/invoker_test.go +++ b/chain/vm/invoker_test.go @@ -1,4 +1,3 @@ -// stm: #unit package vm import ( @@ -119,7 +118,6 @@ func (*basicRtMessage) ValueReceived() abi.TokenAmount { } func TestInvokerBasic(t *testing.T) { - //stm: @INVOKER_TRANSFORM_001 inv := ActorRegistry{} registry := builtin.MakeRegistryLegacy([]rt.VMActor{basicContract{}}) code, err := inv.transform(registry[0]) diff --git a/chain/vm/runtime_test.go b/chain/vm/runtime_test.go index 88b7366dea0..3f4efc8b04c 100644 --- a/chain/vm/runtime_test.go +++ b/chain/vm/runtime_test.go @@ -1,4 +1,3 @@ -// stm: #unit package vm import ( @@ -23,7 +22,6 @@ func (*NotAVeryGoodMarshaler) MarshalCBOR(writer io.Writer) error { var _ cbg.CBORMarshaler = &NotAVeryGoodMarshaler{} func TestRuntimePutErrors(t *testing.T) { - //stm: @CHAIN_VM_STORE_PUT_002 defer func() { err := recover() if err == nil { diff --git a/chain/wallet/multi_test.go b/chain/wallet/multi_test.go index 5256ebde939..2d36f43a01d 100644 --- a/chain/wallet/multi_test.go +++ b/chain/wallet/multi_test.go @@ -1,4 +1,3 @@ -// stm: #unit package wallet import ( @@ -22,13 +21,11 @@ func TestMultiWallet(t *testing.T) { Local: local, } - //stm: @TOKEN_WALLET_MULTI_NEW_ADDRESS_001 a1, err := wallet.WalletNew(ctx, types.KTSecp256k1) if err != nil { t.Fatal(err) } - //stm: @TOKEN_WALLET_MULTI_HAS_001 exists, err := wallet.WalletHas(ctx, a1) if err != nil { t.Fatal(err) @@ -38,7 +35,6 @@ func TestMultiWallet(t *testing.T) { t.Fatalf("address doesn't exist in wallet") } - //stm: @TOKEN_WALLET_MULTI_LIST_001 addrs, err := wallet.WalletList(ctx) if err != nil { t.Fatal(err) @@ -49,13 +45,11 @@ func TestMultiWallet(t *testing.T) { t.Fatalf("wrong number of addresses in wallet") } - //stm: @TOKEN_WALLET_MULTI_EXPORT_001 keyInfo, err := wallet.WalletExport(ctx, a1) if err != nil { t.Fatal(err) } - //stm: @TOKEN_WALLET_MULTI_IMPORT_001 addr, err := wallet.WalletImport(ctx, keyInfo) if err != nil { t.Fatal(err) @@ -65,7 +59,6 @@ func TestMultiWallet(t *testing.T) { t.Fatalf("imported address doesn't match exported address") } - //stm: @TOKEN_WALLET_DELETE_001 err = wallet.WalletDelete(ctx, a1) if err != nil { t.Fatal(err) diff --git a/chain/wallet/wallet_test.go b/chain/wallet/wallet_test.go index 8937c5eb8b2..802b4427947 100644 --- a/chain/wallet/wallet_test.go +++ b/chain/wallet/wallet_test.go @@ -1,4 +1,3 @@ -// stm: #unit package wallet import ( @@ -19,13 +18,11 @@ func TestWallet(t *testing.T) { t.Fatal(err) } - //stm: @TOKEN_WALLET_NEW_001 a1, err := w1.WalletNew(ctx, types.KTSecp256k1) if err != nil { t.Fatal(err) } - //stm: @TOKEN_WALLET_HAS_001 exists, err := w1.WalletHas(ctx, a1) if err != nil { t.Fatal(err) @@ -50,7 +47,6 @@ func TestWallet(t *testing.T) { t.Fatal(err) } - //stm: @TOKEN_WALLET_LIST_001 addrs, err := w2.WalletList(ctx) if err != nil { t.Fatal(err) @@ -60,13 +56,11 @@ func TestWallet(t *testing.T) { t.Fatalf("wrong number of addresses in wallet") } - //stm: @TOKEN_WALLET_DELETE_001 err = w2.WalletDelete(ctx, a2) if err != nil { t.Fatal(err) } - //stm: @TOKEN_WALLET_HAS_001 exists, err = w2.WalletHas(ctx, a2) if err != nil { t.Fatal(err) @@ -75,25 +69,21 @@ func TestWallet(t *testing.T) { t.Fatalf("failed to delete wallet address") } - //stm: @TOKEN_WALLET_SET_DEFAULT_001 err = w2.SetDefault(a3) if err != nil { t.Fatal(err) } - //stm: @TOKEN_WALLET_DEFAULT_ADDRESS_001 def, err := w2.GetDefault() if !assert.Equal(t, a3, def) { t.Fatal(err) } - //stm: @TOKEN_WALLET_EXPORT_001 keyInfo, err := w2.WalletExport(ctx, a3) if err != nil { t.Fatal(err) } - //stm: @TOKEN_WALLET_IMPORT_001 addr, err := w2.WalletImport(ctx, keyInfo) if err != nil { t.Fatal(err) diff --git a/cli/chain_test.go b/cli/chain_test.go index 9fd46724e6b..76bfcdaefd8 100644 --- a/cli/chain_test.go +++ b/cli/chain_test.go @@ -1,4 +1,3 @@ -// stm: #unit package cli import ( @@ -35,7 +34,6 @@ func TestChainHead(t *testing.T) { mockApi.EXPECT().ChainHead(ctx).Return(ts, nil), ) - //stm: @CLI_CHAIN_HEAD_001 err := app.Run([]string{"chain", "head"}) assert.NoError(t, err) @@ -59,7 +57,6 @@ func TestGetBlock(t *testing.T) { mockApi.EXPECT().ChainGetParentReceipts(ctx, block.Cid()).Return([]*types.MessageReceipt{}, nil), ) - //stm: @CLI_CHAIN_GET_BLOCK_001 err := app.Run([]string{"chain", "getblock", block.Cid().String()}) assert.NoError(t, err) @@ -94,7 +91,6 @@ func TestReadOjb(t *testing.T) { mockApi.EXPECT().ChainReadObj(ctx, block.Cid()).Return(obj.Bytes(), nil), ) - //stm: @CLI_CHAIN_READ_OBJECT_001 err = app.Run([]string{"chain", "read-obj", block.Cid().String()}) assert.NoError(t, err) @@ -110,7 +106,6 @@ func TestChainDeleteObj(t *testing.T) { app, _, _, done := NewMockAppWithFullAPI(t, cmd) defer done() - //stm: @CLI_CHAIN_DELETE_OBJECT_002 err := app.Run([]string{"chain", "delete-obj", block.Cid().String()}) assert.Error(t, err) }) @@ -127,7 +122,6 @@ func TestChainDeleteObj(t *testing.T) { mockApi.EXPECT().ChainDeleteObj(ctx, block.Cid()).Return(nil), ) - //stm: @CLI_CHAIN_DELETE_OBJECT_001 err := app.Run([]string{"chain", "delete-obj", "--really-do-it=true", block.Cid().String()}) assert.NoError(t, err) @@ -160,7 +154,6 @@ func TestChainStatObj(t *testing.T) { mockApi.EXPECT().ChainStatObj(ctx, block.Cid(), cid.Undef).Return(stat, nil), ) - //stm: @CLI_CHAIN_STAT_OBJECT_001 err := app.Run([]string{"chain", "stat-obj", block.Cid().String()}) assert.NoError(t, err) @@ -179,7 +172,6 @@ func TestChainStatObj(t *testing.T) { mockApi.EXPECT().ChainStatObj(ctx, block.Cid(), block.Cid()).Return(stat, nil), ) - //stm: @CLI_CHAIN_STAT_OBJECT_002 err := app.Run([]string{"chain", "stat-obj", fmt.Sprintf("-base=%s", block.Cid().String()), block.Cid().String()}) assert.NoError(t, err) @@ -210,7 +202,6 @@ func TestChainGetMsg(t *testing.T) { mockApi.EXPECT().ChainReadObj(ctx, msg.Cid()).Return(obj.Bytes(), nil), ) - //stm: @CLI_CHAIN_GET_MESSAGE_001 err = app.Run([]string{"chain", "getmessage", msg.Cid().String()}) assert.NoError(t, err) @@ -240,7 +231,6 @@ func TestSetHead(t *testing.T) { mockApi.EXPECT().ChainSetHead(ctx, genesis.Key()).Return(nil), ) - //stm: @CLI_CHAIN_SET_HEAD_003 err := app.Run([]string{"chain", "sethead", "-genesis=true", ts.Key().String()}) assert.NoError(t, err) }) @@ -258,7 +248,6 @@ func TestSetHead(t *testing.T) { mockApi.EXPECT().ChainSetHead(ctx, genesis.Key()).Return(nil), ) - //stm: @CLI_CHAIN_SET_HEAD_002 err := app.Run([]string{"chain", "sethead", fmt.Sprintf("-epoch=%s", epoch), ts.Key().String()}) assert.NoError(t, err) }) @@ -276,7 +265,6 @@ func TestSetHead(t *testing.T) { mockApi.EXPECT().ChainSetHead(ctx, ts.Key()).Return(nil), ) - //stm: @CLI_CHAIN_SET_HEAD_001 err := app.Run([]string{"chain", "sethead", ts.Key().Cids()[0].String()}) assert.NoError(t, err) }) @@ -315,7 +303,6 @@ func TestInspectUsage(t *testing.T) { mockApi.EXPECT().StateGetActor(ctx, *to, ts.Key()).Return(actor, nil), ) - //stm: @CLI_CHAIN_INSPECT_USAGE_001 err := app.Run([]string{"chain", "inspect-usage"}) assert.NoError(t, err) @@ -366,7 +353,6 @@ func TestChainList(t *testing.T) { mockApi.EXPECT().ChainGetBlockMessages(ctx, head.Blocks()[0].Cid()).Return(blockMsgs, nil), ) - //stm: CLI_CHAIN_LIST_001 err := app.Run([]string{"chain", "love", "--gas-stats=true"}) // chain is love ❤️ assert.NoError(t, err) @@ -397,7 +383,6 @@ func TestChainGet(t *testing.T) { mockApi.EXPECT().ChainGetNode(ctx, path).Return(&api.IpldObject{Cid: blk.Cid(), Obj: blk}, nil), ) - //stm: @CLI_CHAIN_GET_001 err := app.Run([]string{"chain", "get", path}) assert.NoError(t, err) @@ -423,7 +408,6 @@ func TestChainGet(t *testing.T) { mockApi.EXPECT().ChainGetNode(ctx, p2).Return(&api.IpldObject{Cid: blk.Cid(), Obj: blk}, nil), ) - //stm: @CLI_CHAIN_GET_002 err := app.Run([]string{"chain", "get", p1}) assert.NoError(t, err) @@ -447,7 +431,6 @@ func TestChainGet(t *testing.T) { mockApi.EXPECT().ChainGetNode(ctx, path).Return(&api.IpldObject{Cid: blk.Cid(), Obj: blk}, nil), ) - //stm: @CLI_CHAIN_GET_004 err := app.Run([]string{"chain", "get", "-as-type=foo", path}) assert.Error(t, err) }) @@ -483,7 +466,6 @@ func TestChainBisect(t *testing.T) { mockApi.EXPECT().ChainGetNode(ctx, path).Return(&api.IpldObject{Cid: blk2.Cid(), Obj: blk2}, nil), ) - //stm: @CLI_CHAIN_BISECT_001 err := app.Run([]string{"chain", "bisect", fmt.Sprintf("%d", minHeight), fmt.Sprintf("%d", maxHeight), subpath, shell}) assert.NoError(t, err) @@ -516,7 +498,6 @@ func TestChainExport(t *testing.T) { mockApi.EXPECT().ChainExport(ctx, abi.ChainEpoch(0), false, ts.Key()).Return(export, nil), ) - //stm: @CLI_CHAIN_EXPORT_001 err := app.Run([]string{"chain", "export", "whatever.car"}) assert.NoError(t, err) @@ -542,7 +523,6 @@ func TestChainGasPrice(t *testing.T) { calls++ }) - //stm: @CLI_CHAIN_GAS_PRICE_001 err := app.Run([]string{"chain", "gas-price"}) assert.NoError(t, err) diff --git a/cli/mpool_test.go b/cli/mpool_test.go index 0aa055ba31f..06fa3d853af 100644 --- a/cli/mpool_test.go +++ b/cli/mpool_test.go @@ -1,4 +1,3 @@ -// stm: #unit package cli import ( @@ -57,7 +56,6 @@ func TestStat(t *testing.T) { mockApi.EXPECT().StateGetActor(ctx, senderAddr, head.Key()).Return(&actor, nil), ) - //stm: @CLI_MEMPOOL_STAT_002 err = app.Run([]string{"mpool", "stat", "--basefee-lookback", "1", "--local"}) assert.NoError(t, err) @@ -97,7 +95,6 @@ func TestStat(t *testing.T) { mockApi.EXPECT().StateGetActor(ctx, senderAddr, head.Key()).Return(&actor, nil), ) - //stm: @CLI_MEMPOOL_STAT_001 err = app.Run([]string{"mpool", "stat", "--basefee-lookback", "1"}) assert.NoError(t, err) @@ -130,7 +127,6 @@ func TestPending(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_PENDING_001 err = app.Run([]string{"mpool", "pending", "--cids"}) assert.NoError(t, err) @@ -162,7 +158,6 @@ func TestPending(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_PENDING_002 err = app.Run([]string{"mpool", "pending", "--local"}) assert.NoError(t, err) @@ -193,7 +188,6 @@ func TestPending(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_PENDING_003 err = app.Run([]string{"mpool", "pending", "--to", sm.Message.To.String()}) assert.NoError(t, err) @@ -224,7 +218,6 @@ func TestPending(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_PENDING_004 err = app.Run([]string{"mpool", "pending", "--from", sm.Message.From.String()}) assert.NoError(t, err) @@ -261,7 +254,6 @@ func TestReplace(t *testing.T) { mockApi.EXPECT().MpoolPush(ctx, sm).Return(sm.Cid(), nil), ) - //stm: @CLI_MEMPOOL_REPLACE_002 err = app.Run([]string{"mpool", "replace", "--gas-premium", "1", "--gas-feecap", "100", sm.Cid().String()}) assert.NoError(t, err) @@ -307,7 +299,6 @@ func TestReplace(t *testing.T) { mockApi.EXPECT().MpoolPush(ctx, sm).Return(sm.Cid(), nil), ) - //stm: @CLI_MEMPOOL_REPLACE_002 err = app.Run([]string{"mpool", "replace", "--auto", "--fee-limit", maxFee, sm.Cid().String()}) assert.NoError(t, err) @@ -352,7 +343,6 @@ func TestReplace(t *testing.T) { mockApi.EXPECT().MpoolPush(ctx, sm).Return(sm.Cid(), nil), ) - //stm: @CLI_MEMPOOL_REPLACE_001 err = app.Run([]string{"mpool", "replace", "--auto", "--fee-limit", maxFee, sm.Message.From.String(), fmt.Sprint(sm.Message.Nonce)}) assert.NoError(t, err) @@ -384,7 +374,6 @@ func TestFindMsg(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_FIND_001 err = app.Run([]string{"mpool", "find", "--from", sm.Message.From.String()}) assert.NoError(t, err) @@ -414,7 +403,6 @@ func TestFindMsg(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_FIND_002 err = app.Run([]string{"mpool", "find", "--to", sm.Message.To.String()}) assert.NoError(t, err) @@ -444,7 +432,6 @@ func TestFindMsg(t *testing.T) { mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), ) - //stm: @CLI_MEMPOOL_FIND_003 err = app.Run([]string{"mpool", "find", "--method", sm.Message.Method.String()}) assert.NoError(t, err) @@ -481,7 +468,6 @@ func TestGasPerf(t *testing.T) { mockApi.EXPECT().ChainHead(ctx).Return(head, nil), ) - //stm: @CLI_MEMPOOL_GAS_PERF_002 err = app.Run([]string{"mpool", "gas-perf", "--all", "true"}) assert.NoError(t, err) @@ -518,7 +504,6 @@ func TestGasPerf(t *testing.T) { mockApi.EXPECT().ChainHead(ctx).Return(head, nil), ) - //stm: @CLI_MEMPOOL_GAS_PERF_001 err = app.Run([]string{"mpool", "gas-perf"}) assert.NoError(t, err) @@ -546,7 +531,6 @@ func TestConfig(t *testing.T) { mockApi.EXPECT().MpoolGetConfig(ctx).Return(mpoolCfg, nil), ) - //stm: @CLI_MEMPOOL_CONFIG_001 err = app.Run([]string{"mpool", "config"}) assert.NoError(t, err) @@ -579,7 +563,6 @@ func TestConfig(t *testing.T) { t.Fatal(err) } - //stm: @CLI_MEMPOOL_CONFIG_002 err = app.Run([]string{"mpool", "config", string(bytes)}) assert.NoError(t, err) }) diff --git a/cli/send_test.go b/cli/send_test.go index 21a0f950223..91af57b9326 100644 --- a/cli/send_test.go +++ b/cli/send_test.go @@ -1,5 +1,3 @@ -// stm: ignore -// stm: #unit package cli import ( diff --git a/cli/services_send_test.go b/cli/services_send_test.go index a524abe8cc1..73dbcf5396e 100644 --- a/cli/services_send_test.go +++ b/cli/services_send_test.go @@ -1,5 +1,3 @@ -// stm: ignore -// stm: #unit package cli import ( diff --git a/cli/sync_test.go b/cli/sync_test.go index 456d165f293..1d30edcc8ae 100644 --- a/cli/sync_test.go +++ b/cli/sync_test.go @@ -1,4 +1,3 @@ -// stm: #unit package cli import ( @@ -46,7 +45,6 @@ func TestSyncStatus(t *testing.T) { mockApi.EXPECT().SyncState(ctx).Return(state, nil) - //stm: @CLI_SYNC_STATUS_001 err := app.Run([]string{"sync", "status"}) assert.NoError(t, err) @@ -72,7 +70,6 @@ func TestSyncMarkBad(t *testing.T) { mockApi.EXPECT().SyncMarkBad(ctx, blk.Cid()).Return(nil) - //stm: @CLI_SYNC_MARK_BAD_001 err := app.Run([]string{"sync", "mark-bad", blk.Cid().String()}) assert.NoError(t, err) } @@ -89,7 +86,6 @@ func TestSyncUnmarkBad(t *testing.T) { mockApi.EXPECT().SyncUnmarkBad(ctx, blk.Cid()).Return(nil) - //stm: @CLI_SYNC_UNMARK_BAD_001 err := app.Run([]string{"sync", "unmark-bad", blk.Cid().String()}) assert.NoError(t, err) }) @@ -103,7 +99,6 @@ func TestSyncUnmarkBad(t *testing.T) { mockApi.EXPECT().SyncUnmarkAllBad(ctx).Return(nil) - //stm: @CLI_SYNC_UNMARK_BAD_002 err := app.Run([]string{"sync", "unmark-bad", "-all"}) assert.NoError(t, err) }) @@ -121,7 +116,6 @@ func TestSyncCheckBad(t *testing.T) { mockApi.EXPECT().SyncCheckBad(ctx, blk.Cid()).Return("", nil) - //stm: @CLI_SYNC_CHECK_BAD_002 err := app.Run([]string{"sync", "check-bad", blk.Cid().String()}) assert.NoError(t, err) @@ -140,7 +134,6 @@ func TestSyncCheckBad(t *testing.T) { mockApi.EXPECT().SyncCheckBad(ctx, blk.Cid()).Return(reason, nil) - //stm: @CLI_SYNC_CHECK_BAD_001 err := app.Run([]string{"sync", "check-bad", blk.Cid().String()}) assert.NoError(t, err) @@ -164,7 +157,6 @@ func TestSyncCheckpoint(t *testing.T) { mockApi.EXPECT().SyncCheckpoint(ctx, ts.Key()).Return(nil), ) - //stm: @CLI_SYNC_CHECKPOINT_001 err := app.Run([]string{"sync", "checkpoint", blk.Cid().String()}) assert.NoError(t, err) }) @@ -185,7 +177,6 @@ func TestSyncCheckpoint(t *testing.T) { mockApi.EXPECT().SyncCheckpoint(ctx, ts.Key()).Return(nil), ) - //stm: @CLI_SYNC_CHECKPOINT_002 err := app.Run([]string{"sync", "checkpoint", fmt.Sprintf("-epoch=%d", epoch)}) assert.NoError(t, err) }) diff --git a/cli/wallet_test.go b/cli/wallet_test.go index eb2c544f0a6..0f4b229e09f 100644 --- a/cli/wallet_test.go +++ b/cli/wallet_test.go @@ -1,4 +1,3 @@ -// stm: #unit package cli import ( @@ -37,7 +36,6 @@ func TestWalletNew(t *testing.T) { mockApi.EXPECT().WalletNew(ctx, keyType).Return(address, nil) - //stm: @CLI_WALLET_NEW_001 err = app.Run([]string{"wallet", "new"}) assert.NoError(t, err) assert.Contains(t, buffer.String(), address.String()) @@ -72,7 +70,6 @@ func TestWalletList(t *testing.T) { mockApi.EXPECT().WalletDefaultAddress(ctx).Return(addr, nil), ) - //stm: @CLI_WALLET_LIST_001 err := app.Run([]string{"wallet", "list", "--addr-only"}) assert.NoError(t, err) assert.Contains(t, buf.String(), addr.String()) @@ -92,7 +89,6 @@ func TestWalletList(t *testing.T) { mockApi.EXPECT().StateLookupID(ctx, addr, key).Return(addr, nil), ) - //stm: @CLI_WALLET_LIST_002 err := app.Run([]string{"wallet", "list", "--id"}) assert.NoError(t, err) }) @@ -116,7 +112,6 @@ func TestWalletList(t *testing.T) { mockApi.EXPECT().StateMarketBalance(ctx, addr, key).Return(balance, nil), ) - //stm: @CLI_WALLET_LIST_003 err := app.Run([]string{"wallet", "list", "--market"}) assert.NoError(t, err) }) @@ -141,7 +136,6 @@ func TestWalletBalance(t *testing.T) { mockApi.EXPECT().ChainHead(ctx).Return(head, nil) mockApi.EXPECT().WalletBalance(ctx, addr).Return(balance, nil) - //stm: @CLI_WALLET_BALANCE_001 err = app.Run([]string{"wallet", "balance", "f01234"}) assert.NoError(t, err) assert.Contains(t, buffer.String(), balance.String()) @@ -159,7 +153,6 @@ func TestWalletGetDefault(t *testing.T) { mockApi.EXPECT().WalletDefaultAddress(ctx).Return(addr, nil) - //stm: @CLI_WALLET_GET_DEFAULT_001 err = app.Run([]string{"wallet", "default"}) assert.NoError(t, err) assert.Contains(t, buffer.String(), addr.String()) @@ -177,7 +170,6 @@ func TestWalletSetDefault(t *testing.T) { mockApi.EXPECT().WalletSetDefault(ctx, addr).Return(nil) - //stm: @CLI_WALLET_SET_DEFAULT_001 err = app.Run([]string{"wallet", "set-default", "f01234"}) assert.NoError(t, err) } @@ -202,7 +194,6 @@ func TestWalletExport(t *testing.T) { ki, err := json.Marshal(keyInfo) assert.NoError(t, err) - //stm: @CLI_WALLET_EXPORT_001 err = app.Run([]string{"wallet", "export", "f01234"}) assert.NoError(t, err) assert.Contains(t, buffer.String(), hex.EncodeToString(ki)) @@ -230,7 +221,6 @@ func TestWalletSign(t *testing.T) { sigBytes := append([]byte{byte(signature.Type)}, signature.Data...) - //stm: @CLI_WALLET_SIGN_001 err = app.Run([]string{"wallet", "sign", "f01234", "01"}) assert.NoError(t, err) assert.Contains(t, buffer.String(), hex.EncodeToString(sigBytes)) @@ -254,7 +244,6 @@ func TestWalletVerify(t *testing.T) { mockApi.EXPECT().WalletVerify(ctx, addr, msg, &signature).Return(true, nil) - //stm: @CLI_WALLET_VERIFY_001 err = app.Run([]string{"wallet", "verify", "f01234", "01", "01"}) assert.NoError(t, err) assert.Contains(t, buffer.String(), "valid") @@ -272,7 +261,6 @@ func TestWalletDelete(t *testing.T) { mockApi.EXPECT().WalletDelete(ctx, addr).Return(nil) - //stm: @CLI_WALLET_DELETE_001 err = app.Run([]string{"wallet", "delete", "f01234"}) assert.NoError(t, err) } @@ -309,7 +297,6 @@ func TestWalletMarketWithdraw(t *testing.T) { mockApi.EXPECT().StateNetworkVersion(ctx, types.TipSetKey{}).Return(networkVers, nil), ) - //stm: @CLI_WALLET_MARKET_WITHDRAW_001 err = app.Run([]string{"wallet", "market", "withdraw", "--wallet", addr.String()}) assert.NoError(t, err) assert.Contains(t, buffer.String(), fmt.Sprintf("WithdrawBalance message cid: %s", cid)) @@ -334,7 +321,6 @@ func TestWalletMarketAdd(t *testing.T) { mockApi.EXPECT().MarketAddBalance(ctx, defaultAddr, toAddr, big.NewInt(80)).Return(cid, nil), ) - //stm: @CLI_WALLET_MARKET_ADD_001 err = app.Run([]string{"wallet", "market", "add", "0.000000000000000080", "--address", toAddr.String()}) assert.NoError(t, err) assert.Contains(t, buffer.String(), fmt.Sprintf("AddBalance message cid: %s", cid)) diff --git a/cmd/lotus-bench/stats_test.go b/cmd/lotus-bench/stats_test.go index 0ccadb4d43d..16caf3f7e8f 100644 --- a/cmd/lotus-bench/stats_test.go +++ b/cmd/lotus-bench/stats_test.go @@ -1,4 +1,3 @@ -// stm: #unit package main import ( diff --git a/cmd/lotus-fountain/rate_limiter_test.go b/cmd/lotus-fountain/rate_limiter_test.go index b7af23ebddc..03590de500c 100644 --- a/cmd/lotus-fountain/rate_limiter_test.go +++ b/cmd/lotus-fountain/rate_limiter_test.go @@ -1,4 +1,3 @@ -// stm: #unit package main import ( @@ -9,7 +8,6 @@ import ( ) func TestRateLimit(t *testing.T) { - //stm: @CMD_LIMITER_GET_IP_LIMITER_001, @CMD_LIMITER_GET_WALLET_LIMITER_001 limiter := NewLimiter(LimiterConfig{ TotalRate: time.Second, TotalBurst: 20, diff --git a/cmd/lotus-health/main_test.go b/cmd/lotus-health/main_test.go index f0107380fe0..4b65d2fe73d 100644 --- a/cmd/lotus-health/main_test.go +++ b/cmd/lotus-health/main_test.go @@ -1,4 +1,3 @@ -// stm: #unit package main import ( @@ -10,7 +9,6 @@ import ( ) func TestAppendCIDsToWindow(t *testing.T) { - //stm: @CMD_HEALTH_APPEND_CIDS_001 assert := assert.New(t) var window CidWindow threshold := 3 @@ -29,7 +27,6 @@ func TestAppendCIDsToWindow(t *testing.T) { } func TestCheckWindow(t *testing.T) { - //stm: @CMD_HEALTH_APPEND_CIDS_001, @CMD_HEALTH_CHECK_WINDOW_001 assert := assert.New(t) threshold := 3 diff --git a/cmd/lotus-miner/actor_test.go b/cmd/lotus-miner/actor_test.go index 5f9e923e680..39d6a5ba25e 100644 --- a/cmd/lotus-miner/actor_test.go +++ b/cmd/lotus-miner/actor_test.go @@ -1,4 +1,3 @@ -// stm: #unit package main import ( @@ -25,7 +24,6 @@ import ( ) func TestWorkerKeyChange(t *testing.T) { - //stm: @OTHER_WORKER_KEY_CHANGE_001 if testing.Short() { t.Skip("skipping test in short mode") } diff --git a/cmd/lotus-miner/allinfo_test.go b/cmd/lotus-miner/allinfo_test.go index a0735fc9771..001ffb3af3d 100644 --- a/cmd/lotus-miner/allinfo_test.go +++ b/cmd/lotus-miner/allinfo_test.go @@ -1,4 +1,3 @@ -// stm: #integration package main import ( diff --git a/cmd/lotus-sim/simulation/stages/commit_queue_test.go b/cmd/lotus-sim/simulation/stages/commit_queue_test.go index 0b9a2ebdbc4..e2cac0fa442 100644 --- a/cmd/lotus-sim/simulation/stages/commit_queue_test.go +++ b/cmd/lotus-sim/simulation/stages/commit_queue_test.go @@ -1,4 +1,3 @@ -// stm: #unit package stages import ( @@ -14,7 +13,6 @@ import ( ) func TestCommitQueue(t *testing.T) { - //stm: @CMD_COMMIT_Q_ENQUEUE_COMMIT_001 var q commitQueue addr1, err := address.NewIDAddress(1000) require.NoError(t, err) @@ -48,7 +46,6 @@ func TestCommitQueue(t *testing.T) { SectorNumber: 6, })) - //stm: @CMD_COMMIT_Q_ADVANCE_EPOCH_001, @CMD_COMMIT_Q_NEXT_MINER_001 epoch := abi.ChainEpoch(0) q.advanceEpoch(epoch) _, _, ok := q.nextMiner() diff --git a/cmd/tvx/codenames_test.go b/cmd/tvx/codenames_test.go index 5801bce0078..05d4b3f8e13 100644 --- a/cmd/tvx/codenames_test.go +++ b/cmd/tvx/codenames_test.go @@ -1,4 +1,3 @@ -// stm: #unit package main import ( @@ -11,7 +10,6 @@ import ( ) func TestProtocolCodenames(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_EPOCH_CODENAMES_001 if height := abi.ChainEpoch(100); GetProtocolCodename(height) != "genesis" { t.Fatal("expected genesis codename") } diff --git a/conformance/chaos/actor_test.go b/conformance/chaos/actor_test.go index fd45504d27b..32323440df8 100644 --- a/conformance/chaos/actor_test.go +++ b/conformance/chaos/actor_test.go @@ -1,4 +1,3 @@ -// stm: #chaos package chaos import ( @@ -16,7 +15,6 @@ import ( ) func TestSingleton(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_BUILDER_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -31,7 +29,6 @@ func TestSingleton(t *testing.T) { } func TestCallerValidationNone(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -43,7 +40,6 @@ func TestCallerValidationNone(t *testing.T) { } func TestCallerValidationIs(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001 caller := atesting2.NewIDAddr(t, 100) receiver := atesting2.NewIDAddr(t, 101) builder := mock.NewBuilder(context.Background(), receiver) @@ -73,7 +69,6 @@ func TestCallerValidationIs(t *testing.T) { } func TestCallerValidationType(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001 caller := atesting2.NewIDAddr(t, 100) receiver := atesting2.NewIDAddr(t, 101) builder := mock.NewBuilder(context.Background(), receiver) @@ -100,7 +95,6 @@ func TestCallerValidationType(t *testing.T) { } func TestCallerValidationInvalidBranch(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -114,7 +108,6 @@ func TestCallerValidationInvalidBranch(t *testing.T) { } func TestDeleteActor(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CREATE_ACTOR_001 receiver := atesting2.NewIDAddr(t, 100) beneficiary := atesting2.NewIDAddr(t, 101) builder := mock.NewBuilder(context.Background(), receiver) @@ -129,7 +122,6 @@ func TestDeleteActor(t *testing.T) { } func TestMutateStateInTransaction(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CREATE_STATE_001, @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -157,7 +149,6 @@ func TestMutateStateInTransaction(t *testing.T) { } func TestMutateStateAfterTransaction(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CREATE_STATE_001, @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -192,7 +183,6 @@ func TestMutateStateAfterTransaction(t *testing.T) { } func TestMutateStateReadonly(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_CREATE_STATE_001, @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -227,7 +217,6 @@ func TestMutateStateReadonly(t *testing.T) { } func TestMutateStateInvalidBranch(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -242,7 +231,6 @@ func TestMutateStateInvalidBranch(t *testing.T) { } func TestAbortWith(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_ABORT_WITH_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -261,7 +249,6 @@ func TestAbortWith(t *testing.T) { } func TestAbortWithUncontrolled(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_ABORT_WITH_001 receiver := atesting2.NewIDAddr(t, 100) builder := mock.NewBuilder(context.Background(), receiver) @@ -279,7 +266,6 @@ func TestAbortWithUncontrolled(t *testing.T) { } func TestInspectRuntime(t *testing.T) { - //stm: @CHAIN_ACTOR_CHAOS_INSPECT_RUNTIME_001, @CHAIN_ACTOR_CHAOS_CREATE_STATE_001 caller := atesting2.NewIDAddr(t, 100) receiver := atesting2.NewIDAddr(t, 101) builder := mock.NewBuilder(context.Background(), receiver) diff --git a/conformance/corpus_test.go b/conformance/corpus_test.go index ec9f9d51640..903f5ca7f08 100644 --- a/conformance/corpus_test.go +++ b/conformance/corpus_test.go @@ -1,4 +1,3 @@ -// stm: ignore // This file does not test any behaviors by itself; rather, it runs other test files // Therefore, this file should not be annotated. package conformance diff --git a/gateway/node_test.go b/gateway/node_test.go index fd70f8f214b..f1a034fe72a 100644 --- a/gateway/node_test.go +++ b/gateway/node_test.go @@ -1,4 +1,3 @@ -// stm: #unit package gateway import ( @@ -94,7 +93,6 @@ func TestGatewayAPIChainGetTipSetByHeight(t *testing.T) { // Create tipsets from genesis up to tskh and return the highest ts := mock.createTipSets(tt.args.tskh, tt.args.genesisTS) - //stm: @GATEWAY_NODE_GET_TIPSET_BY_HEIGHT_001 got, err := a.ChainGetTipSetByHeight(ctx, tt.args.h, ts.Key()) if tt.expErr { require.Error(t, err) @@ -242,7 +240,6 @@ func (m *mockGatewayDepsAPI) Version(context.Context) (api.APIVersion, error) { } func TestGatewayVersion(t *testing.T) { - //stm: @GATEWAY_NODE_GET_VERSION_001 ctx := context.Background() mock := &mockGatewayDepsAPI{} a := NewNode(mock) diff --git a/itests/api_test.go b/itests/api_test.go index 9512dd736d6..617ded1d066 100644 --- a/itests/api_test.go +++ b/itests/api_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -24,17 +23,12 @@ import ( ) func TestAPI(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ts := apiSuite{} t.Run("testMiningReal", ts.testMiningReal) ts.opts = append(ts.opts, kit.ThroughRPC()) t.Run("testMiningReal", ts.testMiningReal) - //stm: @CHAIN_STATE_MINER_INFO_001 t.Run("direct", func(t *testing.T) { runAPITest(t, kit.MockProofs()) }) @@ -143,13 +137,11 @@ func (ts *apiSuite) testSearchMsg(t *testing.T) { sm, err := full.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := full.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.Equal(t, exitcode.Ok, res.Receipt.ExitCode, "message not successful") - //stm: @CHAIN_STATE_SEARCH_MSG_001 searchRes, err := full.StateSearchMsg(ctx, types.EmptyTSK, sm.Cid(), lapi.LookbackNoLimit, true) require.NoError(t, err) require.NotNil(t, searchRes) diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index 70da4be5a51..2f8bc140999 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -34,13 +33,7 @@ import ( // TestDeadlineToggling: func TestDeadlineToggling(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @MINER_SECTOR_LIST_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -98,7 +91,6 @@ func TestDeadlineToggling(t *testing.T) { { minerC.PledgeSectors(ctx, sectorsC, 0, nil) - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddrC, types.EmptyTSK) require.NoError(t, err) @@ -120,7 +112,6 @@ func TestDeadlineToggling(t *testing.T) { expectedPower := types.NewInt(uint64(ssz) * sectorsC) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddrC, types.EmptyTSK) require.NoError(t, err) @@ -129,14 +120,12 @@ func TestDeadlineToggling(t *testing.T) { } checkMiner := func(ma address.Address, power abi.StoragePower, active bool, tsk types.TipSetKey) { - //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, ma, tsk) require.NoError(t, err) // make sure it has the expected power. require.Equal(t, p.MinerPower.RawBytePower, power) - //stm: @CHAIN_STATE_GET_ACTOR_001 mact, err := client.StateGetActor(ctx, ma, tsk) require.NoError(t, err) @@ -208,7 +197,6 @@ func TestDeadlineToggling(t *testing.T) { }, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 r, err := client.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true) require.NoError(t, err) require.Equal(t, exitcode.Ok, r.Receipt.ExitCode) @@ -270,7 +258,6 @@ func TestDeadlineToggling(t *testing.T) { sectorbit := bitfield.New() sectorbit.Set(uint64(sectorNum)) - //stm: @CHAIN_STATE_SECTOR_PARTITION_001 loca, err := client.StateSectorPartition(ctx, maddrD, sectorNum, types.EmptyTSK) require.NoError(t, err) @@ -306,7 +293,6 @@ func TestDeadlineToggling(t *testing.T) { t.Log("sent termination message:", smsg.Cid()) - //stm: @CHAIN_STATE_WAIT_MSG_001 r, err := client.StateWaitMsg(ctx, smsg.Cid(), 2, api.LookbackNoLimit, true) require.NoError(t, err) require.Equal(t, exitcode.Ok, r.Receipt.ExitCode) diff --git a/itests/decode_params_test.go b/itests/decode_params_test.go index ea80e713753..02cc2450835 100644 --- a/itests/decode_params_test.go +++ b/itests/decode_params_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( diff --git a/itests/eth_config_test.go b/itests/eth_config_test.go index ecd0379e2b2..654fc86bf3b 100644 --- a/itests/eth_config_test.go +++ b/itests/eth_config_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( diff --git a/itests/gateway_test.go b/itests/gateway_test.go index 3972f91157d..8bcd93621ea 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -44,12 +43,7 @@ const ( // TestGatewayWalletMsig tests that API calls to wallet and msig can be made on a lite // node that is connected through a gateway to a full API node func TestGatewayWalletMsig(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() ctx := context.Background() @@ -127,7 +121,6 @@ func TestGatewayWalletMsig(t *testing.T) { addProposal, err := doSend(proto) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := lite.StateWaitMsg(ctx, addProposal, 1, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -139,7 +132,6 @@ func TestGatewayWalletMsig(t *testing.T) { // Get available balance of msig: should be greater than zero and less // than initial amount msig := execReturn.IDAddress - //stm: @CHAIN_STATE_MINER_AVAILABLE_BALANCE_001 msigBalance, err := lite.MsigGetAvailableBalance(ctx, msig, types.EmptyTSK) require.NoError(t, err) require.GreaterOrEqual(t, msigBalance.Int64(), int64(0)) @@ -152,7 +144,6 @@ func TestGatewayWalletMsig(t *testing.T) { addProposal, err = doSend(proto) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = lite.StateWaitMsg(ctx, addProposal, 1, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -170,7 +161,6 @@ func TestGatewayWalletMsig(t *testing.T) { approval1, err := doSend(proto) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = lite.StateWaitMsg(ctx, approval1, 1, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -184,10 +174,6 @@ func TestGatewayWalletMsig(t *testing.T) { // TestGatewayMsigCLI tests that msig CLI calls can be made // on a lite node that is connected through a gateway to a full API node func TestGatewayMsigCLI(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 kit.QuietMiningLogs() ctx := context.Background() diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index ecc13e3aaa7..d08d3de31c1 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -17,12 +16,7 @@ import ( ) func TestChainGetMessagesInTs(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() kit.QuietMiningLogs() @@ -91,7 +85,6 @@ func TestChainGetMessagesInTs(t *testing.T) { } for _, sm := range sms { - //stm: @CHAIN_STATE_WAIT_MSG_001 msgLookup, err := client.StateWaitMsg(ctx, sm.Cid(), 3, api.LookbackNoLimit, true) require.NoError(t, err) diff --git a/itests/mempool_test.go b/itests/mempool_test.go index d7c4023070c..f1062a9c4db 100644 --- a/itests/mempool_test.go +++ b/itests/mempool_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -20,8 +19,6 @@ const mPoolThrottle = time.Millisecond * 100 const mPoolTimeout = time.Second * 10 func TestMemPoolPushOutgoingInvalidDelegated(t *testing.T) { - //stm: @CHAIN_MEMPOOL_PENDING_001, @CHAIN_STATE_WAIT_MSG_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 - //stm: @CHAIN_MEMPOOL_PUSH_002 ctx := context.Background() firstNode, _, _, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) ens.InterconnectAll() @@ -47,9 +44,6 @@ func TestMemPoolPushOutgoingInvalidDelegated(t *testing.T) { } func TestMemPoolPushTwoNodes(t *testing.T) { - //stm: @CHAIN_MEMPOOL_CREATE_MSG_CHAINS_001, @CHAIN_MEMPOOL_SELECT_001 - //stm: @CHAIN_MEMPOOL_PENDING_001, @CHAIN_STATE_WAIT_MSG_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 - //stm: @CHAIN_MEMPOOL_PUSH_002 ctx := context.Background() const blockTime = 100 * time.Millisecond firstNode, secondNode, _, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) @@ -125,8 +119,6 @@ func TestMemPoolPushTwoNodes(t *testing.T) { } func TestMemPoolClearPending(t *testing.T) { - //stm: @CHAIN_MEMPOOL_PUSH_001, @CHAIN_MEMPOOL_PENDING_001 - //stm: @CHAIN_STATE_WAIT_MSG_001, @CHAIN_MEMPOOL_CLEAR_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 ctx := context.Background() const blockTime = 100 * time.Millisecond firstNode, _, _, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) @@ -182,10 +174,6 @@ func TestMemPoolClearPending(t *testing.T) { } func TestMemPoolBatchPush(t *testing.T) { - //stm: @CHAIN_MEMPOOL_CREATE_MSG_CHAINS_001, @CHAIN_MEMPOOL_SELECT_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 - //stm: @CHAIN_MEMPOOL_CHECK_PENDING_MESSAGES_001, @CHAIN_MEMPOOL_SELECT_001 - //stm: @CHAIN_MEMPOOL_PENDING_001, @CHAIN_STATE_WAIT_MSG_001 - //stm: @CHAIN_MEMPOOL_BATCH_PUSH_001 ctx := context.Background() const blockTime = 100 * time.Millisecond firstNode, _, _, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) @@ -400,10 +388,6 @@ func TestMemPoolPushSingleNode(t *testing.T) { } func TestMemPoolBatchPushUntrusted(t *testing.T) { - //stm: @CHAIN_MEMPOOL_CREATE_MSG_CHAINS_001, @CHAIN_MEMPOOL_SELECT_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 - //stm: @CHAIN_MEMPOOL_CHECK_PENDING_MESSAGES_001, @CHAIN_MEMPOOL_SELECT_001 - //stm: @CHAIN_MEMPOOL_PENDING_001, @CHAIN_STATE_WAIT_MSG_001 - //stm: @CHAIN_MEMPOOL_BATCH_PUSH_002 ctx := context.Background() const blockTime = 100 * time.Millisecond firstNode, _, _, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) diff --git a/itests/migration_test.go b/itests/migration_test.go index 72b570f104c..f1454ba42d3 100644 --- a/itests/migration_test.go +++ b/itests/migration_test.go @@ -100,7 +100,6 @@ func TestMigrationNV17(t *testing.T) { // Publish (but NOT activate) a verified storage deal from that clien // get VRH - //stm: @CHAIN_STATE_VERIFIED_REGISTRY_ROOT_KEY_001 vrh, err := clientApi.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{}) fmt.Println(vrh.String()) require.NoError(t, err) @@ -143,7 +142,6 @@ func TestMigrationNV17(t *testing.T) { sm, err := clientApi.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := clientApi.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, res.Receipt.ExitCode.IsSuccess()) @@ -162,7 +160,6 @@ func TestMigrationNV17(t *testing.T) { sm, err = clientApi.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = clientApi.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, res.Receipt.ExitCode.IsSuccess()) @@ -184,13 +181,11 @@ func TestMigrationNV17(t *testing.T) { sm, err = clientApi.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = clientApi.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, res.Receipt.ExitCode.IsSuccess()) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dc, err := clientApi.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, *dc, datacapToAssign) @@ -668,7 +663,6 @@ func TestMigrationNV19(t *testing.T) { waitForProof19: for { - //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en19 { @@ -711,7 +705,6 @@ waitForProof19: waitForProof20: for { - //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en20 { diff --git a/itests/mpool_push_with_uuid_test.go b/itests/mpool_push_with_uuid_test.go index 21f11f62599..b7ba52b71a9 100644 --- a/itests/mpool_push_with_uuid_test.go +++ b/itests/mpool_push_with_uuid_test.go @@ -18,7 +18,6 @@ import ( ) func TestMpoolPushWithoutUuidWithMaxFee(t *testing.T) { - //stm: @TOKEN_WALLET_SIGN_001, @CHAIN_MEMPOOL_PUSH_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/multisig_test.go b/itests/multisig_test.go index 92d9afca7dd..89b20f3c4d4 100644 --- a/itests/multisig_test.go +++ b/itests/multisig_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -28,12 +27,7 @@ import ( // TestMultisig does a basic test to exercise the multisig CLI commands func TestMultisig(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond @@ -45,12 +39,7 @@ func TestMultisig(t *testing.T) { // TestMultisigReentrant sends an infinitely recursive message to a multisig. func TestMultisigReentrant(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() ctx := context.Background() diff --git a/itests/net_test.go b/itests/net_test.go index 332677c2385..992d20347cb 100644 --- a/itests/net_test.go +++ b/itests/net_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -22,7 +21,6 @@ func TestNetConn(t *testing.T) { firstNode, secondNode, _, _ := kit.EnsembleTwoOne(t) - // stm: @NETWORK_COMMON_ID_001 secondNodeID, err := secondNode.ID(ctx) require.NoError(t, err) @@ -32,21 +30,17 @@ func TestNetConn(t *testing.T) { t.Errorf("node should be not connected to peers. %s", err.Error()) } - // stm: @NETWORK_COMMON_ADDRS_LISTEN_001 addrInfo, err := secondNode.NetAddrsListen(ctx) require.NoError(t, err) - // stm: @NETWORK_COMMON_CONNECT_001 err = firstNode.NetConnect(ctx, addrInfo) if err != nil { t.Errorf("nodes failed to connect. %s", err.Error()) } - // stm: @NETWORK_COMMON_PEER_INFO_001 netPeerInfo, err := firstNode.NetPeerInfo(ctx, secondNodeID) require.NoError(t, err) - // stm: @NETWORK_COMMON_AGENT_VERSION_001 agent, err := firstNode.NetAgentVersion(ctx, secondNodeID) require.NoError(t, err) @@ -54,7 +48,6 @@ func TestNetConn(t *testing.T) { t.Errorf("agents not matching. %s", err.Error()) } - // stm: @NETWORK_COMMON_FIND_PEER_001 secondNodePeer, err := firstNode.NetFindPeer(ctx, secondNodeID) require.NoError(t, err) @@ -68,12 +61,10 @@ func TestNetConn(t *testing.T) { t.Errorf("peer does not have connected state") } - // stm: @NETWORK_COMMON_PEERS_001 addrs, err := firstNode.NetPeers(ctx) require.NoError(t, err) require.NotEqual(t, 0, len(addrs)) - // stm: @NETWORK_COMMON_DISCONNECT_001 err = firstNode.NetDisconnect(ctx, secondNodeID) if err != nil { t.Errorf("nodes failed to disconnect. %s", err.Error()) @@ -85,7 +76,6 @@ func TestNetConn(t *testing.T) { t.Errorf("peer should have disconnected") } - // stm: @NETWORK_COMMON_PEERS_001 addrs, err = firstNode.NetPeers(ctx) require.NoError(t, err) @@ -121,13 +111,9 @@ func TestNetStat(t *testing.T) { } } - // stm: @NETWORK_COMMON_STAT_001 t.Run("all", withScope(t, "all")) - // stm: @NETWORK_COMMON_STAT_002 t.Run("system", withScope(t, "system")) - // stm: @NETWORK_COMMON_STAT_003 t.Run("transient", withScope(t, "transient")) - // stm: @NETWORK_COMMON_STAT_004 t.Run("peer", withScope(t, fmt.Sprintf("peer:%s", sId))) } @@ -146,11 +132,8 @@ func TestNetLimit(t *testing.T) { } } - // stm: @NETWORK_COMMON_LIMIT_001 t.Run("system", withScope(t, "system")) - // stm: @NETWORK_COMMON_LIMIT_002 t.Run("transient", withScope(t, "transient")) - // stm: @NETWORK_COMMON_LIMIT_003 t.Run("peer", withScope(t, fmt.Sprintf("peer:%s", sId))) } @@ -159,7 +142,6 @@ func TestNetBlockPeer(t *testing.T) { firstNode, secondNode, _, _ := kit.EnsembleTwoOne(t) - // stm: @NETWORK_COMMON_ID_001 firstAddrInfo, _ := firstNode.NetAddrsListen(ctx) firstNodeID, err := firstNode.ID(ctx) require.NoError(t, err) @@ -171,11 +153,9 @@ func TestNetBlockPeer(t *testing.T) { require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected, "shouldn't already be connected") - // stm: @NETWORK_COMMON_BLOCK_ADD_001 err = firstNode.NetBlockAdd(ctx, api.NetBlockList{Peers: []peer.ID{secondNodeID}}) require.NoError(t, err) - // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err := firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -194,11 +174,9 @@ func TestNetBlockPeer(t *testing.T) { require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected) - // stm: @NETWORK_COMMON_BLOCK_REMOVE_001 err = firstNode.NetBlockRemove(ctx, api.NetBlockList{Peers: []peer.ID{secondNodeID}}) require.NoError(t, err) - // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err = firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -217,7 +195,6 @@ func TestNetBlockIPAddr(t *testing.T) { firstNode, secondNode, _, _ := kit.EnsembleTwoOne(t) - // stm: @NETWORK_COMMON_ADDRS_LISTEN_001 firstAddrInfo, _ := firstNode.NetAddrsListen(ctx) secondAddrInfo, _ := secondNode.NetAddrsListen(ctx) @@ -239,11 +216,9 @@ func TestNetBlockIPAddr(t *testing.T) { require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected, "shouldn't already be connected") - // stm: @NETWORK_COMMON_BLOCK_ADD_001 require.NoError(t, firstNode.NetBlockAdd(ctx, api.NetBlockList{ IPAddrs: secondNodeIPs}), "failed to add blocked IPs") - // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err := firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -271,11 +246,9 @@ func TestNetBlockIPAddr(t *testing.T) { return connectedness != network.Connected }, time.Second*5, time.Millisecond*10) - // stm: @NETWORK_COMMON_BLOCK_REMOVE_001 err = firstNode.NetBlockRemove(ctx, api.NetBlockList{IPAddrs: secondNodeIPs}) require.NoError(t, err) - // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err = firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -290,7 +263,6 @@ func TestNetBlockIPAddr(t *testing.T) { } func getConnState(ctx context.Context, t *testing.T, node *kit.TestFullNode, peer peer.ID) network.Connectedness { - // stm: @NETWORK_COMMON_CONNECTEDNESS_001 connState, err := node.NetConnectedness(ctx, peer) require.NoError(t, err) diff --git a/itests/nonce_test.go b/itests/nonce_test.go index cac2413f73c..f95c733af5e 100644 --- a/itests/nonce_test.go +++ b/itests/nonce_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -16,12 +15,7 @@ import ( ) func TestNonceIncremental(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 ctx := context.Background() kit.QuietMiningLogs() @@ -60,7 +54,6 @@ func TestNonceIncremental(t *testing.T) { } for _, sm := range sms { - //stm: @CHAIN_STATE_WAIT_MSG_001 _, err := client.StateWaitMsg(ctx, sm.Cid(), 3, api.LookbackNoLimit, true) require.NoError(t, err) } diff --git a/itests/paych_api_test.go b/itests/paych_api_test.go index a6d500fc322..620ba583fe2 100644 --- a/itests/paych_api_test.go +++ b/itests/paych_api_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -27,12 +26,7 @@ import ( ) func TestPaymentChannelsAPI(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() ctx := context.Background() @@ -127,7 +121,6 @@ func TestPaymentChannelsAPI(t *testing.T) { require.NoError(t, err) preds := state.NewStatePredicates(paymentCreator) finished := make(chan struct{}) - //stm: @CHAIN_STATE_GET_ACTOR_001 err = ev.StateChanged(func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) { act, err := paymentCreator.StateGetActor(ctx, channel, ts.Key()) if err != nil { @@ -208,7 +201,6 @@ func TestPaymentChannelsAPI(t *testing.T) { collectMsg, err := paymentReceiver.PaychCollect(ctx, channel) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = paymentReceiver.StateWaitMsg(ctx, collectMsg, 3, api.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode, "unable to collect on payment channel") diff --git a/itests/paych_cli_test.go b/itests/paych_cli_test.go index c6d02de8b26..182bfe36f47 100644 --- a/itests/paych_cli_test.go +++ b/itests/paych_cli_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -32,12 +31,7 @@ import ( // TestPaymentChannelsBasic does a basic test to exercise the payment channel CLI // commands func TestPaymentChannelsBasic(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -110,10 +104,6 @@ type voucherSpec struct { // TestPaymentChannelStatus tests the payment channel status CLI command func TestPaymentChannelStatus(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -194,12 +184,7 @@ func TestPaymentChannelStatus(t *testing.T) { // TestPaymentChannelVouchers does a basic test to exercise some payment // channel voucher commands func TestPaymentChannelVouchers(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() @@ -332,12 +317,7 @@ func TestPaymentChannelVouchers(t *testing.T) { // TestPaymentChannelVoucherCreateShortfall verifies that if a voucher amount // is greater than what's left in the channel, voucher create fails func TestPaymentChannelVoucherCreateShortfall(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 _ = os.Setenv("BELLMAN_NO_GPU", "1") kit.QuietMiningLogs() diff --git a/itests/pending_deal_allocation_test.go b/itests/pending_deal_allocation_test.go index 802f467db05..cf329ab8bd3 100644 --- a/itests/pending_deal_allocation_test.go +++ b/itests/pending_deal_allocation_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -56,7 +55,6 @@ func TestGetAllocationForPendingDeal(t *testing.T) { defer cancel() // get VRH - //stm: @CHAIN_STATE_VERIFIED_REGISTRY_ROOT_KEY_001 vrh, err := api.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{}) fmt.Println(vrh.String()) require.NoError(t, err) @@ -87,7 +85,6 @@ func TestGetAllocationForPendingDeal(t *testing.T) { sm, err := api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -109,13 +106,11 @@ func TestGetAllocationForPendingDeal(t *testing.T) { sm, err = api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dcap, err := api.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, *dcap, datacap) diff --git a/itests/remove_verifreg_datacap_test.go b/itests/remove_verifreg_datacap_test.go index 32fb8b8ba7a..bb531733e0a 100644 --- a/itests/remove_verifreg_datacap_test.go +++ b/itests/remove_verifreg_datacap_test.go @@ -63,7 +63,6 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { // Publish (but NOT activate) a verified storage deal from that clien // get VRH - //stm: @CHAIN_STATE_VERIFIED_REGISTRY_ROOT_KEY_001 vrh, err := clientApi.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{}) fmt.Println(vrh.String()) require.NoError(t, err) @@ -106,7 +105,6 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { sm, err := clientApi.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := clientApi.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, res.Receipt.ExitCode.IsSuccess()) @@ -125,7 +123,6 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { sm, err = clientApi.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = clientApi.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, res.Receipt.ExitCode.IsSuccess()) @@ -147,13 +144,11 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { sm, err = clientApi.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = clientApi.StateWaitMsg(ctx, sm.Cid(), 1, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, res.Receipt.ExitCode.IsSuccess()) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dc, err := clientApi.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, *dc, datacapToAssign) diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index a4df47dbd1c..98bd98f8dcf 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -45,13 +44,7 @@ import ( ) func TestMinerBalanceCollateral(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @MINER_SECTOR_LIST_001 kit.QuietMiningLogs() blockTime := 5 * time.Millisecond diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go index eb93cfe9a1c..b9b424c60c3 100644 --- a/itests/sector_pledge_test.go +++ b/itests/sector_pledge_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -25,12 +24,7 @@ import ( ) func TestPledgeSectors(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.QuietMiningLogs() blockTime := 50 * time.Millisecond @@ -63,7 +57,6 @@ func TestPledgeSectors(t *testing.T) { } func TestPledgeBatching(t *testing.T) { - //stm: @SECTOR_PRE_COMMIT_FLUSH_001, @SECTOR_COMMIT_FLUSH_001 blockTime := 50 * time.Millisecond runTest := func(t *testing.T, nSectors int, aggregate bool) { @@ -129,12 +122,7 @@ func TestPledgeBatching(t *testing.T) { } func TestPledgeMaxBatching(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 blockTime := 50 * time.Millisecond runTest := func(t *testing.T) { @@ -198,7 +186,6 @@ func TestPledgeMaxBatching(t *testing.T) { } // Ensure that max aggregate message has propagated to the other node by checking current state - //stm: @CHAIN_STATE_MINER_SECTORS_001 sectorInfosAfter, err := full.StateMinerSectors(ctx, miner.ActorAddr, nil, types.EmptyTSK) require.NoError(t, err) assert.Equal(t, miner5.MaxAggregatedSectors+kit.DefaultPresealsPerBootstrapMiner, len(sectorInfosAfter)) diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go index f3524c1984f..fd05a027617 100644 --- a/itests/sector_terminate_test.go +++ b/itests/sector_terminate_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -23,12 +22,7 @@ import ( ) func TestTerminate(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -48,7 +42,6 @@ func TestTerminate(t *testing.T) { ssz, err := miner.ActorSectorSize(ctx, maddr) require.NoError(t, err) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, p.MinerPower, p.TotalPower) @@ -61,7 +54,6 @@ func TestTerminate(t *testing.T) { t.Log("wait for power") { - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 // Wait until proven. di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -75,7 +67,6 @@ func TestTerminate(t *testing.T) { nSectors++ - //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, p.MinerPower, p.TotalPower) @@ -85,7 +76,6 @@ func TestTerminate(t *testing.T) { toTerminate := abi.SectorNumber(3) - //stm: @SECTOR_TERMINATE_001 err = miner.SectorTerminate(ctx, toTerminate) require.NoError(t, err) @@ -98,7 +88,6 @@ loop: t.Log("state: ", si.State, msgTriggerred) switch sealing.SectorState(si.State) { - //stm: @SECTOR_TERMINATE_PENDING_001 case sealing.Terminating: if !msgTriggerred { { @@ -131,7 +120,6 @@ loop: // need to wait for message to be mined and applied. time.Sleep(5 * time.Second) - //stm: @CHAIN_STATE_MINER_POWER_001 // check power decreased p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -140,7 +128,6 @@ loop: // check in terminated set { - //stm: @CHAIN_STATE_MINER_GET_PARTITIONS_001 parts, err := client.StateMinerPartitions(ctx, maddr, 1, types.EmptyTSK) require.NoError(t, err) require.Greater(t, len(parts), 0) @@ -155,7 +142,6 @@ loop: require.Equal(t, uint64(0), bflen(parts[0].LiveSectors)) } - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -164,7 +150,6 @@ loop: ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) diff --git a/itests/self_sent_txn_test.go b/itests/self_sent_txn_test.go index 00ca0e5aeeb..5f9fa34114c 100644 --- a/itests/self_sent_txn_test.go +++ b/itests/self_sent_txn_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -21,7 +20,6 @@ import ( // we reordered the checks to make sure that a transaction with too much money in it sent to yourself will fail instead of succeeding as a noop // more info in this PR! https://github.com/filecoin-project/lotus/pull/7637 func TestSelfSentTxnV15(t *testing.T) { - //stm: @TOKEN_WALLET_SIGN_001, @CHAIN_MEMPOOL_PUSH_001 ctx := context.Background() kit.QuietMiningLogs() @@ -63,7 +61,6 @@ func TestSelfSentTxnV15(t *testing.T) { } func TestSelfSentTxnV14(t *testing.T) { - //stm: @TOKEN_WALLET_SIGN_001, @CHAIN_MEMPOOL_PUSH_001 ctx := context.Background() kit.QuietMiningLogs() diff --git a/itests/splitstore_test.go b/itests/splitstore_test.go index bd0fe762465..466adaf0012 100644 --- a/itests/splitstore_test.go +++ b/itests/splitstore_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index 07a31477d75..cfbbdd6bd70 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -31,12 +30,7 @@ import ( ) func TestVerifiedClientTopUp(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 blockTime := 100 * time.Millisecond test := func(nv network.Version, shouldWork bool) func(*testing.T) { @@ -65,7 +59,6 @@ func TestVerifiedClientTopUp(t *testing.T) { defer cancel() // get VRH - //stm: @CHAIN_STATE_VERIFIED_REGISTRY_ROOT_KEY_001 vrh, err := api.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{}) fmt.Println(vrh.String()) require.NoError(t, err) @@ -96,7 +89,6 @@ func TestVerifiedClientTopUp(t *testing.T) { sm, err := api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err, "AddVerifier failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) @@ -118,13 +110,11 @@ func TestVerifiedClientTopUp(t *testing.T) { sm, err = api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dcap, err := api.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, *dcap, datacap) @@ -159,12 +149,7 @@ func TestVerifiedClientTopUp(t *testing.T) { } func TestRemoveDataCap(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 blockTime := 100 * time.Millisecond rootKey, err := key.GenerateKey(types.KTSecp256k1) @@ -196,7 +181,6 @@ func TestRemoveDataCap(t *testing.T) { defer cancel() // get VRH - //stm: @CHAIN_STATE_VERIFIED_REGISTRY_ROOT_KEY_001 vrh, err := api.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{}) fmt.Println(vrh.String()) require.NoError(t, err) @@ -249,13 +233,11 @@ func TestRemoveDataCap(t *testing.T) { sm, err := api.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dcap, err := api.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, *dcap, datacap) @@ -320,13 +302,11 @@ func TestRemoveDataCap(t *testing.T) { sm, err = api.MpoolPushMessage(ctx, removeMsg, nil) require.NoError(t, err, "RemoveDataCap failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dcap, err = api.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Equal(t, *dcap, big.Sub(datacap, removeDatacap)) @@ -339,13 +319,11 @@ func TestRemoveDataCap(t *testing.T) { sm, err = api.MpoolPushMessage(ctx, removeMsg, nil) require.NoError(t, err, "RemoveDataCap failed") - //stm: @CHAIN_STATE_WAIT_MSG_001 res, err = api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true) require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) // check datacap balance - //stm: @CHAIN_STATE_VERIFIED_CLIENT_STATUS_001 dcap, err = api.StateVerifiedClientStatus(ctx, verifiedClientAddr, types.EmptyTSK) require.NoError(t, err) require.Nil(t, dcap, "expected datacap to be nil") diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go index 49f0d2053ce..75aa0ff5090 100644 --- a/itests/wdpost_dispute_test.go +++ b/itests/wdpost_dispute_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -25,12 +24,7 @@ import ( ) func TestWindowPostDispute(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -72,7 +66,6 @@ func TestWindowPostDispute(t *testing.T) { evilMinerAddr, err := evilMiner.ActorAddress(ctx) require.NoError(t, err) - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -84,7 +77,6 @@ func TestWindowPostDispute(t *testing.T) { ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -94,11 +86,9 @@ func TestWindowPostDispute(t *testing.T) { // make sure it has gained power. require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz))) - //stm: @MINER_SECTOR_LIST_001 evilSectors, err := evilMiner.SectorsListNonGenesis(ctx) require.NoError(t, err) evilSectorNo := evilSectors[0] // only one. - //stm: @CHAIN_STATE_SECTOR_PARTITION_001 evilSectorLoc, err := client.StateSectorPartition(ctx, evilMinerAddr, evilSectorNo, types.EmptyTSK) require.NoError(t, err) @@ -111,7 +101,6 @@ func TestWindowPostDispute(t *testing.T) { // Wait until we need to prove our sector. for { - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) if di.Index == evilSectorLoc.Deadline && di.CurrentEpoch-di.Open > 1 { @@ -125,7 +114,6 @@ func TestWindowPostDispute(t *testing.T) { // Wait until after the proving period. for { - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) if di.Index != evilSectorLoc.Deadline { @@ -136,7 +124,6 @@ func TestWindowPostDispute(t *testing.T) { t.Log("accepted evil proof") - //stm: @CHAIN_STATE_MINER_POWER_001 // Make sure the evil node didn't lose any power. p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -163,13 +150,11 @@ func TestWindowPostDispute(t *testing.T) { require.NoError(t, err) t.Log("waiting dispute") - //stm: @CHAIN_STATE_WAIT_MSG_001 rec, err := client.StateWaitMsg(ctx, sm.Cid(), buildconstants.MessageConfidence, api.LookbackNoLimit, true) require.NoError(t, err) require.Zero(t, rec.Receipt.ExitCode, "dispute not accepted: %s", rec.Receipt.ExitCode.Error()) } - //stm: @CHAIN_STATE_MINER_POWER_001 // Objection SUSTAINED! // Make sure the evil node lost power. p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK) @@ -182,7 +167,6 @@ func TestWindowPostDispute(t *testing.T) { // First, recover the sector. { - //stm: @CHAIN_STATE_MINER_INFO_001 minerInfo, err := client.StateMinerInfo(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -207,7 +191,6 @@ func TestWindowPostDispute(t *testing.T) { sm, err := client.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - //stm: @CHAIN_STATE_WAIT_MSG_001 rec, err := client.StateWaitMsg(ctx, sm.Cid(), buildconstants.MessageConfidence, api.LookbackNoLimit, true) require.NoError(t, err) require.Zero(t, rec.Receipt.ExitCode, "recovery not accepted: %s", rec.Receipt.ExitCode.Error()) @@ -215,7 +198,6 @@ func TestWindowPostDispute(t *testing.T) { // Then wait for the deadline. for { - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK) require.NoError(t, err) @@ -235,11 +217,6 @@ func TestWindowPostDispute(t *testing.T) { } func TestWindowPostDisputeFails(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_STATE_MINER_GET_DEADLINES_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -262,7 +239,6 @@ func TestWindowPostDisputeFails(t *testing.T) { miner.PledgeSectors(ctx, 10, 0, nil) - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -277,7 +253,6 @@ func TestWindowPostDisputeFails(t *testing.T) { require.NoError(t, err) expectedPower := types.NewInt(uint64(ssz) * (kit.DefaultPresealsPerBootstrapMiner + 10)) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -343,13 +318,11 @@ func submitBadProof( return err } - //stm: @CHAIN_STATE_MINER_INFO_001 minerInfo, err := client.StateMinerInfo(ctx, maddr, head.Key()) if err != nil { return err } - //stm: @CHAIN_STATE_GET_RANDOMNESS_FROM_TICKETS_001 commEpoch := di.Open commRand, err := client.StateGetRandomnessFromTickets( ctx, crypto.DomainSeparationTag_PoStChainCommit, @@ -386,7 +359,6 @@ func submitBadProof( return err } - //stm: @CHAIN_STATE_WAIT_MSG_001 rec, err := client.StateWaitMsg(ctx, sm.Cid(), buildconstants.MessageConfidence, api.LookbackNoLimit, true) if err != nil { return err diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index 2a6fc866ea8..3f130cc1948 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -1,4 +1,3 @@ -// stm: #integration package itests import ( @@ -28,12 +27,7 @@ import ( ) func TestWindowedPost(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -70,7 +64,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, maddr, err := miner.ActorAddress(ctx) require.NoError(t, err) - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -84,7 +77,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -98,7 +90,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, // Drop 2 sectors from deadline 2 partition 0 (full partition / deadline) { - //stm: @CHAIN_STATE_MINER_GET_PARTITIONS_001 parts, err := client.StateMinerPartitions(ctx, maddr, 2, types.EmptyTSK) require.NoError(t, err) require.Greater(t, len(parts), 0) @@ -124,7 +115,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, // Drop 1 sectors from deadline 3 partition 0 { - //stm: @CHAIN_STATE_MINER_GET_PARTITIONS_001 parts, err := client.StateMinerPartitions(ctx, maddr, 3, types.EmptyTSK) require.NoError(t, err) require.Greater(t, len(parts), 0) @@ -153,7 +143,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, require.NoError(t, err) } - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -164,7 +153,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, ts = client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -178,7 +166,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, false) require.NoError(t, err) - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -188,7 +175,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, ts = client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) t.Logf("Now head.Height = %d", ts.Height()) - //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -203,7 +189,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, { // Wait until proven. - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -214,7 +199,6 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, t.Logf("Now head.Height = %d", ts.Height()) } - //stm: @CHAIN_STATE_MINER_POWER_001 p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK) require.NoError(t, err) @@ -225,12 +209,7 @@ func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, } func TestWindowPostBaseFeeBurn(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 kit.Expensive(t) kit.QuietMiningLogs() @@ -246,12 +225,10 @@ func TestWindowPostBaseFeeBurn(t *testing.T) { maddr, err := miner.ActorAddress(ctx) require.NoError(t, err) - //stm: @CHAIN_STATE_MINER_INFO_001 mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK) require.NoError(t, err) miner.PledgeSectors(ctx, 10, 0, nil) - //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) en := wact.Nonce @@ -260,7 +237,6 @@ func TestWindowPostBaseFeeBurn(t *testing.T) { waitForProof: for { - //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en { @@ -270,11 +246,9 @@ waitForProof: build.Clock.Sleep(blocktime) } - //stm: @CHAIN_STATE_LIST_MESSAGES_001 slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0) require.NoError(t, err) - //stm: @CHAIN_STATE_REPLAY_001 pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0]) require.NoError(t, err) @@ -307,7 +281,6 @@ func TestWindowPostV1P1NV20(t *testing.T) { waitForProof: for { - //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en { @@ -352,7 +325,6 @@ waitForProof: require.Contains(t, ret.Error, "expected proof of type StackedDRGWindow2KiBV1P1, got StackedDRGWindow2KiBV1") for { - //stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001 di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) // wait until the deadline finishes. diff --git a/itests/worker_test.go b/itests/worker_test.go index b3b8edd7632..aacc0b58e79 100644 --- a/itests/worker_test.go +++ b/itests/worker_test.go @@ -556,7 +556,6 @@ func TestWindowPostV1P1NV20Worker(t *testing.T) { waitForProof: for { - //stm: @CHAIN_STATE_GET_ACTOR_001 wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK) require.NoError(t, err) if wact.Nonce > en { diff --git a/journal/alerting/alerts_test.go b/journal/alerting/alerts_test.go index 5f8c269296d..46ab4bbbfdc 100644 --- a/journal/alerting/alerts_test.go +++ b/journal/alerting/alerts_test.go @@ -1,4 +1,3 @@ -// stm: #unit package alerting import ( @@ -13,7 +12,6 @@ import ( ) func TestAlerting(t *testing.T) { - //stm: @JOURNAL_ALERTS_ADD_ALERT_TYPE_001, @JOURNAL_ALERTS_RAISE_001, @JOURNAL_ALERTS_GET_ALERTS_001 mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() j := mockjournal.NewMockJournal(mockCtrl) diff --git a/journal/registry_test.go b/journal/registry_test.go index 65956daf741..bce3d3f175f 100644 --- a/journal/registry_test.go +++ b/journal/registry_test.go @@ -1,4 +1,3 @@ -// stm: #unit package journal import ( @@ -8,7 +7,6 @@ import ( ) func TestDisabledEvents(t *testing.T) { - //stm: @JOURNAL_REGISTRY_NEW_EVENT_TYPE_001, @JOURNAL_REGISTRY_PARSE_DISABLED_001 req := require.New(t) test := func(dis DisabledEvents) func(*testing.T) { @@ -46,7 +44,6 @@ func TestDisabledEvents(t *testing.T) { } func TestParseDisableEvents(t *testing.T) { - //stm: @JOURNAL_REGISTRY_PARSE_DISABLED_002 _, err := ParseDisabledEvents("system1:disabled1:failed,system1:disabled2") require.Error(t, err) } diff --git a/lib/backupds/backupds_test.go b/lib/backupds/backupds_test.go index 8909a5f3bbc..e882c6b618b 100644 --- a/lib/backupds/backupds_test.go +++ b/lib/backupds/backupds_test.go @@ -1,4 +1,3 @@ -// stm: #unit package backupds import ( @@ -37,7 +36,6 @@ func checkVals(t *testing.T, ds datastore.Datastore, start, end int, exist bool) } func TestNoLogRestore(t *testing.T) { - //stm: @OTHER_DATASTORE_RESTORE_002 ds1 := datastore.NewMapDatastore() putVals(t, ds1, 0, 10) @@ -58,7 +56,6 @@ func TestNoLogRestore(t *testing.T) { } func TestLogRestore(t *testing.T) { - //stm: @OTHER_DATASTORE_RESTORE_001 logdir := t.TempDir() ds1 := datastore.NewMapDatastore() diff --git a/lib/rpcenc/reader_test.go b/lib/rpcenc/reader_test.go index 3a554a0ca1e..b1a74d04d30 100644 --- a/lib/rpcenc/reader_test.go +++ b/lib/rpcenc/reader_test.go @@ -1,4 +1,3 @@ -// stm: #unit package rpcenc import ( diff --git a/lib/sigs/bls/bls_bench_test.go b/lib/sigs/bls/bls_bench_test.go index 70e2a45ca2b..389487a2587 100644 --- a/lib/sigs/bls/bls_bench_test.go +++ b/lib/sigs/bls/bls_bench_test.go @@ -1,4 +1,3 @@ -// stm: ignore // Ignored because implementation relies on external (ffi) lib package bls diff --git a/lib/sigs/bls/bls_test.go b/lib/sigs/bls/bls_test.go index 7a290b8b79f..cf0d681a4bd 100644 --- a/lib/sigs/bls/bls_test.go +++ b/lib/sigs/bls/bls_test.go @@ -1,4 +1,3 @@ -// stm: ignore // Ignored because implementation relies on external (ffi) lib package bls_test diff --git a/lib/stati/stats_test.go b/lib/stati/stats_test.go index c1a7ff66a1d..fa92913b669 100644 --- a/lib/stati/stats_test.go +++ b/lib/stati/stats_test.go @@ -1,4 +1,3 @@ -// stm: ignore package stati import ( diff --git a/lib/tablewriter/tablewiter_test.go b/lib/tablewriter/tablewiter_test.go index 8ce8d3253db..9c5f9d37d3c 100644 --- a/lib/tablewriter/tablewiter_test.go +++ b/lib/tablewriter/tablewiter_test.go @@ -1,4 +1,3 @@ -// stm: #unit package tablewriter import ( @@ -9,7 +8,6 @@ import ( ) func TestTableWriter(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_TABLE_WRITE_001, @OTHER_IMPLEMENTATION_TABLE_FLUSH_001 tw := New(Col("C1"), Col("X"), Col("C333"), NewLineCol("Thing")) tw.Write(map[string]interface{}{ "C1": "234", diff --git a/lib/ulimit/ulimit_test.go b/lib/ulimit/ulimit_test.go index 4b3cf73dfae..1f72fb27b80 100644 --- a/lib/ulimit/ulimit_test.go +++ b/lib/ulimit/ulimit_test.go @@ -1,4 +1,3 @@ -//stm: ignore //go:build !windows // +build !windows diff --git a/node/config/def_test.go b/node/config/def_test.go index 0d7639f58fe..9caab36bc28 100644 --- a/node/config/def_test.go +++ b/node/config/def_test.go @@ -1,4 +1,3 @@ -// stm: #unit package config import ( @@ -13,7 +12,6 @@ import ( ) func TestDefaultFullNodeRoundtrip(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_001 c := DefaultFullNode() var s string @@ -53,7 +51,6 @@ func TestDefaultFullNodeCommentRoundtrip(t *testing.T) { } func TestDefaultMinerRoundtrip(t *testing.T) { - //stm: @OTHER_IMPLEMENTATION_001 c := DefaultStorageMiner() var s string diff --git a/node/config/load_test.go b/node/config/load_test.go index 2eeacb7d5b3..acd58163f58 100644 --- a/node/config/load_test.go +++ b/node/config/load_test.go @@ -1,4 +1,3 @@ -// stm: #unit package config import ( @@ -14,7 +13,6 @@ import ( func fullNodeDefault() (interface{}, error) { return DefaultFullNode(), nil } func TestDecodeNothing(t *testing.T) { - //stm: @NODE_CONFIG_LOAD_FILE_002 assert := assert.New(t) { @@ -33,7 +31,6 @@ func TestDecodeNothing(t *testing.T) { } func TestParitalConfig(t *testing.T) { - //stm: @NODE_CONFIG_LOAD_FILE_003 assert := assert.New(t) cfgString := ` [API] diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index ee4ca3b9850..5e79fb443f0 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -1,4 +1,3 @@ -// stm: #unit package full import ( @@ -13,7 +12,6 @@ import ( ) func TestMedian(t *testing.T) { - //stm: @MARKET_GAS_GET_MEDIAN_PREMIUM_001 require.Equal(t, types.NewInt(5), medianGasPremium([]GasMeta{ {big.NewInt(5), buildconstants.BlockGasTarget}, }, 1)) diff --git a/node/repo/fsrepo_test.go b/node/repo/fsrepo_test.go index 943acc58262..a7c767aaa66 100644 --- a/node/repo/fsrepo_test.go +++ b/node/repo/fsrepo_test.go @@ -1,4 +1,3 @@ -// stm: #unit package repo import ( @@ -21,11 +20,6 @@ func genFsRepo(t *testing.T) *FsRepo { } func TestFsBasic(t *testing.T) { - //stm: @NODE_FS_REPO_LOCK_001,@NODE_FS_REPO_LOCK_002,@NODE_FS_REPO_UNLOCK_001 - //stm: @NODE_FS_REPO_SET_API_ENDPOINT_001, @NODE_FS_REPO_GET_API_ENDPOINT_001 - //stm: @NODE_FS_REPO_GET_CONFIG_001, @NODE_FS_REPO_SET_CONFIG_001 - //stm: @NODE_FS_REPO_LIST_KEYS_001, @NODE_FS_REPO_PUT_KEY_001 - //stm: @NODE_FS_REPO_GET_KEY_001, NODE_FS_REPO_DELETE_KEY_001 repo := genFsRepo(t) basicTest(t, repo) } diff --git a/node/repo/memrepo_test.go b/node/repo/memrepo_test.go index 6b3fc158bbe..965bc02c195 100644 --- a/node/repo/memrepo_test.go +++ b/node/repo/memrepo_test.go @@ -1,4 +1,3 @@ -// stm: #unit package repo import ( @@ -6,7 +5,6 @@ import ( ) func TestMemBasic(t *testing.T) { - //stm: @REPO_MEM_001 repo := NewMemory(nil) basicTest(t, repo) } diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index 76bf901d17e..35f2a70277c 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -1,4 +1,3 @@ -// stm: #unit package repo import ( diff --git a/node/shutdown_test.go b/node/shutdown_test.go index 6a5088efd78..15e2af93e5e 100644 --- a/node/shutdown_test.go +++ b/node/shutdown_test.go @@ -1,4 +1,3 @@ -// stm: #unit package node import ( @@ -11,7 +10,6 @@ import ( ) func TestMonitorShutdown(t *testing.T) { - //stm: @NODE_COMMON_SHUTDOWN_001 signalCh := make(chan struct{}) // Three shutdown handlers. diff --git a/paychmgr/msglistener_test.go b/paychmgr/msglistener_test.go index 38f2351ffa3..4b8ae6f30b1 100644 --- a/paychmgr/msglistener_test.go +++ b/paychmgr/msglistener_test.go @@ -15,7 +15,6 @@ func testCids() []cid.Cid { } func TestMsgListener(t *testing.T) { - //stm: @TOKEN_PAYCH_REG_ON_MSG_COMPLETE_001, @TOKEN_PAYCH_FIRE_ON_MSG_COMPLETE_001 ml := newMsgListeners() done := false @@ -34,7 +33,6 @@ func TestMsgListener(t *testing.T) { } func TestMsgListenerNilErr(t *testing.T) { - //stm: @TOKEN_PAYCH_REG_ON_MSG_COMPLETE_001, @TOKEN_PAYCH_FIRE_ON_MSG_COMPLETE_001 ml := newMsgListeners() done := false @@ -52,7 +50,6 @@ func TestMsgListenerNilErr(t *testing.T) { } func TestMsgListenerUnsub(t *testing.T) { - //stm: @TOKEN_PAYCH_REG_ON_MSG_COMPLETE_001, @TOKEN_PAYCH_FIRE_ON_MSG_COMPLETE_001 ml := newMsgListeners() done := false @@ -75,7 +72,6 @@ func TestMsgListenerUnsub(t *testing.T) { } func TestMsgListenerMulti(t *testing.T) { - //stm: @TOKEN_PAYCH_REG_ON_MSG_COMPLETE_001, @TOKEN_PAYCH_FIRE_ON_MSG_COMPLETE_001 ml := newMsgListeners() count := 0 diff --git a/paychmgr/paych_test.go b/paychmgr/paych_test.go index e72a992a37f..e0ac8c846de 100644 --- a/paychmgr/paych_test.go +++ b/paychmgr/paych_test.go @@ -1,4 +1,3 @@ -// stm: #unit package paychmgr import ( @@ -44,9 +43,6 @@ func TestCheckVoucherValid(t *testing.T) { mock.setAccountAddress(fromAcct, from) mock.setAccountAddress(toAcct, to) - //stm: @TOKEN_PAYCH_VOUCHER_VALID_001, @TOKEN_PAYCH_VOUCHER_VALID_002, @TOKEN_PAYCH_VOUCHER_VALID_003 - //stm: @TOKEN_PAYCH_VOUCHER_VALID_004, @TOKEN_PAYCH_VOUCHER_VALID_005, @TOKEN_PAYCH_VOUCHER_VALID_006, @TOKEN_PAYCH_VOUCHER_VALID_007 - //stm: @TOKEN_PAYCH_VOUCHER_VALID_009, @TOKEN_PAYCH_VOUCHER_VALID_010 tcases := []struct { name string expectError bool @@ -246,7 +242,6 @@ func TestCreateVoucher(t *testing.T) { Lane: 1, Amount: voucherLane1Amt, } - //stm: @TOKEN_PAYCH_VOUCHER_CREATE_001 res, err := s.mgr.CreateVoucher(ctx, s.ch, voucher) require.NoError(t, err) require.NotNil(t, res.Voucher) @@ -291,7 +286,6 @@ func TestCreateVoucher(t *testing.T) { Lane: 2, Amount: voucherLane2Amt, } - //stm: @TOKEN_PAYCH_VOUCHER_CREATE_004 res, err = s.mgr.CreateVoucher(ctx, s.ch, voucher) require.NoError(t, err) @@ -302,7 +296,6 @@ func TestCreateVoucher(t *testing.T) { } func TestAddVoucherDelta(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_VOUCHERS_001 ctx := context.Background() // Set up a manager with a single payment channel @@ -364,7 +357,6 @@ func TestAddVoucherNextLane(t *testing.T) { require.NoError(t, err) require.EqualValues(t, ci.NextLane, 3) - //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001 // Allocate a lane (should be lane 3) lane, err := s.mgr.AllocateLane(ctx, s.ch) require.NoError(t, err) @@ -401,7 +393,6 @@ func TestAllocateLane(t *testing.T) { // Set up a manager with a single payment channel s := testSetupMgrWithChannel(t) - //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001 // First lane should be 0 lane, err := s.mgr.AllocateLane(ctx, s.ch) require.NoError(t, err) @@ -456,7 +447,6 @@ func TestAllocateLaneWithExistingLaneState(t *testing.T) { _, err = mgr.AddVoucherInbound(ctx, ch, sv, nil, minDelta) require.NoError(t, err) - //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001 // Allocate lane should return the next lane (lane 3) lane, err := mgr.AllocateLane(ctx, ch) require.NoError(t, err) @@ -502,7 +492,6 @@ func TestAddVoucherInboundWalletKey(t *testing.T) { sv := createTestVoucher(t, ch, voucherLane, nonce, voucherAmount, fromKeyPrivate) _, err = mgr.AddVoucherInbound(ctx, ch, sv, nil, minDelta) - //stm: @TOKEN_PAYCH_VOUCHER_CREATE_006 // Should fail because there is no wallet key matching the channel To // address (ie, the channel is not "owned" by this node) require.Error(t, err) @@ -514,14 +503,12 @@ func TestAddVoucherInboundWalletKey(t *testing.T) { sv = createTestVoucher(t, ch, voucherLane, nonce, voucherAmount, fromKeyPrivate) _, err = mgr.AddVoucherInbound(ctx, ch, sv, nil, minDelta) - //stm: @TOKEN_PAYCH_VOUCHER_CREATE_001 // Should now pass because there is a wallet key matching the channel To // address require.NoError(t, err) } func TestBestSpendable(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_VOUCHERS_001 ctx := context.Background() // Set up a manager with a single payment channel @@ -564,7 +551,6 @@ func TestBestSpendable(t *testing.T) { }, }) - //stm: @TOKEN_PAYCH_BEST_SPENDABLE_001 // Verify best spendable vouchers on each lane vouchers, err := BestSpendableByLane(ctx, bsapi, s.ch) require.NoError(t, err) @@ -628,7 +614,6 @@ func TestCheckSpendable(t *testing.T) { } s.mock.setCallResponse(successResponse) - //stm: @TOKEN_PAYCH_CHECK_SPENDABLE_001 // Check that spendable is true secret := []byte("secret") spendable, err := s.mgr.CheckVoucherSpendable(ctx, s.ch, voucher, secret, nil) @@ -658,7 +643,6 @@ func TestCheckSpendable(t *testing.T) { require.NoError(t, err) require.True(t, spendable) - //stm: @TOKEN_PAYCH_CHECK_SPENDABLE_002 // Check that voucher is no longer spendable once it has been submitted _, err = s.mgr.SubmitVoucher(ctx, s.ch, voucher, nil, nil) require.NoError(t, err) @@ -707,7 +691,6 @@ func TestSubmitVoucher(t *testing.T) { err = p3.UnmarshalCBOR(bytes.NewReader(msg.Message.Params)) require.NoError(t, err) - //stm: @TOKEN_PAYCH_LIST_VOUCHERS_001 // Verify that vouchers are marked as submitted vis, err := s.mgr.ListVouchers(ctx, s.ch) require.NoError(t, err) diff --git a/paychmgr/paychget_test.go b/paychmgr/paychget_test.go index fca0022c6b4..f0039080f94 100644 --- a/paychmgr/paychget_test.go +++ b/paychmgr/paychget_test.go @@ -1,4 +1,3 @@ -// stm: #unit package paychmgr import ( @@ -60,7 +59,6 @@ func testChannelResponse(t *testing.T, ch address.Address) types.MessageReceipt // TestPaychGetCreateChannelMsg tests that GetPaych sends a message to create // a new channel with the correct funds func TestPaychGetCreateChannelMsg(t *testing.T) { - //stm: @TOKEN_PAYCH_CREATE_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -123,7 +121,6 @@ func TestPaychGetCreateOffchainReserveFails(t *testing.T) { // TestPaychGetCreateChannelThenAddFunds tests creating a channel and then // adding funds to it func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -298,7 +295,6 @@ func TestPaychGetCreatePrefundedChannelThenAddFunds(t *testing.T) { // operation is queued up behind a create channel operation, and the create // channel fails, then the waiting operation can succeed. func TestPaychGetCreateChannelWithErrorThenCreateAgain(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -363,7 +359,6 @@ func TestPaychGetCreateChannelWithErrorThenCreateAgain(t *testing.T) { // TestPaychGetRecoverAfterError tests that after a create channel fails, the // next attempt to create channel can succeed. func TestPaychGetRecoverAfterError(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -416,7 +411,6 @@ func TestPaychGetRecoverAfterError(t *testing.T) { // TestPaychGetRecoverAfterAddFundsError tests that after an add funds fails, the // next attempt to add funds can succeed. func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -507,7 +501,6 @@ func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { // right after the create channel message is sent, the channel will be // created when the system restarts. func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -598,7 +591,6 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { // right after the add funds message is sent, the add funds will be // processed when the system restarts. func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { - //stm: @TOKEN_PAYCH_LIST_CHANNELS_001, @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -672,7 +664,6 @@ func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { // TestPaychGetWait tests that GetPaychWaitReady correctly waits for the // channel to be created or funds to be added func TestPaychGetWait(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -738,7 +729,6 @@ func TestPaychGetWait(t *testing.T) { // TestPaychGetWaitErr tests that GetPaychWaitReady correctly handles errors func TestPaychGetWaitErr(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -786,7 +776,6 @@ func TestPaychGetWaitErr(t *testing.T) { // TestPaychGetWaitCtx tests that GetPaychWaitReady returns early if the context // is cancelled func TestPaychGetWaitCtx(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx, cancel := context.WithCancel(context.Background()) store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -816,7 +805,6 @@ func TestPaychGetWaitCtx(t *testing.T) { // progress and two add funds are queued up behind it, the two add funds // will be merged func TestPaychGetMergeAddFunds(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -1397,7 +1385,6 @@ func TestPaychGetMergePrefundAndReserveOneOffchainOneFail(t *testing.T) { // TestPaychGetMergeAddFundsCtxCancelOne tests that when a queued add funds // request is cancelled, its amount is removed from the total merged add funds func TestPaychGetMergeAddFundsCtxCancelOne(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -1503,7 +1490,6 @@ func TestPaychGetMergeAddFundsCtxCancelOne(t *testing.T) { // TestPaychGetMergeAddFundsCtxCancelAll tests that when all queued add funds // requests are cancelled, no add funds message is sent func TestPaychGetMergeAddFundsCtxCancelAll(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) @@ -1578,7 +1564,6 @@ func TestPaychGetMergeAddFundsCtxCancelAll(t *testing.T) { // TestPaychAvailableFunds tests that PaychAvailableFunds returns the correct // channel state func TestPaychAvailableFunds(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001, @TOKEN_PAYCH_AVAILABLE_FUNDS_001, @TOKEN_PAYCH_AVAILABLE_FUNDS_002, @TOKEN_PAYCH_AVAILABLE_FUNDS_003 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) diff --git a/paychmgr/paychvoucherfunds_test.go b/paychmgr/paychvoucherfunds_test.go index 9cff7fc9d55..027c4833ee9 100644 --- a/paychmgr/paychvoucherfunds_test.go +++ b/paychmgr/paychvoucherfunds_test.go @@ -24,7 +24,6 @@ import ( // insufficient funds, then adding funds to the channel, then adding the // voucher again func TestPaychAddVoucherAfterAddFunds(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) diff --git a/paychmgr/settle_test.go b/paychmgr/settle_test.go index db1d35da35a..58c7013ef41 100644 --- a/paychmgr/settle_test.go +++ b/paychmgr/settle_test.go @@ -1,4 +1,3 @@ -// stm: #unit package paychmgr import ( @@ -15,7 +14,6 @@ import ( ) func TestPaychSettle(t *testing.T) { - //stm: @TOKEN_PAYCH_WAIT_READY_001, @TOKEN_PAYCH_SETTLE_001, @TOKEN_PAYCH_LIST_CHANNELS_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) diff --git a/paychmgr/store_test.go b/paychmgr/store_test.go index f600b6537a9..e13c8087bf1 100644 --- a/paychmgr/store_test.go +++ b/paychmgr/store_test.go @@ -1,4 +1,3 @@ -// stm: #unit package paychmgr import ( @@ -14,8 +13,6 @@ import ( ) func TestStore(t *testing.T) { - //stm: @TOKEN_PAYCH_ALLOCATE_LANE_001, @TOKEN_PAYCH_LIST_CHANNELS_001 - //stm: @TOKEN_PAYCH_TRACK_CHANNEL_002, @TOKEN_PAYCH_TRACK_CHANNEL_001 ctx := context.Background() store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) diff --git a/storage/paths/remote_test.go b/storage/paths/remote_test.go index 7aea637296c..6caf5eb9e77 100644 --- a/storage/paths/remote_test.go +++ b/storage/paths/remote_test.go @@ -1,4 +1,3 @@ -// stm: #unit package paths_test import ( @@ -150,7 +149,6 @@ func TestMoveShared(t *testing.T) { } func TestReader(t *testing.T) { - //stm: @STORAGE_INFO_001 logging.SetAllLoggers(logging.LevelDebug) bz := []byte("Hello World") diff --git a/storage/pipeline/states_failed_test.go b/storage/pipeline/states_failed_test.go index bc658d59ba0..b2dd223c0a5 100644 --- a/storage/pipeline/states_failed_test.go +++ b/storage/pipeline/states_failed_test.go @@ -1,4 +1,3 @@ -// stm: #unit package sealing_test import ( @@ -50,7 +49,6 @@ func TestStateRecoverDealIDs(t *testing.T) { PieceCID: idCid("newPieceCID"), } - //stm: @CHAIN_STATE_MARKET_STORAGE_DEAL_001, @CHAIN_STATE_NETWORK_VERSION_001 api.EXPECT().StateMarketStorageDeal(ctx, dealId, nil).Return(&api2.MarketDeal{Proposal: dealProposal}, nil) pc := idCid("publishCID") diff --git a/storage/sealer/manager_test.go b/storage/sealer/manager_test.go index bd03cd09714..9301f61ac63 100644 --- a/storage/sealer/manager_test.go +++ b/storage/sealer/manager_test.go @@ -1,4 +1,3 @@ -// stm: #unit package sealer import ( @@ -530,7 +529,6 @@ func TestRedoPC1(t *testing.T) { // Manager restarts in the middle of a task, restarts it, it completes func TestRestartManager(t *testing.T) { - //stm: @WORKER_JOBS_001 test := func(returnBeforeCall bool) func(*testing.T) { return func(t *testing.T) { logging.SetAllLoggers(logging.LevelDebug) @@ -675,7 +673,6 @@ func TestRestartWorker(t *testing.T) { <-arch require.NoError(t, w.Close()) - //stm: @WORKER_STATS_001 for { if len(m.WorkerStats(ctx)) == 0 { break @@ -738,7 +735,6 @@ func TestReenableWorker(t *testing.T) { // disable atomic.StoreInt64(&w.testDisable, 1) - //stm: @WORKER_STATS_001 for i := 0; i < 100; i++ { if !m.WorkerStats(ctx)[w.session].Enabled { break diff --git a/storage/sealer/sched_test.go b/storage/sealer/sched_test.go index a991ff3fde2..fe0cdc89548 100644 --- a/storage/sealer/sched_test.go +++ b/storage/sealer/sched_test.go @@ -1,4 +1,3 @@ -// stm: #unit package sealer import ( @@ -237,7 +236,6 @@ func TestSchedStartStop(t *testing.T) { } func TestSched(t *testing.T) { - //stm: @WORKER_JOBS_001 storiface.ParallelNum = 1 storiface.ParallelDenom = 1 diff --git a/storage/wdpost/wdpost_changehandler_test.go b/storage/wdpost/wdpost_changehandler_test.go index c2d993bee9e..1f4c49b0f3f 100644 --- a/storage/wdpost/wdpost_changehandler_test.go +++ b/storage/wdpost/wdpost_changehandler_test.go @@ -1,4 +1,3 @@ -// stm: #unit package wdpost import ( @@ -200,10 +199,6 @@ func (m *mockAPI) setChangeHandler(ch *changeHandler) { // TestChangeHandlerBasic verifies we can generate a proof and submit it func TestChangeHandlerBasic(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_PROCESS_RESULTS_001 s := makeScaffolding(t) mock := s.mock @@ -252,10 +247,6 @@ func TestChangeHandlerBasic(t *testing.T) { // chain is already advanced past the confidence interval, we should move from // proving to submitting without a head change in between. func TestChangeHandlerFromProvingToSubmittingNoHeadChange(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_005 - //stm: @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -307,10 +298,6 @@ func TestChangeHandlerFromProvingToSubmittingNoHeadChange(t *testing.T) { // proofs generated we should not submit anything to chain but submit state // should move to completed func TestChangeHandlerFromProvingEmptyProofsToComplete(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_005, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_006 - //stm: @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -361,9 +348,6 @@ func TestChangeHandlerFromProvingEmptyProofsToComplete(t *testing.T) { // TestChangeHandlerDontStartUntilProvingPeriod tests that the handler // ignores updates until the proving period has been reached. func TestChangeHandlerDontStartUntilProvingPeriod(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004 s := makeScaffolding(t) mock := s.mock @@ -402,9 +386,6 @@ func TestChangeHandlerDontStartUntilProvingPeriod(t *testing.T) { // TestChangeHandlerStartProvingNextDeadline verifies that the proof handler // starts proving the next deadline after the current one func TestChangeHandlerStartProvingNextDeadline(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -454,10 +435,6 @@ func TestChangeHandlerStartProvingNextDeadline(t *testing.T) { // TestChangeHandlerProvingRounds verifies we can generate several rounds of // proofs as the chain head advances func TestChangeHandlerProvingRounds(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_002, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_003, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_005 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -528,9 +505,6 @@ func TestChangeHandlerProvingRounds(t *testing.T) { // TestChangeHandlerProvingErrorRecovery verifies that the proof handler // recovers correctly from an error func TestChangeHandlerProvingErrorRecovery(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -572,10 +546,6 @@ func TestChangeHandlerProvingErrorRecovery(t *testing.T) { // TestChangeHandlerSubmitErrorRecovery verifies that the submit handler // recovers correctly from an error func TestChangeHandlerSubmitErrorRecovery(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_PROCESS_RESULTS_001 s := makeScaffolding(t) mock := s.mock @@ -645,9 +615,6 @@ func TestChangeHandlerSubmitErrorRecovery(t *testing.T) { // TestChangeHandlerProveExpiry verifies that the prove handler // behaves correctly on expiry func TestChangeHandlerProveExpiry(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -686,9 +653,6 @@ func TestChangeHandlerProveExpiry(t *testing.T) { // TestChangeHandlerSubmitExpiry verifies that the submit handler // behaves correctly on expiry func TestChangeHandlerSubmitExpiry(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_002, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -752,9 +716,6 @@ func TestChangeHandlerSubmitExpiry(t *testing.T) { // TestChangeHandlerProveRevert verifies that the prove handler // behaves correctly on revert func TestChangeHandlerProveRevert(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 s := makeScaffolding(t) mock := s.mock @@ -791,10 +752,6 @@ func TestChangeHandlerProveRevert(t *testing.T) { // TestChangeHandlerSubmittingRevert verifies that the submit handler // behaves correctly when there's a revert from the submitting state func TestChangeHandlerSubmittingRevert(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_PROCESS_RESULTS_001 s := makeScaffolding(t) mock := s.mock @@ -866,10 +823,6 @@ func TestChangeHandlerSubmittingRevert(t *testing.T) { // TestChangeHandlerSubmitCompleteRevert verifies that the submit handler // behaves correctly when there's a revert from the submit complete state func TestChangeHandlerSubmitCompleteRevert(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_PROCESS_RESULTS_001 s := makeScaffolding(t) mock := s.mock @@ -931,10 +884,6 @@ func TestChangeHandlerSubmitCompleteRevert(t *testing.T) { // TestChangeHandlerSubmitRevertTwoEpochs verifies that the submit handler // behaves correctly when the revert is two epochs deep func TestChangeHandlerSubmitRevertTwoEpochs(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_002, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_PROCESS_RESULTS_001 s := makeScaffolding(t) mock := s.mock @@ -1036,10 +985,6 @@ func TestChangeHandlerSubmitRevertTwoEpochs(t *testing.T) { // behaves correctly when the revert is two epochs deep and the advance is // to a lower height than before func TestChangeHandlerSubmitRevertAdvanceLess(t *testing.T) { - //stm: @WDPOST_CHANGE_HANDLER_START_001, @WDPOST_CHANGE_HANDLER_UPDATE_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_001, @WDPOST_SUBMIT_HANDLER_PROCESS_HEAD_CHANGE_PW_001 - //stm: @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_004, @WDPOST_SUBMIT_HANDLER_SUBMIT_IF_READY_002, @WDPOST_PROVE_HANDLER_PROCESS_POST_RESULT_001 - //stm: @WDPOST_SUBMIT_HANDLER_PROCESS_PROCESS_RESULTS_001 s := makeScaffolding(t) mock := s.mock diff --git a/storage/wdpost/wdpost_nextdl_test.go b/storage/wdpost/wdpost_nextdl_test.go index ef140de3041..4f234b2f099 100644 --- a/storage/wdpost/wdpost_nextdl_test.go +++ b/storage/wdpost/wdpost_nextdl_test.go @@ -1,4 +1,3 @@ -// stm: #unit package wdpost import ( @@ -23,7 +22,6 @@ func TestNextDeadline(t *testing.T) { require.EqualValues(t, 60, di.Close) for i := 1; i < 1+int(minertypes.WPoStPeriodDeadlines)*2; i++ { - //stm: @WDPOST_NEXT_DEADLINE_001 di = NextDeadline(di) deadlineIdx = i % int(minertypes.WPoStPeriodDeadlines) expPeriodStart := int(minertypes.WPoStProvingPeriod) * (i / int(minertypes.WPoStPeriodDeadlines)) diff --git a/storage/wdpost/wdpost_run_test.go b/storage/wdpost/wdpost_run_test.go index f33db91af4e..e8f71446beb 100644 --- a/storage/wdpost/wdpost_run_test.go +++ b/storage/wdpost/wdpost_run_test.go @@ -1,4 +1,3 @@ -// stm: #unit package wdpost import ( @@ -202,10 +201,6 @@ func generatePartition(sectorCount uint64, recoverySectorCount uint64) api.Parti // TestWDPostDoPost verifies that doPost will send the correct number of window // PoST messages for a given number of partitions func TestWDPostDoPost(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() expectedMsgCount := 5 @@ -220,7 +215,6 @@ func TestWDPostDoPost(t *testing.T) { // Work out the number of partitions that can be included in a message // without exceeding the message sector limit - //stm: @BLOCKCHAIN_POLICY_GET_MAX_POST_PARTITIONS_001 partitionsPerMsg, err := policy.GetMaxPoStPartitions(network.Version13, proofType) require.NoError(t, err) if partitionsPerMsg > minertypes.AddressedPartitionsMax { @@ -294,10 +288,6 @@ func TestWDPostDoPost(t *testing.T) { // TestWDPostDoPostPartLimitConfig verifies that doPost will send the correct number of window // PoST messages for a given number of partitions based on user config func TestWDPostDoPostPartLimitConfig(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() expectedMsgCount := 8 @@ -312,7 +302,6 @@ func TestWDPostDoPostPartLimitConfig(t *testing.T) { // Work out the number of partitions that can be included in a message // without exceeding the message sector limit - //stm: @BLOCKCHAIN_POLICY_GET_MAX_POST_PARTITIONS_001 partitionsPerMsg, err := policy.GetMaxPoStPartitions(network.Version13, proofType) require.NoError(t, err) if partitionsPerMsg > minertypes.AddressedPartitionsMax { @@ -442,10 +431,6 @@ func TestBatchPartitionsRecoverySectors(t *testing.T) { // TestWDPostDeclareRecoveriesPartLimitConfig verifies that declareRecoveries will send the correct number of // DeclareFaultsRecovered messages for a given number of partitions based on user config func TestWDPostDeclareRecoveriesPartLimitConfig(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 ctx := context.Background() proofType := abi.RegisteredPoStProof_StackedDrgWindow2KiBV1 diff --git a/tools/stats/headbuffer/head_buffer_test.go b/tools/stats/headbuffer/head_buffer_test.go index f9c0385c027..fdf987a18dc 100644 --- a/tools/stats/headbuffer/head_buffer_test.go +++ b/tools/stats/headbuffer/head_buffer_test.go @@ -1,4 +1,3 @@ -// stm: #unit package headbuffer import ( @@ -10,7 +9,6 @@ import ( ) func TestHeadBuffer(t *testing.T) { - //stm: @TOOLS_HEAD_BUFFER_PUSH_001, @TOOLS_HEAD_BUFFER_POP_001 t.Run("Straight Push through", func(t *testing.T) { hb := NewHeadChangeStackBuffer(5) require.Nil(t, hb.Push(&api.HeadChange{Type: "1"}))