Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankC01 committed Jan 21, 2023
1 parent 2c63e6f commit aff6d04
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- More documentation

### Fixed

- [bug](https://github.com/FrankC01/pysui/issues/62)
- [bug](https://github.com/FrankC01/pysui/issues/63)
- [bug](https://github.com/FrankC01/pysui/issues/64)

### Changed

### Removed
Expand Down
2 changes: 1 addition & 1 deletion pysui/sui/sui_builders/get_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def __init__(self, *, digest: SuiTransactionDigest):


class GetDelegatedStakes(_NativeTransactionBuilder):
"""sui_getDelegatedStakes."""
"""GetDelegatedStakes return all [DelegatedStake] coins for address owner."""

@sui_builder()
def __init__(self, owner: SuiAddress):
Expand Down
14 changes: 10 additions & 4 deletions pysui/sui/sui_txresults/single_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,21 +647,27 @@ class Delegation(DataClassJsonMixin):
"""From sui_getDelegatedStakes."""

delegation_id: dict = field(metadata=config(field_name="id"))
pool_tokens: int
principle_sui_amount: Union[dict, int]
pool_tokens: Union[dict, int]
principal_sui_amount: int
staked_sui_id: str

def __post_init__(self):
"""Post hydrate parameter fixups."""
self.principle_sui_amount = self.principle_sui_amount["value"]
self.delegation_id = self.delegation_id["id"]
self.pool_tokens = self.pool_tokens["value"]


@dataclass
class DelegatedStake(DataClassJsonMixin):
"""From sui_getDelegatedStakes."""

staked_sui: StakedSui
delegation_status: Union[str, Delegation]
delegation_status: Union[str, dict]

def __post_init__(self):
"""Post hydrate parameter fixups."""
if isinstance(self.delegation_status, dict):
self.delegation_status = Delegation.from_dict(self.delegation_status["Active"])


@dataclass
Expand Down

0 comments on commit aff6d04

Please sign in to comment.