Skip to content

Commit

Permalink
Merge pull request #3 from ttt246/allow_gas_strings
Browse files Browse the repository at this point in the history
Allow gas amount to be strings
  • Loading branch information
alidzm authored Mar 13, 2024
2 parents c3afb87 + 32173ac commit 4eafcb0
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
_logger.setLevel(LOG_LEVEL)


def lambda_handler(event, context):
def lambda_handler(event, _):
_logger.debug("incoming event: {}".format(event))

try:
Expand All @@ -39,6 +39,17 @@ def lambda_handler(event, context):

elif operation == "sign_bulk_payout":
del event["operation"]

# cast to integer as JS sends strings for maxFeePerGas, maxPriorityFeePerGas, gas fields
if type(event["maxFeePerGas"]) is str:
event["maxFeePerGas"] = int(event["maxFeePerGas"])

if type(event["maxPriorityFeePerGas"]) is str:
event["maxPriorityFeePerGas"] = int(event["maxPriorityFeePerGas"])

if type(event["gas"]) is str:
event["gas"] = int(event["gas"])

# download public key from KMS
pub_key = get_kms_public_key(key_id)

Expand Down

0 comments on commit 4eafcb0

Please sign in to comment.