Skip to content

Commit 01d340b

Browse files
author
rlfnb
committed
integrate support for chain code as a service remote execution
1 parent 94590aa commit 01d340b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

ccaas_builder/cmd/detect/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ func main() {
2626
logger.Printf("::Error: %v\n", err)
2727
os.Exit(1)
2828
}
29-
30-
logger.Printf("::Type detected as ccaas")
3129
}
3230

3331
type chaincodeMetadata struct {
@@ -59,10 +57,12 @@ func run() error {
5957
return errors.WithMessage(err, "Unable to parse the metadata.json file")
6058
}
6159

62-
if strings.ToLower(metadata.Type) != "ccaas" {
60+
if strings.ToLower(metadata.Type) != "ccaas" && strings.ToLower(metadata.Type) != "remote" {
6361
return fmt.Errorf("chaincode type not supported: %s", metadata.Type)
6462
}
6563

64+
logger.Printf("::Type detected as: " + strings.ToLower(metadata.Type))
65+
6666
// returning nil indicates to the peer a successful detection
6767
return nil
6868
}

ccaas_builder/cmd/detect/main_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func TestArugments(t *testing.T) {
3434
exitCode: 0,
3535
args: []string{"na", "testdata/validtype"},
3636
},
37+
"validremote": {
38+
exitCode: 0,
39+
args: []string{"na", "testdata/validremote"},
40+
},
3741
"wrongtype": {
3842
exitCode: 1,
3943
args: []string{"na", "testdata/wrongtype"},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "remote",
3+
"label": "audit-trail"
4+
}

0 commit comments

Comments
 (0)