Skip to content

Commit

Permalink
Merge pull request #464 from skalenetwork/enhancement/SKALE-4556-eip-…
Browse files Browse the repository at this point in the history
…1559

Enforce None gas limit in redis wallet adapter
  • Loading branch information
badrogger authored Jan 11, 2022
2 parents 2dc3bbf + 6cb0ee2 commit a6bd38a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions skale/wallets/redis_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ def _make_record(
multiplier: int = config.DEFAULT_GAS_MULTIPLIER
) -> Tuple[bytes, bytes]:
tx_id = cls._make_raw_id()
record = json.dumps({
params = {
'status': 'PROPOSED',
'score': score,
'multiplier': multiplier,
'tx_hash': None,
**tx
}).encode('utf-8')
}
# Ensure gas will be restimated in TM
params['gas'] = None
record = json.dumps(params).encode('utf-8')
return tx_id, record

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion tests/wallets/redis_adapter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_make_record():
score = '51623233060'
tx_id, r = RedisWalletAdapter._make_record(tx, score, 2)
assert tx_id.startswith(b'tx-') and len(tx_id) == 19
assert r == b'{"status": "PROPOSED", "score": "51623233060", "multiplier": 2, "tx_hash": null, "from": "0x1", "to": "0x2", "value": 1, "gasPrice": 1, "gas": 22000, "nonce": 1, "chainId": 1}' # noqa
assert r == b'{"status": "PROPOSED", "score": "51623233060", "multiplier": 2, "tx_hash": null, "from": "0x1", "to": "0x2", "value": 1, "gasPrice": 1, "gas": null, "nonce": 1, "chainId": 1}' # noqa


def test_sign_and_send(rdp):
Expand Down

0 comments on commit a6bd38a

Please sign in to comment.