guildxyz / guild-network

MIT License
9 stars 1 forks source link

Invalid verification message due to wasm wrapper bug #118

Closed PopcornPaws closed 1 year ago

PopcornPaws commented 1 year ago

Description

The wasm wrapper for the signature verification message in gn-wasm accepts a String and passes it directly to gn_common::utils::verification_msg. However a String is encoded differently than an AccountId on-chain, where the signer of the pallet call is the input for verification_msg. Thus, the message generated at frontend differs from the message generated on-chain, thus verification fails with an AccessDenied error.

Solution

Thankfully, the solution is simple, only the wasm wrapper has to be updated to perform a conversion from the input String into an AccountId and pass that to the verification_msg.