Skip to content

Commit

Permalink
Ignore lint for deprectaed types
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Nov 8, 2023
1 parent 8da6cd1 commit badd090
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
24 changes: 12 additions & 12 deletions migrations/account_type/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,33 +285,33 @@ func (m *AccountTypeMigration) maybeConvertAccountType(staticType interpreter.St
default:
// Is it safe to do so?
switch staticType {
case interpreter.PrimitiveStaticTypePublicAccount:
case interpreter.PrimitiveStaticTypePublicAccount: //nolint:staticcheck
return unauthorizedAccountReferenceType
case interpreter.PrimitiveStaticTypeAuthAccount:
case interpreter.PrimitiveStaticTypeAuthAccount: //nolint:staticcheck
return authAccountReferenceType

case interpreter.PrimitiveStaticTypeAuthAccountCapabilities,
interpreter.PrimitiveStaticTypePublicAccountCapabilities:
case interpreter.PrimitiveStaticTypeAuthAccountCapabilities, //nolint:staticcheck
interpreter.PrimitiveStaticTypePublicAccountCapabilities: //nolint:staticcheck
return interpreter.PrimitiveStaticTypeAccount_Capabilities

case interpreter.PrimitiveStaticTypeAuthAccountAccountCapabilities:
case interpreter.PrimitiveStaticTypeAuthAccountAccountCapabilities: //nolint:staticcheck
return interpreter.PrimitiveStaticTypeAccount_AccountCapabilities

case interpreter.PrimitiveStaticTypeAuthAccountStorageCapabilities:
case interpreter.PrimitiveStaticTypeAuthAccountStorageCapabilities: //nolint:staticcheck
return interpreter.PrimitiveStaticTypeAccount_StorageCapabilities

case interpreter.PrimitiveStaticTypeAuthAccountContracts,
interpreter.PrimitiveStaticTypePublicAccountContracts:
case interpreter.PrimitiveStaticTypeAuthAccountContracts, //nolint:staticcheck
interpreter.PrimitiveStaticTypePublicAccountContracts: //nolint:staticcheck
return interpreter.PrimitiveStaticTypeAccount_Contracts

case interpreter.PrimitiveStaticTypeAuthAccountKeys,
interpreter.PrimitiveStaticTypePublicAccountKeys:
case interpreter.PrimitiveStaticTypeAuthAccountKeys, //nolint:staticcheck
interpreter.PrimitiveStaticTypePublicAccountKeys: //nolint:staticcheck
return interpreter.PrimitiveStaticTypeAccount_Keys

case interpreter.PrimitiveStaticTypeAuthAccountInbox:
case interpreter.PrimitiveStaticTypeAuthAccountInbox: //nolint:staticcheck
return interpreter.PrimitiveStaticTypeAccount_Inbox

case interpreter.PrimitiveStaticTypeAccountKey:
case interpreter.PrimitiveStaticTypeAccountKey: //nolint:staticcheck
return interpreter.AccountKeyStaticType
}
}
Expand Down
30 changes: 15 additions & 15 deletions migrations/account_type/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ func TestMigration(t *testing.T) {
account := common.Address{0x42}
pathDomain := common.PathDomainPublic

const publicAccountType = interpreter.PrimitiveStaticTypePublicAccount
const authAccountType = interpreter.PrimitiveStaticTypeAuthAccount
const publicAccountType = interpreter.PrimitiveStaticTypePublicAccount //nolint:staticcheck
const authAccountType = interpreter.PrimitiveStaticTypeAuthAccount //nolint:staticcheck
const stringType = interpreter.PrimitiveStaticTypeString

type testCase struct {
Expand All @@ -91,43 +91,43 @@ func TestMigration(t *testing.T) {
expectedType: authAccountReferenceType,
},
"auth_account_capabilities": {
storedType: interpreter.PrimitiveStaticTypeAuthAccountCapabilities,
storedType: interpreter.PrimitiveStaticTypeAuthAccountCapabilities, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Capabilities,
},
"public_account_capabilities": {
storedType: interpreter.PrimitiveStaticTypePublicAccountCapabilities,
storedType: interpreter.PrimitiveStaticTypePublicAccountCapabilities, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Capabilities,
},
"auth_account_account_capabilities": {
storedType: interpreter.PrimitiveStaticTypeAuthAccountAccountCapabilities,
storedType: interpreter.PrimitiveStaticTypeAuthAccountAccountCapabilities, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_AccountCapabilities,
},
"auth_account_storage_capabilities": {
storedType: interpreter.PrimitiveStaticTypeAuthAccountStorageCapabilities,
storedType: interpreter.PrimitiveStaticTypeAuthAccountStorageCapabilities, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_StorageCapabilities,
},
"auth_account_contracts": {
storedType: interpreter.PrimitiveStaticTypeAuthAccountContracts,
storedType: interpreter.PrimitiveStaticTypeAuthAccountContracts, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Contracts,
},
"public_account_contracts": {
storedType: interpreter.PrimitiveStaticTypePublicAccountContracts,
storedType: interpreter.PrimitiveStaticTypePublicAccountContracts, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Contracts,
},
"auth_account_keys": {
storedType: interpreter.PrimitiveStaticTypeAuthAccountKeys,
storedType: interpreter.PrimitiveStaticTypeAuthAccountKeys, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Keys,
},
"public_account_keys": {
storedType: interpreter.PrimitiveStaticTypePublicAccountKeys,
storedType: interpreter.PrimitiveStaticTypePublicAccountKeys, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Keys,
},
"auth_account_inbox": {
storedType: interpreter.PrimitiveStaticTypeAuthAccountInbox,
storedType: interpreter.PrimitiveStaticTypeAuthAccountInbox, //nolint:staticcheck
expectedType: interpreter.PrimitiveStaticTypeAccount_Inbox,
},
"account_key": {
storedType: interpreter.PrimitiveStaticTypeAccountKey,
storedType: interpreter.PrimitiveStaticTypeAccountKey, //nolint:staticcheck
expectedType: interpreter.AccountKeyStaticType,
},
"optional_account": {
Expand Down Expand Up @@ -426,7 +426,7 @@ func TestNestedTypeValueMigration(t *testing.T) {
expectedValue interpreter.Value
}

storedAccountTypeValue := interpreter.NewTypeValue(nil, interpreter.PrimitiveStaticTypePublicAccount)
storedAccountTypeValue := interpreter.NewTypeValue(nil, interpreter.PrimitiveStaticTypePublicAccount) //nolint:staticcheck
expectedAccountTypeValue := interpreter.NewTypeValue(nil, unauthorizedAccountReferenceType)
stringTypeValue := interpreter.NewTypeValue(nil, interpreter.PrimitiveStaticTypeString)

Expand Down Expand Up @@ -547,7 +547,7 @@ func TestNestedTypeValueMigration(t *testing.T) {
interpreter.NewTypeValue(
nil,
dummyStaticType{
PrimitiveStaticType: interpreter.PrimitiveStaticTypePublicAccount,
PrimitiveStaticType: interpreter.PrimitiveStaticTypePublicAccount, //nolint:staticcheck
},
),
interpreter.NewUnmeteredInt8Value(4),
Expand Down Expand Up @@ -576,7 +576,7 @@ func TestNestedTypeValueMigration(t *testing.T) {
interpreter.NewTypeValue(
nil,
dummyStaticType{
PrimitiveStaticType: interpreter.PrimitiveStaticTypePublicAccount,
PrimitiveStaticType: interpreter.PrimitiveStaticTypePublicAccount, //nolint:staticcheck
},
),
storedAccountTypeValue,
Expand Down

0 comments on commit badd090

Please sign in to comment.