예제 #1
0
def stakers(general_config, registry_options, staking_address):
    """Show relevant information about stakers."""
    emitter, registry, blockchain = registry_options.setup(
        general_config=general_config)
    staking_agent = ContractAgency.get_agent(StakingEscrowAgent,
                                             registry=registry)
    stakers_list = [staking_address
                    ] if staking_address else staking_agent.get_stakers()
    paint_stakers(emitter=emitter, stakers=stakers_list, registry=registry)
예제 #2
0
def stakers(general_config, registry_options, staking_address, substakes):
    """Show relevant information about stakers."""
    if substakes and not staking_address:
        raise click.BadOptionUsage(
            option_name="--substakes",
            message=
            "--substakes is only valid when used with --staking-address.")
    emitter, registry, blockchain = registry_options.setup(
        general_config=general_config)
    staking_agent = ContractAgency.get_agent(StakingEscrowAgent,
                                             registry=registry)
    stakers_list = [staking_address
                    ] if staking_address else staking_agent.get_stakers()
    paint_stakers(emitter=emitter, stakers=stakers_list, registry=registry)
    if substakes:
        staker = Staker(registry=registry,
                        domain=registry_options.network,
                        checksum_address=staking_address)
        staker.stakes.refresh()
        paint_stakes(emitter=emitter, staker=staker, paint_unlocked=True)