njgheorghita on master
Update deleted github url Merge pull request #1680 from n… (compare)
njgheorghita on master
Add v3 examples to assets dir Update ethpm/tests/validation t… Update base ethpm tests to v3 and 13 more (compare)
As you had suggessted I tried
from eth_account.messages import encode_defunct, encode_intended_validator msg = Web3.soliditySha3( [ 'address' , 'uint256' ] , [ Web3.toChecksumAddress("0x516510e3B61F3D425Fe5F52D7492E8950C8647D7") , 500]) message = encode_intended_validator(Web3.toChecksumAddress("0x09c1814a3c53c025f354a9d7b88e28a084d0f162"), hexstr=msg.hex()) print("message" , message) signed_message = w3.eth.account.sign_message(message, private_key=private_key)
But this time the signed_message.messagehash and what i got from solidity are diffrent :(
@carver I also used this https://eips.ethereum.org/EIPS/eip-191
and so made a little code change :
keccak256(abi.encodePacked(byte(0x19),byte(0),address(this),destination, value, data, nonce));
Still didn't match
did you go through the tests?
I forgot .. i ll check tyhe tests now ..
ValidationErrorwhen a POA network returns >32 bytes of extraData and the
geth_poa_middlewareisn't active. I want to handle this automatically in Brownie.. when connecting to a new network, query an endpoint and if this error is raised, add the middleware. I can do so by examining at the string of the
ValidationErrorbut that feels brittle. Wondering if you'd be open to instead raising a new exception,
ExtraDataError? This exception can subclass
ValidationErrorso the change won't break anything, and this way there is a much stronger approach for catching the specific error.
var hash = "0x" + abi.soliditySHA3( ["address", "uint256"], ["0x516510e3B61F3D425Fe5F52D7492E8950C8647D7", 500] ).toString("hex"); var signature = web3.eth.accounts.sign( hash , privateKey );
I was able to solve my issue by using nodejs .. using this code the signature.messagehash == solidity message hash.. But I wanted to write the Api in python only.. Why can't i solve it with python??
admin(), which triggers a validation error in web3.py. I can't think of a good reason for there to be such duplicates in the ABI intentionally, it just looks broken. Maybe you could publish one that doesn't have duplicates? https://compound.finance/docs/abi/mainnet/Comptroller
LATEST_BLOCK = 10226095 STEP_SIZE = 100_000 for i in range(0, int(1_000_000 / STEP_SIZE)): filter_builder = cDAI.events.LiquidateBorrow.build_filter() filter_builder.fromBlock = LATEST_BLOCK - ((i + 1) * STEP_SIZE) filter_builder.toBlock = LATEST_BLOCK - (i * STEP_SIZE) filter_instance = filter_builder.deploy(w3) entries = filter_instance.get_all_entries() if len(entries) > 0: print(i, entries)