use tokenObj in burn (#156)

* use tokenObj in burn

* refactor token serialization

* add tests

* rename
This commit is contained in:
calle
2023-04-01 00:46:56 +02:00
committed by GitHub
parent 73f8c277b9
commit 2ded9c8b5c
5 changed files with 65 additions and 36 deletions

View File

@@ -235,7 +235,7 @@ async def serialize_TokenV2_to_TokenV3(wallet: Wallet, tokenv2: TokenV2):
tokenv3 = TokenV3(token=[TokenV3Token(proofs=tokenv2.proofs)])
if tokenv2.mints:
tokenv3.token[0].mint = tokenv2.mints[0].url
token_serialized = await wallet._serialize_token_V3(tokenv3)
token_serialized = tokenv3.serialize()
return token_serialized
@@ -248,5 +248,5 @@ async def serialize_TokenV1_to_TokenV3(wallet: Wallet, tokenv1: TokenV1):
TokenV3: TokenV3
"""
tokenv3 = TokenV3(token=[TokenV3Token(proofs=tokenv1.__root__)])
token_serialized = await wallet._serialize_token_V3(tokenv3)
token_serialized = tokenv3.serialize()
return token_serialized