Skip to content

Commit

Permalink
check guid
Browse files Browse the repository at this point in the history
  • Loading branch information
wizd committed Nov 6, 2022
1 parent 7a5371f commit 5d734a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Core/Lyra.Core/Authorizers/TokenGenesisAuthorizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ protected override async Task<APIResultCodes> AuthorizeImplAsync<T>(DagSystem sy
if(block.DomainName.ToLower() != block.DomainName)
return APIResultCodes.InvalidDomainName; // make sure domain name is lower case.

if (block.DomainName == "nft" && block.Ticker.ToLower() != block.Ticker)
return APIResultCodes.InvalidTickerName; // make sure guid is lower case.

if (r.IsMatch(block.Ticker.Replace(block.DomainName + "/", "")))
return APIResultCodes.InvalidTickerName;

Expand Down
4 changes: 4 additions & 0 deletions Tests/UnitTests/UT_NFT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public async Task NFT_Tests()
// xtest for a dynamic chain
await SetupWallets("devnet");

//var ticker = "nft/a346b16b-ca6c-4c86-9519-1e72fd517e9B";
//var retg = await testWallet.RPC.GetTokenGenesisBlockAsync(testPublicKey, ticker, "aaa");
//Assert.IsTrue(retg.Successful());
//return;
//await BurnAllNFT();
//return;

Expand Down

0 comments on commit 5d734a4

Please sign in to comment.