Skip to content

Commit

Permalink
add test case for AuthAccount reference type migration
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Mar 28, 2024
1 parent 468b11b commit 6fd3ddb
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions migrations/statictypes/statictype_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,41 @@ func TestStaticTypeMigration(t *testing.T) {
)
})

t.Run("TypeValue with reference to AuthAccount", func(t *testing.T) {
t.Parallel()

staticTypeMigration := NewStaticTypeMigration()

actual := migrate(t,
staticTypeMigration,
interpreter.NewUnmeteredTypeValue(
interpreter.NewDictionaryStaticType(nil,
interpreter.PrimitiveStaticTypeAddress,
interpreter.NewCapabilityStaticType(nil,
interpreter.NewReferenceStaticType(
nil,
interpreter.UnauthorizedAccess,
interpreter.PrimitiveStaticTypeAuthAccount,

Check failure on line 167 in migrations/statictypes/statictype_migration_test.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: interpreter.PrimitiveStaticTypeAuthAccount is deprecated: PrimitiveStaticTypeAuthAccount only exists for migration purposes. (staticcheck)

Check failure on line 167 in migrations/statictypes/statictype_migration_test.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: interpreter.PrimitiveStaticTypeAuthAccount is deprecated: PrimitiveStaticTypeAuthAccount only exists for migration purposes. (staticcheck)
),
),
),
),
true,
)
assert.Equal(t,
interpreter.NewUnmeteredTypeValue(
interpreter.NewDictionaryStaticType(nil,
interpreter.PrimitiveStaticTypeAddress,
interpreter.NewCapabilityStaticType(nil,
// NOTE: NOT reference to reference type
authAccountReferenceType,
),
),
),
actual,
)
})

t.Run("PathCapabilityValue with nil borrow type", func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 6fd3ddb

Please sign in to comment.