diff --git a/cmd/util/ledger/migrations/staged_contracts_migration_test.go b/cmd/util/ledger/migrations/staged_contracts_migration_test.go index 66f1d84528a..c8ec47f3e93 100644 --- a/cmd/util/ledger/migrations/staged_contracts_migration_test.go +++ b/cmd/util/ledger/migrations/staged_contracts_migration_test.go @@ -573,7 +573,7 @@ func TestStagedContractsFromCSV(t *testing.T) { contracts, err := StagedContractsFromCSV(path) require.NoError(t, err) - require.Len(t, contracts, 3) + require.Len(t, contracts, 4) assert.Equal( t, contracts, @@ -592,6 +592,22 @@ func TestStagedContractsFromCSV(t *testing.T) { Code: []byte("access(all) contract Bar{}"), }, }, + { + Address: common.MustBytesToAddress([]byte{0x2}), + Contract: Contract{ + Name: "MultilineContract", + Code: []byte(` +import Foo from 0x01 + +access(all) +contract MultilineContract{ + init() { + var a = "hello" + } +} +`), + }, + }, { Address: common.MustBytesToAddress([]byte{0x2}), Contract: Contract{ diff --git a/cmd/util/ledger/migrations/test-data/staged_contracts_migration/staged_contracts.csv b/cmd/util/ledger/migrations/test-data/staged_contracts_migration/staged_contracts.csv index 152c806b8b1..a12235342e3 100644 --- a/cmd/util/ledger/migrations/test-data/staged_contracts_migration/staged_contracts.csv +++ b/cmd/util/ledger/migrations/test-data/staged_contracts_migration/staged_contracts.csv @@ -1,3 +1,13 @@ 0x0000000000000001,Foo,access(all) contract Foo{} 0x0000000000000001,Bar,access(all) contract Bar{} +0x0000000000000002,MultilineContract," +import Foo from 0x01 + +access(all) +contract MultilineContract{ + init() { + var a = ""hello"" + } +} +" 0x0000000000000002,Baz,import Foo from 0x01 access(all) contract Baz{}