Register ApplicationArtifact proto. (#126)
Some checks failed
Pull Request Labeler / triage (push) Successful in 18s
CodeQL / Analyze (go) (push) Failing after 1m14s
Lint / Run flake8 on python integration tests (push) Failing after 33s
Tests / cleanup-runs (push) Has been skipped
Run Gosec / Gosec (push) Failing after 32s
Tests / test-rpc (push) Failing after 4m56s
Tests / sdk_tests (push) Failing after 2m19s
Tests / test-unit-cover (push) Failing after 7m49s
Tests / test-importer (push) Successful in 11m14s
Lint / Run golangci-lint (push) Successful in 13m18s
Some checks failed
Pull Request Labeler / triage (push) Successful in 18s
CodeQL / Analyze (go) (push) Failing after 1m14s
Lint / Run flake8 on python integration tests (push) Failing after 33s
Tests / cleanup-runs (push) Has been skipped
Run Gosec / Gosec (push) Failing after 32s
Tests / test-rpc (push) Failing after 4m56s
Tests / sdk_tests (push) Failing after 2m19s
Tests / test-unit-cover (push) Failing after 7m49s
Tests / test-importer (push) Successful in 11m14s
Lint / Run golangci-lint (push) Successful in 13m18s
Register the new ApplicationArtifact type. Reviewed-on: cerc-io/laconicd#126 Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com> Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
This commit is contained in:
parent
c407145c31
commit
588c52c0b2
@ -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 {
|
||||
|
@ -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),
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user