Skip to content

Commit cc751cd

Browse files
authored
Deny names and symbols that differ during processing in Launch RPC (#161)
1 parent 1078a14 commit cc751cd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ocp/rpc/currency/launch.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ func (s *currencyServer) Launch(ctx context.Context, req *currencypb.LaunchReque
5959
if isReservedCurrencyName(name) {
6060
return &currencypb.LaunchResponse{Result: currencypb.LaunchResponse_DENIED}, nil
6161
}
62+
if name != req.Name {
63+
return &currencypb.LaunchResponse{Result: currencypb.LaunchResponse_DENIED}, nil
64+
}
6265

6366
symbol := strings.TrimSpace(req.Symbol)
6467
if len(symbol) == 0 {
@@ -74,6 +77,8 @@ func (s *currencyServer) Launch(ctx context.Context, req *currencypb.LaunchReque
7477
if len(symbol) > currencycreator.MaxCurrencyConfigAccountSymbolLength {
7578
symbol = symbol[0:currencycreator.MaxCurrencyConfigAccountSymbolLength]
7679
}
80+
} else if symbol != req.Symbol {
81+
return &currencypb.LaunchResponse{Result: currencypb.LaunchResponse_DENIED}, nil
7782
}
7883

7984
description := strings.TrimSpace(req.Description)

0 commit comments

Comments
 (0)