diff --git a/ccaas_builder/cmd/detect/main.go b/ccaas_builder/cmd/detect/main.go index 3ad3ccee601..19b0b3a470b 100644 --- a/ccaas_builder/cmd/detect/main.go +++ b/ccaas_builder/cmd/detect/main.go @@ -26,8 +26,6 @@ func main() { logger.Printf("::Error: %v\n", err) os.Exit(1) } - - logger.Printf("::Type detected as ccaas") } type chaincodeMetadata struct { @@ -59,10 +57,12 @@ func run() error { return errors.WithMessage(err, "Unable to parse the metadata.json file") } - if strings.ToLower(metadata.Type) != "ccaas" { + if strings.ToLower(metadata.Type) != "ccaas" && strings.ToLower(metadata.Type) != "remote" { return fmt.Errorf("chaincode type not supported: %s", metadata.Type) } + logger.Printf("::Type detected as: " + strings.ToLower(metadata.Type)) + // returning nil indicates to the peer a successful detection return nil } diff --git a/ccaas_builder/cmd/detect/main_test.go b/ccaas_builder/cmd/detect/main_test.go index 1e46ddf7930..77b3b4af162 100644 --- a/ccaas_builder/cmd/detect/main_test.go +++ b/ccaas_builder/cmd/detect/main_test.go @@ -34,6 +34,10 @@ func TestArugments(t *testing.T) { exitCode: 0, args: []string{"na", "testdata/validtype"}, }, + "validremote": { + exitCode: 0, + args: []string{"na", "testdata/validremote"}, + }, "wrongtype": { exitCode: 1, args: []string{"na", "testdata/wrongtype"}, diff --git a/ccaas_builder/cmd/detect/testdata/validremote/metadata.json b/ccaas_builder/cmd/detect/testdata/validremote/metadata.json new file mode 100644 index 00000000000..c15f660b2e0 --- /dev/null +++ b/ccaas_builder/cmd/detect/testdata/validremote/metadata.json @@ -0,0 +1,4 @@ +{ + "type": "remote", + "label": "audit-trail" +}