Register ApplicationArtifact proto.
Some checks failed
CodeQL / Analyze (go) (pull_request) Failing after 1m6s
Pull Request Labeler / triage (pull_request) Successful in 5s
Dependency Review / dependency-review (pull_request) Failing after 1m9s
Deploy Contract / deploy (pull_request) Failing after 1m2s
Build / build (pull_request) Failing after 1m26s
Run Gosec / Gosec (pull_request) Failing after 20s
Semgrep / Scan (pull_request) Failing after 18s
Tests / cleanup-runs (pull_request) Successful in 6s
Lint / Run flake8 on python integration tests (pull_request) Failing after 33s
Lint / Run golangci-lint (pull_request) Failing after 38s
Tests / test-rpc (pull_request) Failing after 50s
Tests / test-importer (pull_request) Failing after 1m27s
Tests / test-unit-cover (pull_request) Failing after 1m29s
Tests / sdk_tests (pull_request) Failing after 2m39s
Build / cleanup-runs (pull_request) Successful in 6s
Deploy Contract / cleanup-runs (pull_request) Successful in 6s

This commit is contained in:
Thomas E Lackey 2023-12-13 20:53:10 -06:00
parent c407145c31
commit ea09d72b5b
3 changed files with 29 additions and 1 deletions

View File

@ -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 {

View File

@ -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),

View File

@ -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")