Skip to content

Commit

Permalink
Merge branch 'main' into nullpointer0x00/1328-migrate-msgfees-gov-pro…
Browse files Browse the repository at this point in the history
…ps-v1
  • Loading branch information
nullpointer0x00 committed Aug 11, 2023
2 parents 392421d + 294259a commit 17b5316
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 86 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* Fix ibcnet relayer creating multiple connections on restart [#1620](https://github.com/provenance-io/provenance/issues/1620).
* Fix for incorrect resource-id type casting on contract specification [#1647](https://github.com/provenance-io/provenance/issues/1647).

---

Expand Down
5 changes: 4 additions & 1 deletion proto/provenance/metadata/v1/specification.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ message ContractSpecification {
// contract
oneof source {
// the address of a record on chain that represents this contract
bytes resource_id = 5 [(gogoproto.customtype) = "MetadataAddress", (gogoproto.moretags) = "yaml:\"resource_id\""];
bytes resource_id = 5 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"resource_id\""
];
// the hash of contract binary (off-chain instance)
string hash = 6;
}
Expand Down
4 changes: 2 additions & 2 deletions x/metadata/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ icon-url - address to a image to be used as an icon (optional, can onl
ClassName: args[4],
}
sourceValue := args[3]
var recordID types.MetadataAddress
recordID, err = types.MetadataAddressFromBech32(sourceValue)
var recordID sdk.AccAddress
recordID, err = sdk.AccAddressFromBech32(sourceValue)
if err != nil {
contractSpecification.Source = &types.ContractSpecification_Hash{
Hash: sourceValue,
Expand Down
2 changes: 1 addition & 1 deletion x/metadata/types/specification.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func NewContractSpecification(
}

// NewContractSpecificationSourceResourceID creates a new source (for a ContractSpecification) with a resource id
func NewContractSpecificationSourceResourceID(resourceID MetadataAddress) *ContractSpecification_ResourceId {
func NewContractSpecificationSourceResourceID(resourceID sdk.AccAddress) *ContractSpecification_ResourceId {
return &ContractSpecification_ResourceId{ResourceId: resourceID}
}

Expand Down
167 changes: 86 additions & 81 deletions x/metadata/types/specification.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/metadata/types/specification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (s *SpecificationTestSuite) TestContractSpecValidateBasic() {
nil,
[]string{specTestBech32},
[]PartyType{PartyType_PARTY_TYPE_OWNER},
NewContractSpecificationSourceResourceID(MetadataAddress(specTestAddr)),
NewContractSpecificationSourceResourceID(specTestAddr),
"someclass",
),
fmt.Sprintf("invalid source resource id: %s", "invalid metadata address type: 133"),
Expand Down

0 comments on commit 17b5316

Please sign in to comment.