diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 7e257abf..e252e0ec 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -345,7 +345,7 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro } } case "WebsiteRegistrationRecord", "ApplicationRecord", "ApplicationDeploymentRequest", - "ApplicationDeploymentRecord", "DnsRecord", "GeneralRecord": + "ApplicationDeploymentRecord", "ApplicationArtifact", "DnsRecord", "GeneralRecord": { // #nosec G705 for key := range record.Attributes { diff --git a/x/registry/types/codec.go b/x/registry/types/codec.go index ef26a4c5..7be73eb2 100644 --- a/x/registry/types/codec.go +++ b/x/registry/types/codec.go @@ -69,6 +69,12 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &ApplicationDeploymentRecord{}, ) + registry.RegisterInterface( + "vulcanize.registry.v1beta1.ApplicationArtifact", + (*Attributes)(nil), + &ApplicationArtifact{}, + ) + registry.RegisterInterface( "vulcanize.registry.v1beta1.DnsRecord", (*Attributes)(nil), diff --git a/x/registry/types/types.go b/x/registry/types/types.go index dd062e0b..e69f108f 100644 --- a/x/registry/types/types.go +++ b/x/registry/types/types.go @@ -95,6 +95,15 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e } return codectypes.NewAnyWithValue(&attributes) } + case "ApplicationArtifact": + { + var attributes ApplicationArtifact + err := json.Unmarshal(bz, &attributes) + if err != nil { + return &codectypes.Any{}, err + } + return codectypes.NewAnyWithValue(&attributes) + } case "DnsRecord": { var attributes DnsRecord @@ -219,6 +228,19 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) { panic("Proto unmarshal error") } + bz, err = json.Marshal(attributes) + if err != nil { + panic("JSON marshal error") + } + } + case "ApplicationArtifact": + { + var attributes ApplicationArtifact + err := proto.Unmarshal(any.Value, &attributes) + if err != nil { + panic("Proto unmarshal error") + } + bz, err = json.Marshal(attributes) if err != nil { panic("JSON marshal error")