(defaults?: Partial<TokenDetails>)
| 396 | * @returns Synthetic NFT token details. |
| 397 | */ |
| 398 | export const randomNFT = (defaults?: Partial<TokenDetails>): TokenDetails => ({ |
| 399 | ...{ |
| 400 | category: binToHex(sha256(bigIntToVmNumber(randomInt()))), |
| 401 | amount: 0n, |
| 402 | nft: { |
| 403 | commitment: binToHex(sha256(bigIntToVmNumber(randomInt()))).slice(0, 8), |
| 404 | capability: NonFungibleTokenCapability.none, |
| 405 | }, |
| 406 | }, |
| 407 | ...defaults, |
| 408 | }); |
| 409 | |
| 410 | // https://stackoverflow.com/questions/40929260/find-last-index-of-element-inside-array-by-certain-condition |
| 411 | export function findLastIndex<T>(array: Array<T>, predicate: (value: T, index: number, obj: T[]) => boolean): number { |
no test coverage detected