Skip to content

Commit

Permalink
Merge pull request #1985 from diegomasini/issue1953
Browse files Browse the repository at this point in the history
Fixed asset_management_with_roles chaincode for issue 1953
  • Loading branch information
ghaskins committed Jun 24, 2016
2 parents 85768f2 + 3c82e4b commit 1116c74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (t *AssetManagementChaincode) Query(stub *shim.ChaincodeStub, function stri
}

if len(row.Columns) == 0 {
jsonResp := "{\"Error\":\"Failed retrieving owner for " + asset + ". Error " + err.Error() + ". \"}"
jsonResp := "{\"Error\":\"Failed retrieving owner for " + asset + ". \"}"
return nil, errors.New(jsonResp)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ func TestAssetManagement(t *testing.T) {
if !reflect.DeepEqual(theOnwerIs, bobAccount) {
t.Fatal("Bob is not the owner of Picasso")
}

// Check who is the owner of an asset that doesn't exist
_, err = whoIsTheOwner("Klee")
if err == nil {
t.Fatal("This asset doesn't exist. Querying should fail.")
}
}

func deploy(admCert crypto.CertificateHandler) error {
Expand Down

0 comments on commit 1116c74

Please sign in to comment.