Skip to content

Few more fixes for staker#2170

Merged
vzotova merged 7 commits intonucypher:mainfrom
vzotova:few-more-stakes
Aug 19, 2020
Merged

Few more fixes for staker#2170
vzotova merged 7 commits intonucypher:mainfrom
vzotova:few-more-stakes

Conversation

@vzotova
Copy link
Member

@vzotova vzotova commented Aug 9, 2020

Fixes #2114
Fixes #1739
Fixes #1436
Fixes #2066
Fixes #1545

@vzotova vzotova added the Staking label Aug 9, 2020
@vzotova vzotova self-assigned this Aug 9, 2020
@codecov
Copy link

codecov bot commented Aug 9, 2020

Codecov Report

Merging #2170 into main will increase coverage by 3.78%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2170      +/-   ##
==========================================
+ Coverage   80.11%   83.89%   +3.78%     
==========================================
  Files         103      103              
  Lines       15172    15188      +16     
==========================================
+ Hits        12155    12742     +587     
+ Misses       3017     2446     -571     
Impacted Files Coverage Δ
nucypher/blockchain/eth/multisig.py 60.71% <ø> (-0.47%) ⬇️
nucypher/blockchain/eth/token.py 90.30% <ø> (+0.60%) ⬆️
nucypher/cli/literature.py 100.00% <ø> (ø)
nucypher/cli/processes.py 75.22% <ø> (ø)
nucypher/blockchain/eth/actors.py 86.76% <87.50%> (+0.41%) ⬆️
nucypher/cli/painting/status.py 93.69% <95.83%> (+0.42%) ⬆️
nucypher/blockchain/eth/agents.py 92.43% <100.00%> (+1.59%) ⬆️
nucypher/blockchain/eth/registry.py 75.00% <100.00%> (+1.51%) ⬆️
nucypher/cli/commands/stake.py 90.57% <100.00%> (+13.08%) ⬆️
nucypher/cli/commands/status.py 69.31% <100.00%> (-0.35%) ⬇️
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32e9210...bfa2da2. Read the comment docs.

@vzotova vzotova force-pushed the few-more-stakes branch 8 times, most recently from 320d741 to a46da6c Compare August 16, 2020 10:00
@vzotova vzotova changed the title [WIP] Few more fixes for staker Few more fixes for staker Aug 16, 2020
@vzotova vzotova marked this pull request as ready for review August 16, 2020 10:18
Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸


self.log = Logger(self.__class__.__name__)
self.registry = registry
self.registry_repr = str(registry)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh - slightly confusion name here - since str calls __str__ and not _repr__.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right
changed
✔️

@group_staker_options
@option_config_file
@click.option('--all', help="List all stakes, including unlocked", is_flag=True)
@click.option('--show-all', help="List all stakes, including unlocked and inactive", is_flag=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find "show" to be a bit pedantic here and prefer simply --all. There is an additional kwarg for click options to map to an alias to avoid name-shadowing the all function here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

test_registry.search(contract_address=test_addr)

# Check id of new registry with the same content
new_registry = InMemoryContractRegistry() # TODO finish this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO Needs an Issue to track?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to remove this
✔️

vzotova added a commit to vzotova/nucypher that referenced this pull request Aug 18, 2020
Co-authored-by: K Prasch <kieranprasch@gmail.com>
vzotova added a commit to vzotova/nucypher that referenced this pull request Aug 18, 2020
Co-authored-by: K Prasch <kieranprasch@gmail.com>
start_of_period=True)
enactment = start_datetime.local_datetime().strftime("%b %d %Y")
termination = unlock_datetime.local_datetime().strftime("%b %d %Y")
search = f"{index}\\s+│\\s+" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Sufficiently generic to remain flexible

from web3.types import TxReceipt

from constant_sorrow.constants import FULL, NO_WORKER_BONDED, WORKER_NOT_RUNNING
from constant_sorrow.constants import FULL, WORKER_NOT_RUNNING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

emitter.echo(snippet_with_line, bold=True)
emitter.echo(f"Staker {staker.checksum_address} ════", bold=True, color='red' if missing else 'green')
emitter.echo(f"Worker {staker.worker_address} ════")
worker = staker.worker_address if staker.worker_address != NULL_ADDRESS else 'NO_WORKER_BONDED'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
worker = staker.worker_address if staker.worker_address != NULL_ADDRESS else 'NO_WORKER_BONDED'
worker = staker.worker_address if staker.worker_address != NULL_ADDRESS else 'not bonded'

So in the next line it's printed Worker not bonded instead of Worker NO_WORKER_BONDED.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left NO_WORKER_BONDED only to not change all documentation, but if you think it worth it - then I'll do that

Copy link
Member

@cygnusv cygnusv Aug 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry to change the documentation, the change is too small to justify perfect consistency. We can also leave as it is and merge. As you prefer.

@vzotova vzotova merged commit 8d092d9 into nucypher:main Aug 19, 2020
@vzotova vzotova deleted the few-more-stakes branch August 19, 2020 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants