Getting error while using EvolvableTokenType in token-sdk


nehal.shah@...
 

We are getting following error while trying to move the EvolvableToken in our junit test using MoveNonFungibleTokens flow. In our code first we create the token then we issue and then try to move.

 java.lang.IllegalArgumentException: Your query wasn't specific enough and returned multiple non-fungible tokens.
at com.r3.corda.lib.tokens.workflows.internal.selection.NonFungibleTokenSelectionKt.generateMoveNonFungible(NonFungibleTokenSelection.kt:32) ~[tokens-workflows-1.0.jar:?]
at com.r3.corda.lib.tokens.workflows.internal.selection.NonFungibleTokenSelectionKt.generateMoveNonFungible(NonFungibleTokenSelection.kt:46) ~[tokens-workflows-1.0.jar:?]

Any idea? 


sneha.damle@...
 

Hi Nehal,

You have created one non fungible token based on EvolvableTokenType. You now want to move this token. Move flow hits the database to get this token by the query criteria which you specified. It is expected that when you issue a non fungible token, it is a unique token based off the EvolvableTokenType having a unique linearId.There is a possibility that at this point of time your vault contains multiple non fungible tokens each of same EvolvableTokenType(eg you can have multiple non fungible tokens based on same "Gold" token type each having different custodian address). So make sure that the query criteria you pass in always returns only the token which you are interested in. You could use the linearId to get a unique result in such a case, as non-fungible tokens are at the end LinearStates.