Add AdminService (#176)

* add admin service

* go mod tidy

* fix linter: grpc.Dial

* fix ocean get balance

* fix linter

* add .vscode to gitignore

* rework admin balance API

* fix mockedwallet in covenantless pkg

* make proto
This commit is contained in:
Louis Singer
2024-05-31 15:46:46 +02:00
committed by GitHub
parent 329ba555db
commit 9fc49d9f08
27 changed files with 2510 additions and 73 deletions

View File

@@ -47,6 +47,7 @@ type Config struct {
repo ports.RepoManager
svc application.Service
adminSvc application.AdminService
wallet ports.WalletService
txBuilder ports.TxBuilder
scanner ports.BlockchainScanner
@@ -125,6 +126,9 @@ func (c *Config) Validate() error {
if err := c.appService(); err != nil {
return err
}
if err := c.adminService(); err != nil {
return err
}
return nil
}
@@ -132,6 +136,10 @@ func (c *Config) AppService() application.Service {
return c.svc
}
func (c *Config) AdminService() application.AdminService {
return c.adminSvc
}
func (c *Config) repoManager() error {
var svc ports.RepoManager
var err error
@@ -238,6 +246,11 @@ func (c *Config) appService() error {
return nil
}
func (c *Config) adminService() error {
c.adminSvc = application.NewAdminService(c.wallet, c.repo, c.txBuilder)
return nil
}
func (c *Config) mainChain() network.Network {
switch c.Network.Name {
case "testnet":