@@ -68,7 +68,7 @@ func (c *Context) SetupGeoIPClient(_ *config.Config) error {
6868}
6969
7070// SetupAccAddr retrieves the account address for transactions and assigns it to the context. 
71- func  (c  * Context ) SetupAccAddr (cfg  * config.Config ) error  {
71+ func  (c  * Context ) SetupAccAddr (ctx  context. Context ,  cfg  * config.Config ) error  {
7272	log .Info ("Retrieving addr for key" , "name" , cfg .Tx .GetFromName ())
7373
7474	addr , err  :=  c .Client ().KeyAddr (cfg .Tx .GetFromName ())
@@ -78,7 +78,7 @@ func (c *Context) SetupAccAddr(cfg *config.Config) error {
7878
7979	log .Info ("Querying account information" , "addr" , addr )
8080
81- 	acc , err  :=  c .Client ().Account (context . TODO () , addr )
81+ 	acc , err  :=  c .Client ().Account (ctx , addr )
8282	if  err  !=  nil  {
8383		return  fmt .Errorf ("querying account %q: %w" , addr , err )
8484	}
@@ -110,6 +110,8 @@ func (c *Context) SetupService(ctx context.Context, cfg *config.Config) error {
110110		s  =  wireguard .NewServer ("wireguard" , c .HomeDir (), cfg .Services [types .ServiceTypeWireGuard ].(* wireguard.ServerConfig ))
111111	case  types .ServiceTypeOpenVPN :
112112		s  =  openvpn .NewServer ("openvpn" , c .HomeDir (), cfg .Services [types .ServiceTypeOpenVPN ].(* openvpn.ServerConfig ))
113+ 	case  types .ServiceTypeUnspecified :
114+ 		return  fmt .Errorf ("unsupported service type %q" , st )
113115	default :
114116		return  fmt .Errorf ("unsupported service type %q" , st )
115117	}
@@ -126,7 +128,7 @@ func (c *Context) SetupService(ctx context.Context, cfg *config.Config) error {
126128	}
127129
128130	if  err  :=  s .Setup (ctx ); err  !=  nil  {
129- 		return  err 
131+ 		return  err   //nolint:wrapcheck 
130132	}
131133
132134	// Assign the service to the context 
@@ -173,7 +175,7 @@ func (c *Context) Setup(ctx context.Context, cfg *config.Config) error {
173175
174176	log .Info ("Setting up account addr" )
175177
176- 	if  err  :=  c .SetupAccAddr (cfg ); err  !=  nil  {
178+ 	if  err  :=  c .SetupAccAddr (ctx ,  cfg ); err  !=  nil  {
177179		return  fmt .Errorf ("setting up account addr: %w" , err )
178180	}
179181
0 commit comments