Commit 37c9f00d authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Renaming, 4: irmaclient.NewClient() -> irmaclient.New()

parent fb9733ed
......@@ -74,7 +74,7 @@ type secretKey struct {
Key *big.Int
}
// NewClient creates a new Client that uses the directory
// New creates a new Client that uses the directory
// specified by storagePath for (de)serializing itself. irmaConfigurationPath
// is the path to a (possibly readonly) folder containing irma_configuration;
// androidStoragePath is an optional path to the files of the old android app
......@@ -86,7 +86,7 @@ type secretKey struct {
//
// NOTE: It is the responsibility of the caller that there exists a (properly
// protected) directory at storagePath!
func NewClient(
func New(
storagePath string,
irmaConfigurationPath string,
androidStoragePath string,
......@@ -351,7 +351,7 @@ func (client *Client) credentialByID(id irmago.CredentialIdentifier) (*credentia
// credential returns the requested credential, or nil if we do not have it.
func (client *Client) credential(id irmago.CredentialTypeIdentifier, counter int) (cred *credential, err error) {
// If the requested credential is not in credential map, we check if its attributes were
// deserialized during NewClient(). If so, there should be a corresponding signature file,
// deserialized during New(). If so, there should be a corresponding signature file,
// so we read that, construct the credential, and add it to the credential map
if _, exists := client.creds(id)[counter]; !exists {
attrs := client.Attributes(id, counter)
......
......@@ -42,7 +42,7 @@ func parseStorage(t *testing.T) *Client {
if !exists {
require.NoError(t, os.Mkdir("testdata/storage/test", 0755), "Could not create test storage")
}
manager, err := NewClient(
manager, err := New(
"testdata/storage/test",
"testdata/irma_configuration",
"testdata/oldstorage",
......@@ -189,7 +189,7 @@ func TestUnmarshaling(t *testing.T) {
jwt := getIssuanceJwt("testip", irmago.NewAttributeTypeIdentifier("irma-demo.RU.studentCard.studentID"))
sessionHelper(t, jwt, "issue", client)
newclient, err := NewClient("testdata/storage/test", "testdata/irma_configuration", "testdata/oldstorage", nil)
newclient, err := New("testdata/storage/test", "testdata/irma_configuration", "testdata/oldstorage", nil)
require.NoError(t, err)
verifyManagerIsUnmarshaled(t, newclient)
verifyCredentials(t, newclient)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment