populus
populus copied to clipboard
ContractFactory classes do not retain their names.
migrated from: https://github.com/pipermerriam/web3.py/issues/172
What was wrong?
Currently the contract object does not know its own name (the contract name in the source code).
contract.__class__.__name__
'PopulusContract'
Cute Animal Picture
(__)
(__) [@@] ? (__) ? (__)
(oo) <=|^^|=> ? (oo) ? |\/|(oo)
/-------VV /--------- \/ /-------\/ /--| \--\/
/ | || / | || / | || / | ||
* ||----|| / | || * ||----|| * ||----||
^^ ^^ * ||------|| ^^ ^^ ^^ ^^
^^ ^^
Cownt Dracula Francownstein Where Cow Cow bird
Cow Cow
Implementing this should be as easy as adding a contract_name
keyword argument here
https://github.com/pipermerriam/populus/blob/master/populus/contracts/contract.py#L66-L70
I could give this a try.
Does the contract_identifier
argument contain the name of the contract?
@pipermerriam @carver any interest in having a gitcoin bounty hunter, @jhselvik work on this?
Seems easy enough. Just adding contract_name=contract_identifier
or something like contract_data['name']
to the return line in the construct_contract_factory
function. Maybe add a test to the test_get_contract_factory.py file.
Currently the contract_identifier
argument is unused.