forked from cerc-io/laconicd-deprecated
payload to record attributes
This commit is contained in:
parent
67208b08af
commit
bf1670be78
@ -6,4 +6,4 @@ record:
|
|||||||
repo_hash_reference:
|
repo_hash_reference:
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
type: binary
|
type: Binary
|
@ -6,4 +6,4 @@ record:
|
|||||||
repo_hash_reference:
|
repo_hash_reference:
|
||||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
type: binary
|
type: Binary
|
@ -68,6 +68,69 @@ func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, e
|
|||||||
}
|
}
|
||||||
return codectypes.NewAnyWithValue(&attributes)
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
}
|
}
|
||||||
|
case "GitRepository":
|
||||||
|
{
|
||||||
|
var attributes GitRepository
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "Binary":
|
||||||
|
{
|
||||||
|
var attributes Binary
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "DockerImage":
|
||||||
|
{
|
||||||
|
var attributes DockerImage
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "WatcherRegistrationRecord":
|
||||||
|
{
|
||||||
|
var attributes WatcherRegistrationRecord
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "ResponderContract":
|
||||||
|
{
|
||||||
|
var attributes ResponderContract
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "JSPackage":
|
||||||
|
{
|
||||||
|
var attributes JSPackage
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
|
case "ChainRegistrationRecord":
|
||||||
|
{
|
||||||
|
var attributes ChainRegistrationRecord
|
||||||
|
err := json.Unmarshal(bz, &attributes)
|
||||||
|
if err != nil {
|
||||||
|
return &codectypes.Any{}, err
|
||||||
|
}
|
||||||
|
return codectypes.NewAnyWithValue(&attributes)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return &codectypes.Any{}, fmt.Errorf("unsupported record type %s", recordType.(string))
|
return &codectypes.Any{}, fmt.Errorf("unsupported record type %s", recordType.(string))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user