dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Use proposetoaddress instead of generatetoaddress #1095

Closed scravy closed 3 years ago

scravy commented 5 years ago

Uses proposetoaddress instead of generatetoaddress where possible

Signed-off-by: Julian Fleischer julian@thirdhash.com

frolosofsky commented 5 years ago

There's generate_block in util.py which is used in bunch of functional tests (#1037). I think, it'd be nice to update this function, and if possible, change the rest of the code to use this function instead of generatetoaddress/proposetoaddress.

scravy commented 5 years ago

@frolosofsky @Nizametdinov

This pull request used proposetoaddress instead of generatetoaddress where possible. It does not change any uses us generate into proposetoaddress or generatetoaddress. It is one small step in the right direction.

About wallet_disable - this one does not work with proposetoaddress (yet). I replaced generatetoaddress with proposetoaddress and checked which tests would work with it. This is the result.

frolosofsky commented 5 years ago

This pull request used proposetoaddress instead of generatetoaddress where possible. It does not change any uses us generate into proposetoaddress or generatetoaddress. It is one small step in the right direction.

I suggest using proposetoaddress instead of generatetoaddress here (util.py):

def generate_block(node, count=1):
    return node.generatetoaddress(count, node.getnewaddress('', 'bech32'))

Isn't it possible? I see you've replaced these things in number of files, but most of functional tests call generatetoaddress indirectly via generate_block.

scravy commented 5 years ago

I am unsure how to respond to that without repeating what I wrote before.

I will close this pull request and attach the up for grabs label.