Skip to content

Commit

Permalink
Update the project layout a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Jan 15, 2024
1 parent efc55e1 commit 2ca3ee9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 27 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ python = "^3.10"
setuptools = "^69.0.3"
web3 = "*"


[tool.poetry.group.dev.dependencies]
ipdb = "^0.13.13"
eth-ape = "^0.7.3"
Expand Down
2 changes: 2 additions & 0 deletions src/TermsOfService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import "@openzeppelin/access/Ownable.sol";
import "@openzeppelin/utils/cryptography/SignatureChecker.sol";




/**
* Minimal MVP interface
*/
Expand Down
19 changes: 17 additions & 2 deletions terms_of_service/acceptance_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"""
import datetime

from eth_account.datastructures import SignedMessage
from eth_account.messages import encode_defunct, _hash_eip191_message
from eth_account.signers.local import LocalAccount

DEFAULT_ACCEPTANCE_MESSAGE_TEMPLATE = """
I read and agree on terms of service (version {version}) to use
Expand Down Expand Up @@ -47,5 +49,18 @@ def get_signing_hash(message: str) -> bytes:
return hash


def get_initial_hash() -> bytes:
""""""
def sign_terms_of_service(
user: LocalAccount,
signable_message: str,
) -> tuple[bytes, bytes]:
"""Sign terms of service for a local dev test account.
:return:
Tuple (message hash, signed message)
"""

assert isinstance(user, LocalAccount)
message_hash = get_signing_hash(signable_message)
signed_message = user.signHash(message_hash)
# import ipdb ; ipdb.set_trace()
return message_hash, signed_message.signature
24 changes: 0 additions & 24 deletions test/Counter.t.sol

This file was deleted.

0 comments on commit 2ca3ee9

Please sign in to comment.