-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-11354] Process issue request with a plain issuer
- Implement TMSManager to return a plain issuer - Implement tests to issue tokens with a plain issuer - Implement tests to simulate a client calling prover grpc service Change-Id: I1dd069e1582bed2c7fba802df40b48c4298092dd Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
- Loading branch information
1 parent
6be0455
commit 60f968d
Showing
3 changed files
with
222 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package server | ||
|
||
import ( | ||
"github.com/hyperledger/fabric/token/tms/plain" | ||
) | ||
|
||
// Manager implements token/server/TMSManager interface | ||
// TODO: it will be updated after lscc-baased tms configuration is available | ||
type Manager struct { | ||
} | ||
|
||
// For now it returns a plain issuer. | ||
// After lscc-based tms configuration is available, it will be updated | ||
// to return an issuer configured for the specific channel | ||
func (t *Manager) GetIssuer(channel string, privateCredential, publicCredential []byte) (Issuer, error) { | ||
return &plain.Issuer{}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package server_test | ||
|
||
import ( | ||
"github.com/hyperledger/fabric/token/server" | ||
"github.com/hyperledger/fabric/token/tms/plain" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Manager", func() { | ||
Describe("GetIssuer", func() { | ||
It("returns a plain issuer", func() { | ||
Manager := &server.Manager{} | ||
issuer, err := Manager.GetIssuer("test-channel", []byte("private-credential"), []byte("public-credential")) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(issuer).To(Equal(&plain.Issuer{})) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters