OSDN Git Service

Dev wallet sa (#1238)
[bytom/bytom-spv.git] / accesstoken / accesstoken.go
index 6925067..b357625 100644 (file)
@@ -3,7 +3,6 @@
 package accesstoken
 
 import (
-       "context"
        "crypto/rand"
        "encoding/json"
        "fmt"
@@ -57,7 +56,7 @@ func NewStore(db dbm.DB) *CredentialStore {
 }
 
 // Create generates a new access token with the given ID.
-func (cs *CredentialStore) Create(ctx context.Context, id, typ string) (*Token, error) {
+func (cs *CredentialStore) Create(id, typ string) (*Token, error) {
        if !validIDRegexp.MatchString(id) {
                return nil, errors.WithDetailf(ErrBadID, "invalid id %q", id)
        }
@@ -92,7 +91,7 @@ func (cs *CredentialStore) Create(ctx context.Context, id, typ string) (*Token,
 }
 
 // Check returns whether or not an id-secret pair is a valid access token.
-func (cs *CredentialStore) Check(ctx context.Context, id string, secret string) error {
+func (cs *CredentialStore) Check(id string, secret string) error {
        if !validIDRegexp.MatchString(id) {
                return errors.WithDetailf(ErrBadID, "invalid id %q", id)
        }
@@ -115,7 +114,7 @@ func (cs *CredentialStore) Check(ctx context.Context, id string, secret string)
 }
 
 // List lists all access tokens.
-func (cs *CredentialStore) List(ctx context.Context) ([]*Token, error) {
+func (cs *CredentialStore) List() ([]*Token, error) {
        tokens := make([]*Token, 0)
        iter := cs.DB.Iterator()
        defer iter.Release()
@@ -131,7 +130,7 @@ func (cs *CredentialStore) List(ctx context.Context) ([]*Token, error) {
 }
 
 // Delete deletes an access token by id.
-func (cs *CredentialStore) Delete(ctx context.Context, id string) error {
+func (cs *CredentialStore) Delete(id string) error {
        if !validIDRegexp.MatchString(id) {
                return errors.WithDetailf(ErrBadID, "invalid id %q", id)
        }