Skip to content

Getting 'Signature verification failed' in methods.x.view() #8

@metaproph3t

Description

@metaproph3t

When I try to use the .view() functionality provided by Anchor, I get a 'Signature verification failed' error.

For example, the following code gives this error (in bankrun, but not in normal anchor):

await clobProgram.methods                                                                                                                         
        .getMarketMakerBalances(failMM.publicKey)                                                                                                       
        .accounts({                                                                                                                                     
          orderBook: failMarket,                                                                                                                        
        })                                                                                                                                                                                                                                                                        
       .view();

A workaround is to pass the signer as a payer, like so:

await clobProgram.methods                                                                                                                         
        .getMarketMakerBalances(failMM.publicKey)                                                                                                       
        .accounts({                                                                                                                                     
          orderBook: failMarket,                                                                                                                        
        })                                                         
       .signers([payer])                                                                                                                                                                                                               
       .view();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions