Skip to content

Commit

Permalink
Remove geth version-specific signed txs
Browse files Browse the repository at this point in the history
  • Loading branch information
njgheorghita committed Mar 29, 2019
1 parent ff97b12 commit 1fc13f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
9 changes: 0 additions & 9 deletions tests/integration/go_ethereum/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
Web3ModuleTest,
)

GETH_17_SIGNED_TX = b'\xf8j\x80\x85\x040\xe24\x00\x82R\x08\x94\xdcTM\x1a\xa8\x8f\xf8\xbb\xd2\xf2\xae\xc7T\xb1\xf1\xe9\x9e\x18\x12\xfd\x01\x80\x86\xee\xca\xc4f\xe1\x16\xa0\xbb7^\x1f\xf0\x03(P\x07|\x053Q\xd3M\xf1\x83\xe9\xdcp\xdc\x02\xb4\xe7`\x85\xcd\x84\xdb\xb4\xd0\xaa\xa07\x8cl\xd7\xa6R\x01\xfaW\x0e\x0f\xc1_$\xdf`\x8dO\x18\x1dC\xbc\x87\x8fud\xd2R*W\xfd4' # noqa: E501
GETH_18_SIGNED_TX = b'\xf8i\x80\x84;\x9a\xca\x00\x82R\x08\x94\xdcTM\x1a\xa8\x8f\xf8\xbb\xd2\xf2\xae\xc7T\xb1\xf1\xe9\x9e\x18\x12\xfd\x01\x80\x86\xee\xca\xc4f\xe1\x16\xa0W\x91\xe6a\xb7l\x93,\xd3\xdd?;\xa8\x0e\xd3\xbe\x04\x89(\xd49\x1e+\xd6\xee\x88k\xfb\xe7\x83\xeb(\xa0\x04\x9a%`\x91uc\x1a\xdd\xb8\x96\xbb\x10\xb5v|\xcf\x03\xb6\x90\xbb\x93x\xfef\xae\xe1L\xbc7\xafJ' # noqa: E501


class GoEthereumTest(Web3ModuleTest):
def _check_web3_clientVersion(self, client_version):
Expand Down Expand Up @@ -62,12 +59,6 @@ def test_eth_estimateGas_with_block(self,
web3, unlocked_account_dual_type
)

def test_eth_signTransaction(self, web3, unlocked_account):
if 'v1.8.22' in web3.clientVersion:
super().test_eth_signTransaction(web3, unlocked_account, GETH_18_SIGNED_TX)
else:
super().test_eth_signTransaction(web3, unlocked_account, GETH_17_SIGNED_TX)

def test_eth_submitHashrate(self, web3):
if 'v1.8.22' in web3.clientVersion:
# https://github.com/ethereum/go-ethereum/commit/51db5975cc5fb88db6a0dba1826b534fd4df29d7
Expand Down
10 changes: 3 additions & 7 deletions web3/_utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_eth_sign(self, web3, unlocked_account_dual_type):
)
assert new_signature != signature

def test_eth_signTransaction(self, web3, unlocked_account, geth_signed_tx=None):
def test_eth_signTransaction(self, web3, unlocked_account):
txn_params = {
'from': unlocked_account,
'to': unlocked_account,
Expand All @@ -205,13 +205,9 @@ def test_eth_signTransaction(self, web3, unlocked_account, geth_signed_tx=None):
'gasPrice': web3.eth.gasPrice,
'nonce': 0,
}
COINBASE_PK = '0x58d23b55bc9cdce1f18c2500f40ff4ab7245df9a89505e9b1fa4851f623d241d'
result = web3.eth.signTransaction(txn_params)
actual = web3.eth.account.signTransaction(txn_params, COINBASE_PK)
if geth_signed_tx:
assert result['raw'] == geth_signed_tx
else:
assert result['raw'] == actual.rawTransaction
signatory_account = web3.eth.account.recoverTransaction(result['raw'])
assert unlocked_account == signatory_account
assert result['tx']['to'] == txn_params['to']
assert result['tx']['value'] == txn_params['value']
assert result['tx']['gas'] == txn_params['gas']
Expand Down

0 comments on commit 1fc13f4

Please sign in to comment.