mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 12:44:19 +01:00
Dynamic amount in unroll closure (#173)
* update UnrollClosure * update TrustedOnboarding flow + add TrustedOnboarding e2e test * fix linter: grpc.Dial * add comment * integration tests: faucet the ASP with 2 utxos
This commit is contained in:
@@ -55,19 +55,13 @@ func (h *handler) TrustedOnboarding(ctx context.Context, req *arkv1.TrustedOnboa
|
||||
return nil, status.Error(codes.InvalidArgument, "invalid user pubkey")
|
||||
}
|
||||
|
||||
amount := req.GetAmount()
|
||||
if amount <= 0 {
|
||||
return nil, status.Error(codes.InvalidArgument, "invalid amount")
|
||||
}
|
||||
|
||||
address, expectedAmount, err := h.svc.TrustedOnboarding(ctx, decodedPubKey, amount)
|
||||
address, err := h.svc.TrustedOnboarding(ctx, decodedPubKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &arkv1.TrustedOnboardingResponse{
|
||||
Address: address,
|
||||
ExpectedAmount: expectedAmount,
|
||||
Address: address,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ func NewService(
|
||||
})
|
||||
}
|
||||
gatewayOpts := grpc.WithTransportCredentials(gatewayCreds)
|
||||
ctx := context.Background()
|
||||
conn, err := grpc.DialContext(
|
||||
ctx, svcConfig.gatewayAddress(), gatewayOpts,
|
||||
conn, err := grpc.NewClient(
|
||||
svcConfig.gatewayAddress(), gatewayOpts,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -86,6 +85,7 @@ func NewService(
|
||||
},
|
||||
}),
|
||||
)
|
||||
ctx := context.Background()
|
||||
if err := arkv1.RegisterArkServiceHandler(
|
||||
ctx, gwmux, conn,
|
||||
); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user