EOSCommunity.org Forums

Unable to load action data on mobile

Hello! I’ve noticed when an action uses a variant as a parameter, the mobile app in not able to sign the transaction.

I get an error like the attached image

I do not get this error when using the desktop version.

This is the abi of the contract I’m using if this is helpful:

Device: iPhone 11 iOS 14.7.1
Anchor version: 1.2.1

Any help is appreciated.
Thanks!

Hey thanks for the heads up on that - we will try to reproduce the error and see if we can find the solution.

My guess is that the serializer we wrote for iOS has a small bug in it with the variant you mentioned.

Thanks for the reply. If you need help reproducing it I’m more than willing to assist!

1 Like

If the ABI was changed recently it could simply be that Anchor has a stale copy, try tapping five times on the logo and got to the “ABI cache viewer” and press the trashcan icon in the corner to clear the cache.

If that doesn’t fix it please provide a sample action (or esr) that reproduces the encoding issue and we can investigate further

Thanks for the reply. I tested cleaning up the cache but got the same error. I created a minimal example to reproduce the issue: GitHub - jandrad/anchor-variant-bug

I provided some hydra tests that run without issue on the repository.

This can be tested using this action: https://wax-test.bloks.io/account/anchortests1?loadContract=true&tab=Actions&account=anchortests1&scope=anchortests1&limit=100&action=addproofown

Parameters:

authorized_account: ***YOUR_ACCOUNT***
group: {"logical_operator":0,"filters":[["COLLECTION_HOLDINGS",{"collection_name":"alpacaworlds","comparison_operator":3,"amount":1}]]}

Let me know if this is helpful or if I can provide more info.

Thanks for that detailed reproduction code, I was able to reproduce and implement a fix: Resolve type aliases after type modifiers · greymass/swift-eosio@40031b8 · GitHub

We’ll get that included in the next AppStore release, in the meantime you can work around it by modifying your ABI to not use type aliases with modifiers (use variant_TOKEN_HOLDING_TEMPLATE_HOLDINGS_COLLECTION_HOLDINGS_SCHEMA_HOLDINGS[] instead of FILTERS[] in the LOGICAL_GROUP type).

Thank you very much!!! I will implement the workaround in the meantime :+1:

1 Like