mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
Writing of Schema Struct to PDC working
This commit is contained in:
parent
e1169e061e
commit
4918ef433b
1 changed files with 9 additions and 8 deletions
|
|
@ -850,10 +850,10 @@ func (s *SmartContract) WriteSchemaToPDC(ctx contractapi.TransactionContextInter
|
||||||
}
|
}
|
||||||
|
|
||||||
type transientInput struct {
|
type transientInput struct {
|
||||||
//JsonSchemaContent map[string]interface{} `json:"JsonSchemaContent"`
|
JsonSchemaContent map[string]interface{} `json:"JsonSchemaContent"`
|
||||||
JsonSchemaContent string `json:"JsonSchemaContent"`
|
//JsonSchemaContent string `json:"JsonSchemaContent"`
|
||||||
SchemaId string `json:"SchemaId"`
|
SchemaId string `json:"SchemaId"`
|
||||||
Project string `json:"Project`
|
Project string `json:"Project`
|
||||||
}
|
}
|
||||||
|
|
||||||
// So far, we've taken what's on the transient dictionary and unmarshal it into the transientInput Struct
|
// So far, we've taken what's on the transient dictionary and unmarshal it into the transientInput Struct
|
||||||
|
|
@ -862,10 +862,11 @@ func (s *SmartContract) WriteSchemaToPDC(ctx contractapi.TransactionContextInter
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to unmarshal JSON: %v", err)
|
return fmt.Errorf("failed to unmarshal JSON: %v", err)
|
||||||
}
|
}
|
||||||
jsonFileContent, err := s.JsonReader(ctx, assetInput.JsonSchemaContent)
|
jsonFileContent := assetInput.JsonSchemaContent
|
||||||
if err != nil {
|
//jsonFileContent, err := s.JsonReader(ctx, assetInput.JsonSchemaContent)
|
||||||
return err
|
//if err != nil {
|
||||||
}
|
//return err
|
||||||
|
//}
|
||||||
// Check if Schema already exists
|
// Check if Schema already exists
|
||||||
assetAsBytes, err := ctx.GetStub().GetPrivateData(PDC1, assetInput.SchemaId)
|
assetAsBytes, err := ctx.GetStub().GetPrivateData(PDC1, assetInput.SchemaId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue