tron refactoring
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/tech/sendico/gateway/chain/internal/keymanager"
|
||||
vaultmanager "github.com/tech/sendico/gateway/chain/internal/keymanager/vault"
|
||||
gatewayservice "github.com/tech/sendico/gateway/chain/internal/service/gateway"
|
||||
"github.com/tech/sendico/gateway/chain/internal/service/gateway/drivers"
|
||||
"github.com/tech/sendico/gateway/chain/internal/service/gateway/rpcclient"
|
||||
gatewayshared "github.com/tech/sendico/gateway/chain/internal/service/gateway/shared"
|
||||
"github.com/tech/sendico/gateway/chain/storage"
|
||||
@@ -121,15 +122,18 @@ func (i *Imp) Start() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
driverRegistry, err := drivers.NewRegistry(i.logger.Named("drivers"), networkConfigs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
serviceFactory := func(logger mlogger.Logger, repo storage.Repository, producer msg.Producer) (grpcapp.Service, error) {
|
||||
executor := gatewayservice.NewOnChainExecutor(logger, keyManager, rpcClients)
|
||||
opts := []gatewayservice.Option{
|
||||
gatewayservice.WithNetworks(networkConfigs),
|
||||
gatewayservice.WithServiceWallet(walletConfig),
|
||||
gatewayservice.WithKeyManager(keyManager),
|
||||
gatewayservice.WithTransferExecutor(executor),
|
||||
gatewayservice.WithRPCClients(rpcClients),
|
||||
gatewayservice.WithDriverRegistry(driverRegistry),
|
||||
gatewayservice.WithSettings(cfg.Settings),
|
||||
}
|
||||
return gatewayservice.NewService(logger, repo, producer, opts...), nil
|
||||
|
||||
Reference in New Issue
Block a user