Skip to content

Commit

Permalink
roles are not stored in transaction type anymore, iterate over members
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Jan 30, 2023
1 parent 27de6f2 commit 7d32929
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 9 additions & 2 deletions runtime/sema/check_transaction_declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,15 @@ func (checker *Checker) VisitTransactionDeclaration(declaration *ast.Transaction

checker.checkResourceFieldsInvalidated(transactionType, members)

transactionType.Roles.Foreach(func(_ string, roleTye *TransactionRoleType) {
checker.checkResourceFieldsInvalidated(roleTye, roleTye.Members)
transactionType.Members.Foreach(func(_ string, member *Member) {
transactionRoleType, ok := member.TypeAnnotation.Type.(*TransactionRoleType)
if !ok {
return
}
checker.checkResourceFieldsInvalidated(
transactionRoleType,
transactionRoleType.Members,
)
})

return
Expand Down
2 changes: 0 additions & 2 deletions runtime/sema/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/onflow/cadence/fixedpoint"
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/common/orderedmap"
"github.com/onflow/cadence/runtime/errors"
)

Expand Down Expand Up @@ -5649,7 +5648,6 @@ func IsNilType(ty Type) bool {

type TransactionType struct {
Members *StringMemberOrderedMap
Roles *orderedmap.OrderedMap[string, *TransactionRoleType]
Fields []string
PrepareParameters []Parameter
Parameters []Parameter
Expand Down

0 comments on commit 7d32929

Please sign in to comment.