Introduce NFT support (XLS020)

This commit is contained in:
Nik Bougalis
2021-08-13 20:41:11 -07:00
committed by manojsdoshi
parent 525aaecbca
commit 70779f6850
97 changed files with 10386 additions and 774 deletions

View File

@@ -75,6 +75,13 @@ public:
// elsewhere.
continue;
}
if (flag == asfAuthorizedNFTokenMinter)
{
// The asfAuthorizedNFTokenMinter flag requires the
// presence or absence of the sfNFTokenMinter field in
// the transaction. It is tested elsewhere.
continue;
}
else if (
std::find(goodFlags.begin(), goodFlags.end(), flag) !=
goodFlags.end())
@@ -398,6 +405,18 @@ public:
env(rate(gw, 2.0));
env.close();
// Because we're hacking the ledger we need the account to have
// non-zero sfMintedNFTokens and sfBurnedNFTokens fields. This
// prevents an exception when the AccountRoot template is applied.
{
uint256 const nftId0{token::getNextID(env, gw, 0u)};
env(token::mint(gw, 0u));
env.close();
env(token::burn(gw, nftId0));
env.close();
}
// Note that we're bypassing almost all of the ledger's safety
// checks with this modify() call. If you call close() between
// here and the end of the test all the effort will be lost.