feat: remaining record content types to support #79
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
record:
|
record:
|
||||||
type: ServiceProviderRegistration
|
type: ServiceProviderRecord
|
||||||
bond_id: madeUpBondID
|
bond_id: madeUpBondID
|
||||||
laconic_id: madeUpLaconicID
|
laconic_id: madeUpLaconicID
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
record:
|
record:
|
||||||
type: ServiceProviderRegistration
|
type: ServiceProviderRecord
|
||||||
bond_id: madeUpBondID
|
bond_id: madeUpBondID
|
||||||
laconic_id: madeUpLaconicID
|
laconic_id: madeUpLaconicID
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
@ -87,7 +87,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
1,
|
1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Filter with attributes ServiceProviderRegistration",
|
"Filter with attributes ServiceProviderRecord",
|
||||||
®istrytypes.QueryListRecordsRequest{
|
®istrytypes.QueryListRecordsRequest{
|
||||||
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
Attributes: []*registrytypes.QueryListRecordsRequest_KeyValueInput{
|
||||||
{
|
{
|
||||||
|
@ -317,7 +317,7 @@ func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) {
|
|||||||
|
|
||||||
func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) error {
|
func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) error {
|
||||||
switch record.Attributes["type"] {
|
switch record.Attributes["type"] {
|
||||||
case "ServiceProviderRegistration":
|
case "ServiceProviderRecord":
|
||||||
{
|
{
|
||||||
// #nosec G705
|
// #nosec G705
|
||||||
for key := range record.Attributes {
|
for key := range record.Attributes {
|
||||||
|
@ -40,9 +40,9 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
"vulcanize.registry.v1beta1.ServiceProvideRegistration",
|
"vulcanize.registry.v1beta1.ServiceProviderRecord",
|
||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&ServiceProviderRegistration{},
|
&ServiceProviderRecord{},
|
||||||
)
|
)
|
||||||
|
|
||||||
registry.RegisterInterface(
|
registry.RegisterInterface(
|
||||||
@ -50,6 +50,48 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|||||||
(*Attributes)(nil),
|
(*Attributes)(nil),
|
||||||
&WebsiteRegistrationRecord{},
|
&WebsiteRegistrationRecord{},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.GitRepository",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&GitRepository{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.Binary",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&Binary{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.DockerImage",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&DockerImage{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.WatcherRegistrationRecord",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&WatcherRegistrationRecord{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.ResponderContract",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&ResponderContract{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.JSPackage",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&JSPackage{},
|
||||||
|
)
|
||||||
|
|
||||||
|
registry.RegisterInterface(
|
||||||
|
"vulcanize.registry.v1beta1.ChainRegistrationRecord",
|
||||||
|
(*Attributes)(nil),
|
||||||
|
&ChainRegistrationRecord{},
|
||||||
|
)
|
||||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,9 +50,9 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
|
|||||||
bz := helpers.MarshalMapToJSONBytes(recordPayLoad)
|
bz := helpers.MarshalMapToJSONBytes(recordPayLoad)
|
||||||
|
|
||||||
switch recordType.(string) {
|
switch recordType.(string) {
|
||||||
case "ServiceProviderRegistration":
|
case "ServiceProviderRecord":
|
||||||
{
|
{
|
||||||
var attributes ServiceProviderRegistration
|
var attributes ServiceProviderRecord
|
||||||
err := json.Unmarshal(bz, &attributes)
|
err := json.Unmarshal(bz, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &codectypes.Any{}, err
|
return &codectypes.Any{}, err
|
||||||
@ -114,9 +114,9 @@ func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) {
|
|||||||
var bz []byte
|
var bz []byte
|
||||||
s := strings.Split(any.TypeUrl, ".")
|
s := strings.Split(any.TypeUrl, ".")
|
||||||
switch s[len(s)-1] {
|
switch s[len(s)-1] {
|
||||||
case "ServiceProviderRegistration":
|
case "ServiceProviderRecord":
|
||||||
{
|
{
|
||||||
var attributes ServiceProviderRegistration
|
var attributes ServiceProviderRecord
|
||||||
err := proto.Unmarshal(any.Value, &attributes)
|
err := proto.Unmarshal(any.Value, &attributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Proto unmarshal error")
|
panic("Proto unmarshal error")
|
||||||
|
Loading…
Reference in New Issue
Block a user