Skip to content

Commit c271a58

Browse files
Merge #4150 #4160
4150: Remove delta view usage in fvm/ tests r=pattyshack a=pattyshack 4160: Remove bad test r=pattyshack a=pattyshack This test does not actually test the computer. The account status was populate into the view during account creation, before the block is executed. Co-authored-by: Patrick Lee <[email protected]>
3 parents 7aae6a2 + 35a4b4b + 67e39d2 commit c271a58

File tree

6 files changed

+491
-438
lines changed

6 files changed

+491
-438
lines changed

engine/execution/computation/computer/computer_test.go

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
reusableRuntime "github.com/onflow/flow-go/fvm/runtime"
3737
"github.com/onflow/flow-go/fvm/state"
3838
"github.com/onflow/flow-go/fvm/storage"
39-
"github.com/onflow/flow-go/fvm/storage/testutils"
4039
"github.com/onflow/flow-go/fvm/systemcontracts"
4140
"github.com/onflow/flow-go/ledger"
4241
"github.com/onflow/flow-go/model/flow"
@@ -993,75 +992,6 @@ func (f *FixedAddressGenerator) AddressCount() uint64 {
993992
panic("not implemented")
994993
}
995994

996-
func Test_AccountStatusRegistersAreIncluded(t *testing.T) {
997-
998-
address := flow.HexToAddress("1234")
999-
fag := &FixedAddressGenerator{Address: address}
1000-
1001-
vm := fvm.NewVirtualMachine()
1002-
execCtx := fvm.NewContext()
1003-
1004-
ledger := testutil.RootBootstrappedLedger(vm, execCtx)
1005-
1006-
key, err := unittest.AccountKeyDefaultFixture()
1007-
require.NoError(t, err)
1008-
1009-
view := delta.NewDeltaView(ledger)
1010-
accounts := environment.NewAccounts(testutils.NewSimpleTransaction(view))
1011-
1012-
err = accounts.Create([]flow.AccountPublicKey{key.PublicKey(1000)}, address)
1013-
require.NoError(t, err)
1014-
1015-
bservice := requesterunit.MockBlobService(blockstore.NewBlockstore(dssync.MutexWrap(datastore.NewMapDatastore())))
1016-
trackerStorage := mocktracker.NewMockStorage()
1017-
1018-
prov := provider.NewProvider(
1019-
zerolog.Nop(),
1020-
metrics.NewNoopCollector(),
1021-
execution_data.DefaultSerializer,
1022-
bservice,
1023-
trackerStorage,
1024-
)
1025-
1026-
me := new(modulemock.Local)
1027-
me.On("NodeID").Return(unittest.IdentifierFixture())
1028-
me.On("Sign", mock.Anything, mock.Anything).Return(nil, nil)
1029-
me.On("SignFunc", mock.Anything, mock.Anything, mock.Anything).
1030-
Return(nil, nil)
1031-
1032-
exe, err := computer.NewBlockComputer(
1033-
vm,
1034-
execCtx,
1035-
metrics.NewNoopCollector(),
1036-
trace.NewNoopTracer(),
1037-
zerolog.Nop(),
1038-
committer.NewNoopViewCommitter(),
1039-
me,
1040-
prov,
1041-
nil)
1042-
require.NoError(t, err)
1043-
1044-
block := generateBlockWithVisitor(1, 1, fag, func(txBody *flow.TransactionBody) {
1045-
err := testutil.SignTransaction(txBody, txBody.Payer, *key, 0)
1046-
require.NoError(t, err)
1047-
})
1048-
1049-
_, err = exe.ExecuteBlock(
1050-
context.Background(),
1051-
unittest.IdentifierFixture(),
1052-
block,
1053-
view,
1054-
derived.NewEmptyDerivedBlockData())
1055-
assert.NoError(t, err)
1056-
1057-
registerTouches := view.Interactions().RegisterTouches()
1058-
1059-
// make sure check for account status has been registered
1060-
id := flow.AccountStatusRegisterID(address)
1061-
1062-
require.Contains(t, registerTouches, id)
1063-
}
1064-
1065995
func Test_ExecutingSystemCollection(t *testing.T) {
1066996

1067997
execCtx := fvm.NewContext(

0 commit comments

Comments
 (0)