github.com/Unheilbar/quorum@v1.0.0/plugin/account/creator.go (about)

     1  package account
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/ethereum/go-ethereum/accounts"
     7  )
     8  
     9  type creator struct {
    10  	service Service
    11  }
    12  
    13  // NewCreator creates an implementation of CreatorService that simply acts as a delegate to service.  This method
    14  // exists to allow for only the CreatorService methods to be exposed as APIs with the plugin delegate API framework.
    15  func NewCreator(service Service) CreatorService {
    16  	return &creator{service: service}
    17  }
    18  
    19  func (a *creator) NewAccount(ctx context.Context, newAccountConfig interface{}) (accounts.Account, error) {
    20  	return a.service.NewAccount(ctx, newAccountConfig)
    21  }
    22  
    23  func (a *creator) ImportRawKey(ctx context.Context, rawKey string, newAccountConfig interface{}) (accounts.Account, error) {
    24  	return a.service.ImportRawKey(ctx, rawKey, newAccountConfig)
    25  }