File tree Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ async def create_program(
364
364
runtime : str ,
365
365
metadata : Optional [dict [str , Any ]] = None ,
366
366
address : Optional [str ] = None ,
367
+ payment : Optional [Payment ] = None ,
367
368
vcpus : Optional [int ] = None ,
368
369
memory : Optional [int ] = None ,
369
370
timeout_seconds : Optional [float ] = None ,
@@ -387,6 +388,7 @@ async def create_program(
387
388
:param runtime: Runtime to use
388
389
:param metadata: Metadata to attach to the message
389
390
:param address: Address to use (Default: account.get_address())
391
+ :param payment: Payment method used to pay for the program (Default: None)
390
392
:param vcpus: Number of vCPUs to allocate (Default: 1)
391
393
:param memory: Memory in MB for the VM to be allocated (Default: 128)
392
394
:param timeout_seconds: Timeout in seconds (Default: 30.0)
Original file line number Diff line number Diff line change @@ -410,6 +410,7 @@ async def create_program(
410
410
runtime : str ,
411
411
metadata : Optional [dict [str , Any ]] = None ,
412
412
address : Optional [str ] = None ,
413
+ payment : Optional [Payment ] = None ,
413
414
vcpus : Optional [int ] = None ,
414
415
memory : Optional [int ] = None ,
415
416
timeout_seconds : Optional [float ] = None ,
@@ -433,6 +434,7 @@ async def create_program(
433
434
runtime = runtime ,
434
435
metadata = metadata ,
435
436
address = address ,
437
+ payment = payment ,
436
438
vcpus = vcpus ,
437
439
memory = memory ,
438
440
timeout_seconds = timeout_seconds ,
Original file line number Diff line number Diff line change @@ -100,7 +100,3 @@ class TokenType(str, Enum):
100
100
101
101
GAS = "GAS"
102
102
ALEPH = "ALEPH"
103
- filename : Optional [str ] = Field (default = None )
104
- hash : Optional [str ] = Field (default = None )
105
- url : Optional [str ] = Field (default = None )
106
- error : Optional [str ] = Field (default = None )
Original file line number Diff line number Diff line change 27
27
)
28
28
from uuid import UUID
29
29
from zipfile import BadZipFile , ZipFile
30
-
31
30
import pydantic_core
31
+
32
32
from aleph_message .models import (
33
33
Chain ,
34
34
InstanceContent ,
@@ -206,8 +206,6 @@ def extended_json_encoder(obj: Any) -> Any:
206
206
207
207
208
208
def parse_volume (volume_dict : Union [Mapping , MachineVolume ]) -> MachineVolume :
209
- # Python 3.9 does not support `isinstance(volume_dict, MachineVolume)`,
210
- # so we need to iterate over all types.
211
209
if any (
212
210
isinstance (volume_dict , volume_type ) for volume_type in get_args (MachineVolume )
213
211
):
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ async def test_get_program_price_valid():
11
11
Test that the get_program_price method returns the correct PriceResponse
12
12
when given a valid item hash.
13
13
"""
14
- expected_response = {
15
- " required_tokens" : 3.0555555555555556e-06 ,
16
- " payment_type" : "superfluid" ,
17
- }
18
- mock_session = make_mock_get_session (expected_response )
14
+ expected = PriceResponse (
15
+ required_tokens = 3.0555555555555556e-06 ,
16
+ payment_type = "superfluid" ,
17
+ )
18
+ mock_session = make_mock_get_session (expected . dict () )
19
19
async with mock_session :
20
20
response = await mock_session .get_program_price ("cacacacacacaca" )
21
- assert response == PriceResponse ( ** expected_response ) # type: ignore
21
+ assert response == expected
22
22
23
23
24
24
@pytest .mark .asyncio
You can’t perform that action at this time.
0 commit comments