55import sentinel_protobuf .sentinel .lease .v1 .querier_pb2_grpc as sentinel_subscription_v2_querier_pb2_grpc
66import sentinel_protobuf .sentinel .subscription .v2 .subscription_pb2 as subscription_pb2
77import sentinel_protobuf .sentinel .lease .v1 .msg_pb2 as msg_pb2
8+ from sentinel_protobuf .sentinel .types .v1 .price_pb2 import Price
9+ from sentinel_protobuf .sentinel .types .v1 .renewal_pb2 import RenewalPricePolicy
810
911from sentinel_sdk .querier .querier import Querier
1012from sentinel_sdk .transactor .transactor import Transactor
11- from sentinel_sdk .types import PageRequest , TxParams , Price , RenewalPricePolicy
13+ from sentinel_sdk .types import PageRequest , TxParams
1214
1315class LeaseModule (Querier , Transactor ):
1416 def __init__ (self , channel : grpc .Channel , account , provider_account , client ):
@@ -21,25 +23,25 @@ def __init__(self, channel: grpc.Channel, account, provider_account, client):
2123
2224 def EndLease (self , subscription_id : int , tx_params : TxParams = TxParams ()):
2325 msg = msg_pb2 .MsgEndLeaseRequest (
24- frm = self ._account .address ,
26+ frm = self ._provider_account .address ,
2527 id = subscription_id ,
2628 )
2729
2830 return self .transaction ([msg ], tx_params )
2931
30- def RenewLease (self , subscription_id : int , hours : int , max_price : Price = Price () , tx_params : TxParams = TxParams ()):
32+ def RenewLease (self , subscription_id : int , hours : int , max_price : Price = Price , tx_params : TxParams = TxParams ()):
3133 msg = msg_pb2 .MsgRenewLeaseRequest (
32- frm = self ._account .address ,
34+ frm = self ._provider_account .address ,
3335 id = subscription_id ,
3436 hours = hours ,
3537 max_price = max_price ,
3638 )
3739
3840 return self .transaction ([msg ], tx_params )
3941
40- def StartLease (self , node : str , hours : int , max_price : Price = Price () , renewal : int = RenewalPricePolicy .RENEWAL_PRICE_POLICY_IF_LESSER_OR_EQUAL , tx_params : TxParams = TxParams ()):
42+ def StartLease (self , node : str , hours : int , max_price : Price , renewal : int = RenewalPricePolicy .RENEWAL_PRICE_POLICY_IF_LESSER_OR_EQUAL , tx_params : TxParams = TxParams ()):
4143 msg = msg_pb2 .MsgStartLeaseRequest (
42- frm = self ._account .address ,
44+ frm = self ._provider_account .address ,
4345 node_address = node ,
4446 hours = hours ,
4547 max_price = max_price ,
@@ -50,7 +52,7 @@ def StartLease(self, node: str, hours: int, max_price: Price = Price(), renewal:
5052
5153 def UpdateLease (self , subscription_id : int , renewal : int = RenewalPricePolicy .RENEWAL_PRICE_POLICY_IF_LESSER_OR_EQUAL , tx_params : TxParams = TxParams ()):
5254 msg = msg_pb2 .MsgUpdateLeaseRequest (
53- frm = self ._account .address ,
55+ frm = self ._provider_account .address ,
5456 id = subscription_id ,
5557 renewal_price_policy = renewal ,
5658 )
0 commit comments