docs: remove -1 as page option

pull/35/head
MaxMustermann2 2 years ago
parent c89976f2c0
commit 1c90c914aa
No known key found for this signature in database
GPG Key ID: 4F4AB9DB6FF24C94
  1. 4
      README.md
  2. 6
      pyhmy/staking.py
  3. 2
      tests/sdk-pyhmy/test_staking.py

@ -258,7 +258,7 @@ delegator_addr = 'one1y2624lg0mpkxkcttaj0c85pp8pfmh2tt5zhdte'
```py ```py
all_validators = staking.get_all_validator_addresses(endpoint=test_net) # list of addresses all_validators = staking.get_all_validator_addresses(endpoint=test_net) # list of addresses
validator_information = staking.get_validator_information(validator_addr, endpoint=test_net) # dict with all info validator_information = staking.get_validator_information(validator_addr, endpoint=test_net) # dict with all info
validator_information_100 = staking.get_all_validator_information(page=0, endpoint=test_net) # for all use page=-1 validator_information_100 = staking.get_all_validator_information(page=0, endpoint=test_net)
elected_validators = staking.get_elected_validator_addresses(endpoint=test_net) # list of addresses elected_validators = staking.get_elected_validator_addresses(endpoint=test_net) # list of addresses
validators_for_epoch = staking.get_validators(epoch=73772, endpoint=test_net) # dict with list of validators and balance validators_for_epoch = staking.get_validators(epoch=73772, endpoint=test_net) # dict with list of validators and balance
validators_information_100_for_block = staking.get_all_validator_information_by_block_number(block_num=9017724, page=0, endpoint=test_net) validators_information_100_for_block = staking.get_all_validator_information_by_block_number(block_num=9017724, page=0, endpoint=test_net)
@ -269,7 +269,7 @@ total_delegation = staking.get_validator_total_delegation(validator_addr, endpoi
``` ```
##### Delegation ##### Delegation
```py ```py
delegation_information = staking.get_all_delegation_information(page=-1, endpoint=test_net) delegation_information = staking.get_all_delegation_information(page=0, endpoint=test_net)
delegations_by_delegator = staking.get_delegations_by_delegator(delegator_addr, test_net) delegations_by_delegator = staking.get_delegations_by_delegator(delegator_addr, test_net)
delegations_by_delegator_at_block = staking.get_delegations_by_delegator_by_block_number(delegator_addr, block_num=9017724, endpoint=test_net) delegations_by_delegator_at_block = staking.get_delegations_by_delegator_by_block_number(delegator_addr, block_num=9017724, endpoint=test_net)
delegation_by_delegator_and_validator = staking.get_delegation_by_delegator_and_validator(delegator_addr, validator_addr, test_net) delegation_by_delegator_and_validator = staking.get_delegation_by_delegator_and_validator(delegator_addr, validator_addr, test_net)

@ -316,7 +316,7 @@ def get_all_validator_information(
Parameters Parameters
---------- ----------
page: :obj:`int`, optional page: :obj:`int`, optional
Page to request (-1 for all validators), page size is 100 otherwise Page to request, page size is 100 otherwise
endpoint: :obj:`str`, optional endpoint: :obj:`str`, optional
Endpoint to send request to Endpoint to send request to
timeout: :obj:`int`, optional timeout: :obj:`int`, optional
@ -449,7 +449,7 @@ def get_all_validator_information_by_block_number(
block_num: int block_num: int
Block number to get validator information for Block number to get validator information for
page: :obj:`int`, optional page: :obj:`int`, optional
Page to request (-1 for all validators), page size is 100 Page to request, page size is 100
endpoint: :obj:`str`, optional endpoint: :obj:`str`, optional
Endpoint to send request to Endpoint to send request to
timeout: :obj:`int`, optional timeout: :obj:`int`, optional
@ -495,7 +495,7 @@ def get_all_delegation_information(
Parameters Parameters
---------- ----------
page: :obj:`int`, optional page: :obj:`int`, optional
Page to request (-1 for all validators), page size is 100 Page to request, page size is 100
endpoint: :obj:`str`, optional endpoint: :obj:`str`, optional
Endpoint to send request to Endpoint to send request to
timeout: :obj:`int`, optional timeout: :obj:`int`, optional

@ -209,7 +209,7 @@ def test_errors():
with pytest.raises( exceptions.RPCError ): with pytest.raises( exceptions.RPCError ):
staking.get_validator_information_by_block_number( "", 1, fake_shard ) staking.get_validator_information_by_block_number( "", 1, fake_shard )
with pytest.raises( exceptions.RPCError ): with pytest.raises( exceptions.RPCError ):
staking.get_all_validator_information( -1, fake_shard ) staking.get_all_validator_information( 0, fake_shard )
with pytest.raises( exceptions.RPCError ): with pytest.raises( exceptions.RPCError ):
staking.get_validator_self_delegation( "", fake_shard ) staking.get_validator_self_delegation( "", fake_shard )
with pytest.raises( exceptions.RPCError ): with pytest.raises( exceptions.RPCError ):

Loading…
Cancel
Save