Skip to content

Commit 2809b34

Browse files
committed
Add support for ByteString type in PlutusData
1 parent 789b077 commit 2809b34

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/pycardano/test_plutus.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ class A(PlutusData):
405405
CONSTR_ID = 0
406406
a: int
407407
b: bytes
408-
c: List[int]
408+
c: ByteString
409+
d: List[int]
409410

410411
@dataclass
411412
class C(PlutusData):
@@ -424,7 +425,7 @@ class B(PlutusData):
424425
s = id_map(B)
425426
assert (
426427
s
427-
== "cons[B](1013743048;a:int,c:cons[A](0;a:int,b:bytes,c:list<int>),d:map<bytes,cons[C](892310804;x:any,y:any,z:any,w:list)>,e:union<cons[A](0;a:int,b:bytes,c:list<int>),cons[C](892310804;x:any,y:any,z:any,w:list)>)"
428+
== "cons[B](3809077817;a:int,c:cons[A](0;a:int,b:bytes,c:bytes,d:list<int>),d:map<bytes,cons[C](892310804;x:any,y:any,z:any,w:list)>,e:union<cons[A](0;a:int,b:bytes,c:bytes,d:list<int>),cons[C](892310804;x:any,y:any,z:any,w:list)>)"
428429
)
429430

430431

@@ -438,9 +439,7 @@ class A(PlutusData):
438439
"The line separating good and evil passes ... right through every human heart."
439440
)
440441

441-
quote_hex = (
442-
"d8799f5f5840546865206c696e652073657061726174696e6720676f6f6420616e64206576696c20706173736573202e2e2e207269676874207468726f7567682065766572794d2068756d616e2068656172742effff"
443-
)
442+
quote_hex = "d8799f5f5840546865206c696e652073657061726174696e6720676f6f6420616e64206576696c20706173736573202e2e2e207269676874207468726f7567682065766572794d2068756d616e2068656172742effff"
444443

445444
A_tmp = A(ByteString(quote.encode()))
446445

0 commit comments

Comments
 (0)