def test_assert_valid_transaction_params_all_params(): assert_valid_transaction_params({ 'chainId': 1, 'type': '0x2', 'from': '0x0', 'to': '0x0', 'gas': 21000, 'gasPrice': 5000000, 'maxFeePerGas': 2000000000, 'maxPriorityFeePerGas': 1000000000, 'accessList': ( { 'address': '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', 'storageKeys': ( '0x0000000000000000000000000000000000000000000000000000000000000003', '0x0000000000000000000000000000000000000000000000000000000000000007', ) }, { 'address': '0xbb9bc244d798123fde783fcc1c72d3bb8c189413', 'storageKeys': () }, ), 'value': 1, 'data': '0x0', 'nonce': 2, })
def modifyTransaction( self, transaction_hash: _Hash32, **transaction_params: Any ) -> HexBytes: assert_valid_transaction_params(cast(TxParams, transaction_params)) current_transaction = get_required_transaction(self.web3, transaction_hash) current_transaction_params = extract_valid_transaction_params(current_transaction) new_transaction = merge(current_transaction_params, transaction_params) return replace_transaction(self.web3, current_transaction, new_transaction)
def test_assert_valid_transaction_params_invalid_param(): with pytest.raises(ValueError): assert_valid_transaction_params({ 'from': '0x0', 'to': '0x0', 'value': 1, 'tokens': 9000, })
def test_assert_valid_transaction_params_invalid_param(): with pytest.raises(ValueError): assert_valid_transaction_params({ 'from': '0x0', 'to': '0x0', 'value': 1, 'tokens': 9000, })
def modifyTransaction(self, transaction_hash, **transaction_params): assert_valid_transaction_params(transaction_params) current_transaction = get_required_transaction(self.web3, transaction_hash) current_transaction_params = extract_valid_transaction_params( current_transaction) new_transaction = merge(current_transaction_params, transaction_params) return replace_transaction(self.web3, current_transaction, new_transaction)
def test_assert_valid_transaction_params_all_params(): assert_valid_transaction_params({ 'from': '0x0', 'to': '0x0', 'gas': 21000, 'gasPrice': 5000000, 'value': 1, 'data': '0x0', 'nonce': 2, 'chainId': 1, })
def test_assert_valid_transaction_params_all_params(): assert_valid_transaction_params({ 'chainId': 1, 'type': '0x2', 'from': '0x0', 'to': '0x0', 'gas': 21000, 'gasPrice': 5000000, 'maxFeePerGas': 2000000000, 'maxPriorityFeePerGas': 1000000000, 'value': 1, 'data': '0x0', 'nonce': 2, })
def test_assert_valid_transaction_params_some_params(): assert_valid_transaction_params({ 'from': '0x0', 'to': '0x0', 'value': 1, })
def test_assert_valid_transaction_params_some_params(): assert_valid_transaction_params({ 'from': '0x0', 'to': '0x0', 'value': 1, })
def modifyTransaction(self, transaction_hash, **transaction_params): assert_valid_transaction_params(transaction_params) current_transaction = get_required_transaction(self.web3, transaction_hash) current_transaction_params = extract_valid_transaction_params(current_transaction) new_transaction = merge(current_transaction_params, transaction_params) return replace_transaction(self.web3, current_transaction, new_transaction)