public async Task <AddAddressResult> AddAddressToWhitelistAsync( string address, BigInteger maxGasAmount) { var addressHasBeenAdded = await _whitelistedAddressRepository.AddIfNotExistsAsync ( address, maxGasAmount ); if (addressHasBeenAdded) { _log.Info ( $"Address [{address}] has been whitelisted.", new { address } ); return(AddAddressResult.Success()); } else { return(AddAddressResult.HasAlreadyBeenAdded()); } }
public async Task <AddAddressResult> AddAddressToBlacklistAsync( string address, string reason) { var addressHasBeenAdded = await _blacklistedAddressRepository.AddIfNotExistsAsync ( address : address, reason : reason ); if (addressHasBeenAdded) { _log.Info ( $"Address [{address}] has been blacklisted.", new { address } ); return(AddAddressResult.Success()); } else { return(AddAddressResult.HasAlreadyBeenAdded()); } }