Search code examples
javascripthyperledgerhyperledger-iroha

Can't transfer assets between two Iroha accounts


I'm experimenting with Iroha and Iroha-helpers (a js library to communicate with the network). I'm having issues to process a "TransferAssets" transaction, it gives me a 'STATEFUL_VALIDATION_FAILED' error message, but nothing else about why it's failing.

This happens when I tried to make an asset transfer between 'userA@test' and 'userB@test' . I do not get the same issues IF I perform this transaction with the sender being 'admin@test'. All accounts have a balance of the asset that I'm trying to transfer, and they all have the same role 'user' which has the 'can_transfer' 'can_receive' roles.

This issue only happens when 'admin@test' is not the sender. otherwise it works just fine. Does anyone have an idea on how can I solve this error ?


Solution

  • I figured the solution and it was a silly mistake I was making.

    My understanding of 'CreatorAccountId' was that you always pass the accountId of the domain creator, in my case it was 'admin@test'. However is supposed to be the creator of the transaction. So to solve my issue I just need to pass the accountId of the person/account that was making the transaction, in my case I just needed to pass usera@test as creatorAccountId as well as the the private key of usera@test for signing.