Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 14 additions & 14 deletions genlayer_py/transactions/fees.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class MessageType(IntEnum):

class FeesDistributionInput(TypedDict, total=False):
leaderTimeunitsAllocation: BigNumberish
leader_timeunits_allocation: BigNumberish
leader_time_units_allocation: BigNumberish
validatorTimeunitsAllocation: BigNumberish
validator_timeunits_allocation: BigNumberish
validator_time_units_allocation: BigNumberish
appealRounds: BigNumberish
appeal_rounds: BigNumberish
executionBudgetPerRound: BigNumberish
Expand Down Expand Up @@ -54,9 +54,9 @@ class FeesDistribution(TypedDict):

class InternalMessageFeeParamsInput(TypedDict, total=False):
leaderTimeunitsAllocation: BigNumberish
leader_timeunits_allocation: BigNumberish
leader_time_units_allocation: BigNumberish
validatorTimeunitsAllocation: BigNumberish
validator_timeunits_allocation: BigNumberish
validator_time_units_allocation: BigNumberish
appealRounds: BigNumberish
appeal_rounds: BigNumberish
executionBudgetPerRound: BigNumberish
Expand Down Expand Up @@ -368,15 +368,15 @@ def create_fees_distribution(
_get(
fee_distribution,
"leaderTimeunitsAllocation",
"leader_timeunits_allocation",
"leader_time_units_allocation",
),
"fees.distribution.leaderTimeunitsAllocation",
),
"validatorTimeunitsAllocation": to_uint(
_get(
fee_distribution,
"validatorTimeunitsAllocation",
"validator_timeunits_allocation",
"validator_time_units_allocation",
),
"fees.distribution.validatorTimeunitsAllocation",
),
Expand Down Expand Up @@ -444,15 +444,15 @@ def encode_internal_message_fee_params(
_get(
params,
"leaderTimeunitsAllocation",
"leader_timeunits_allocation",
"leader_time_units_allocation",
),
"internalMessageFeeParams.leaderTimeunitsAllocation",
),
to_uint(
_get(
params,
"validatorTimeunitsAllocation",
"validator_timeunits_allocation",
"validator_time_units_allocation",
),
"internalMessageFeeParams.validatorTimeunitsAllocation",
),
Expand Down Expand Up @@ -1125,15 +1125,15 @@ def build_estimated_fees_distribution(
"leaderTimeunitsAllocation": _get(
options,
"leaderTimeunitsAllocation",
"leader_timeunits_allocation",
"leader_time_units_allocation",
default=DEFAULT_LEADER_TIMEUNITS_ALLOCATION
if policy["enabled"]
else 0,
),
"validatorTimeunitsAllocation": _get(
options,
"validatorTimeunitsAllocation",
"validator_timeunits_allocation",
"validator_time_units_allocation",
default=DEFAULT_VALIDATOR_TIMEUNITS_ALLOCATION
if policy["enabled"]
else 0,
Expand Down Expand Up @@ -1193,12 +1193,12 @@ def _validator_index(num_of_validators: int) -> int:
def _calculate_fee_for_round(
num_of_validators: int,
rotations: int,
leader_timeunits_allocation: int,
validator_timeunits_allocation: int,
leader_time_units_allocation: int,
validator_time_units_allocation: int,
) -> int:
return rotations * (
leader_timeunits_allocation
+ num_of_validators * validator_timeunits_allocation
leader_time_units_allocation
+ num_of_validators * validator_time_units_allocation
)


Expand Down
2 changes: 1 addition & 1 deletion genlayer_py/types/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def _decode_pending_transactions(
),
"value": int.from_bytes(pending_transaction[2], byteorder="big"),
"on": (
"accepted"
"decided"
if int.from_bytes(pending_transaction[3], byteorder="big") == 0
else "finalized"
),
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/contracts/log_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class StoreValue:

# contract class
class LogIndexer(gl.contract.Contract):
vector_store: gle.VecDB[np.float32, typing.Literal[384], StoreValue]
vector_store: gle.VecDB[
np.float32, typing.Literal[384], StoreValue, gle.EuclideanDistance
]

def __init__(self):
pass
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/contracts/simple_time_contract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {
# "Seq": [
# { "Depends": "py-lib-genlayer-embeddings:09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" },
# { "Depends": "py-genlayer:1j12s63yfjpva9ik2xgnffgrs6v44y1f52jvj9w7xvdn7qckd379" }
# { "Depends": "py-lib-genlayer-embeddings:hqpree1t3470fnac2aeee1y5c2205k22bgk1p98sg8m3s1ndmxbg" },
# { "Depends": "py-genlayer:5jycge4q8k23462jtb0b9fyey1s9qz928sz2nbrd9mg4sxqg2qng" }
# ]
# }

Expand Down
Loading