From 2f0d840f6ec2807cd5aaf8af9e237d7d4e1e751b Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Tue, 23 Aug 2022 12:32:18 +0000 Subject: [PATCH] fix(signing): require `chainId` for staking signs --- pyhmy/staking_signing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyhmy/staking_signing.py b/pyhmy/staking_signing.py index a60afa7..afa5b52 100644 --- a/pyhmy/staking_signing.py +++ b/pyhmy/staking_signing.py @@ -405,6 +405,8 @@ def sign_staking_transaction(transaction_dict, private_key): https://github.com/harmony-one/sdk/blob/99a827782fabcd5f91f025af0d8de228956d42b4/packages/harmony-staking/src/stakingTransaction.ts """ assert isinstance(transaction_dict, dict), 'Only dictionaries are supported' # OrderedDict is a subclass + # chain_id missing => 'rlp: input string too long for uint64, decoding into (types.StakingTransaction)(types.txdata).GasLimit' + assert 'chainId' in transaction_dict, 'chainId missing' assert 'directive' in transaction_dict, 'Staking transaction type not specified' assert isinstance(transaction_dict['directive'], Directive), 'Unknown staking transaction type' if transaction_dict['directive'] == Directive.CollectRewards: