Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add view decorator on dozer_pool and change types import #1183

Open
wants to merge 1 commit into
base: experimental/nano-testnet-v1.6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions hathor/nanocontracts/blueprints/dozer_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
from hathor.nanocontracts.blueprint import Blueprint
from hathor.nanocontracts.context import Context
from hathor.nanocontracts.exception import NCFail
from hathor.nanocontracts.types import NCAction, NCActionType, public, view
from hathor.types import Address, Amount, Timestamp, TokenUid
from hathor.nanocontracts.types import (
Address,
Amount,
Timestamp,
TokenUid,
NCAction,
NCActionType,
public,
view,
)

PRECISION = 10**20

Expand Down Expand Up @@ -670,6 +678,7 @@ def pool_info(
"fee": str(self.fee_numerator / 10),
}

@view
def user_info(
self,
address: Address,
Expand All @@ -688,6 +697,7 @@ def user_info(
"max_withdraw_b": max_withdraw_b,
}

@view
def pool_data(
self,
) -> dict[str, float]:
Expand Down