Add ApplicationDeploymentRemovalRequests
Some checks failed
Build / build (pull_request) Failing after 1m17s
Protobuf / lint (pull_request) Successful in 14s
Run Gosec / Gosec (pull_request) Failing after 31s
Semgrep / Scan (pull_request) Failing after 21s
Tests / test-rpc (pull_request) Failing after 1m25s
Build / cleanup-runs (pull_request) Failing after 2s
CodeQL / Analyze (go) (pull_request) Failing after 1m45s
Dependency Review / dependency-review (pull_request) Failing after 1m48s
Deploy Contract / cleanup-runs (pull_request) Successful in 36s
Pull Request Labeler / triage (pull_request) Failing after 15s
Deploy Contract / deploy (pull_request) Failing after 19s
Lint / Run flake8 on python integration tests (pull_request) Failing after 29s
Protobuf / break-check (pull_request) Successful in 18s
Tests / cleanup-runs (pull_request) Failing after 3s
Lint / Run golangci-lint (pull_request) Failing after 1m21s
Tests / test-unit-cover (pull_request) Failing after 43s
Tests / test-importer (pull_request) Failing after 41s
Tests / sdk_tests (pull_request) Failing after 2m0s

This commit is contained in:
Thomas E Lackey 2023-12-21 13:03:08 -06:00
parent ae07fc0147
commit 8f1dbecc4e
5 changed files with 1030 additions and 86 deletions

View File

@ -101,6 +101,24 @@ message ApplicationDeploymentRecord {
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message ApplicationDeploymentRemovalRequest {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string version = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string deployment = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
string request = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message ApplicationDeploymentRemovalRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string version = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string deployment = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
string request = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message GeneralRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];

View File

@ -346,7 +346,8 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
}
}
case "WebsiteRegistrationRecord", "ApplicationRecord", "ApplicationDeploymentRequest",
"ApplicationDeploymentRecord", "ApplicationArtifact", "DnsRecord", "GeneralRecord":
"ApplicationDeploymentRecord", "ApplicationArtifact", "ApplicationDeploymentRemovalRequest",
"ApplicationDeploymentRemovalRecord", "DnsRecord", "GeneralRecord":
{
// #nosec G705
for key := range record.Attributes {

File diff suppressed because it is too large Load Diff

View File

@ -75,6 +75,18 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&ApplicationArtifact{},
)
registry.RegisterInterface(
"vulcanize.registry.v1beta1.ApplicationDeploymentRemovalRequest",
(*Attributes)(nil),
&ApplicationDeploymentRemovalRequest{},
)
registry.RegisterInterface(
"vulcanize.registry.v1beta1.ApplicationDeploymentRemovalRecord",
(*Attributes)(nil),
&ApplicationDeploymentRemovalRecord{},
)
registry.RegisterInterface(
"vulcanize.registry.v1beta1.DnsRecord",
(*Attributes)(nil),

View File

@ -95,6 +95,24 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
}
return codectypes.NewAnyWithValue(&attributes)
}
case "ApplicationDeploymentRemovalRequest":
{
var attributes ApplicationDeploymentRemovalRequest
err := json.Unmarshal(bz, &attributes)
if err != nil {
return &codectypes.Any{}, err
}
return codectypes.NewAnyWithValue(&attributes)
}
case "ApplicationDeploymentRemovalRecord":
{
var attributes ApplicationDeploymentRemovalRecord
err := json.Unmarshal(bz, &attributes)
if err != nil {
return &codectypes.Any{}, err
}
return codectypes.NewAnyWithValue(&attributes)
}
case "ApplicationArtifact":
{
var attributes ApplicationArtifact
@ -228,6 +246,32 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
panic("Proto unmarshal error")
}
bz, err = json.Marshal(attributes)
if err != nil {
panic("JSON marshal error")
}
}
case "ApplicationDeploymentRemovalRequest":
{
var attributes ApplicationDeploymentRemovalRequest
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")
}
}
case "ApplicationDeploymentRemovalRecord":
{
var attributes ApplicationDeploymentRemovalRecord
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")