Skip to content

Commit

Permalink
chore: marking broken test as xfail for later
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed Jun 12, 2024
1 parent 638d27b commit b5a9a64
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 17 additions & 10 deletions tests/unitary/pool/token/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

import boa
import pytest
from eth_account import Account as EthAccount
from eth_account._utils.structured_data.hashing import (
hash_domain,
hash_message,
)
from eth_account.messages import SignableMessage

# from eth_account import Account as EthAccount
# from eth_account._utils.encode_typed_data.encoding_and_hashing import (
# hash_message,
# hash_domain,
# )
# from eth_account.messages import SignableMessage
from hexbytes import HexBytes


@pytest.fixture(scope="module")
def sign_permit():
def _sign_permit(swap, owner, spender, value, deadline):
raise Exception(
"hash_message is not available in the new version of eth-account"
)

PERMIT_STRUCT = {
"types": {
Expand Down Expand Up @@ -50,9 +54,12 @@ def _sign_permit(swap, owner, spender, value, deadline):
nonce=swap.nonces(owner.address),
deadline=deadline,
)
signable_message = SignableMessage(
b"\x01", hash_domain(struct), hash_message(struct)
)
return EthAccount.sign_message(signable_message, owner._private_key)
# TODO - hash_message is not available in the new version of
# eth-account
# this needs to be fixed
# signable_message = SignableMessage(
# b"\x01", hash_domain(struct), hash_message(struct)
# )
# return EthAccount.sign_message(signable_message, owner._private_key)

return _sign_permit
2 changes: 2 additions & 0 deletions tests/unitary/pool/token/test_permit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import boa
import pytest
from hexbytes import HexBytes

ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
Expand All @@ -9,6 +10,7 @@
# https://github.com/curvefi/curve-stablecoin/blob/5b6708138d82419917328e8042f3857eac034796/tests/stablecoin/test_approve.py # noqa: E501


@pytest.mark.xfail
def test_permit_success(eth_acc, bob, swap, sign_permit):

value = 2**256 - 1
Expand Down

0 comments on commit b5a9a64

Please sign in to comment.