Skip to content

Commit 1f9f937

Browse files
committed
Updates settings for testing with venv
1 parent 3917393 commit 1f9f937

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

convex_api/convex.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ def transact(self, transaction: str, account: Account, sequence_retry_count: int
284284
while sequence_retry_count >= 0:
285285
try:
286286
hash_data = self._transaction_prepare(transaction, account.address)
287+
if hash_data.hash is None:
288+
raise ValueError('Transaction preparation failed: hash is None')
287289
signed_data = account.sign(hash_data.hash)
288290
result = self._transaction_submit(account.address, account.key_pair.public_key_api, hash_data.hash, signed_data)
289291
except ConvexAPIError as error:

convex_api/key_pair.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def import_from_mnemonic(words: str) -> KeyPair:
546546

547547
mnemonic = Mnemonic('english')
548548
value = mnemonic.to_entropy(words)
549-
return KeyPair(Ed25519PrivateKey.from_private_bytes(value))
549+
return KeyPair(Ed25519PrivateKey.from_private_bytes(bytes(value)))
550550

551551
@staticmethod
552552
def import_from_file(filename: str, password: str | bytes) -> KeyPair:

convex_api/models.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ErrorResponse(BaseModel):
1414

1515
class CreateAccountRequest(BaseModel):
1616
"""REST API request for a create account request."""
17-
accountKey: str = Field(None, min_length=64, max_length=64)
17+
accountKey: str | None = Field(None, min_length=64, max_length=64)
1818

1919

2020
class CreateAccountResponse(BaseModel):
@@ -61,22 +61,23 @@ class PrepareTransactionRequest(BaseModel):
6161
"""REST API request for a prepare transaction request."""
6262
address: int
6363
source: str
64+
sequence: int | None = None
6465

6566

6667
class PrepareTransactionResponse(BaseModel):
6768
"""REST API response from a prepare transaction request."""
6869
address: int
69-
hash: str = Field(None, min_length=64, max_length=64)
70+
hash: str | None = Field(None, min_length=64, max_length=64)
7071
sequence: int
7172
source: str
7273

7374

7475
class SubmitTransactionRequest(BaseModel):
7576
"""REST API request for a submit transaction request."""
7677
address: int
77-
accountKey: str = Field(None, min_length=64, max_length=64)
78-
hash: str = Field(None, min_length=64, max_length=64)
79-
sig: str = Field(None, min_length=128, max_length=128)
78+
accountKey: str | None = Field(None, min_length=64, max_length=64)
79+
hash: str | None = Field(None, min_length=64, max_length=64)
80+
sig: str | None = Field(None, min_length=128, max_length=128)
8081

8182

8283
class SubmitTransactionResponse(BaseModel):

0 commit comments

Comments
 (0)