Skip to content

Commit

Permalink
add to EnableAllProposals
Browse files Browse the repository at this point in the history
  • Loading branch information
jhernandezb committed May 5, 2022
1 parent 9edcfef commit 327eab6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x/wasm/types/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var EnableAllProposals = []ProposalType{
ProposalTypeClearAdmin,
ProposalTypePinCodes,
ProposalTypeUnpinCodes,
ProposalTypeUpdateInstantiateConfig,
}

// ConvertToProposals maps each key to a ProposalType and returns a typed list.
Expand Down Expand Up @@ -571,10 +572,16 @@ func (p UpdateInstantiateConfigProposal) ValidateBasic() error {
if len(p.CodeUpdates) == 0 {
return sdkerrors.Wrap(ErrEmpty, "code updates")
}
dedup := make(map[uint64]bool)
for _, codeUpdate := range p.CodeUpdates {
_, found := dedup[codeUpdate.CodeID]
if found {
return sdkerrors.Wrapf(ErrDuplicate, "duplicate code: %d", codeUpdate.CodeID)
}
if err := codeUpdate.InstantiatePermission.ValidateBasic(); err != nil {
return sdkerrors.Wrap(err, "instantiate permission")
}
dedup[codeUpdate.CodeID] = true
}
return nil
}
Expand Down

0 comments on commit 327eab6

Please sign in to comment.