Closed matterai closed 10 months ago
Assume I have a code simply fetches a transaction. Then I take specific instruction and try to call ResolveInstructionAccounts method. It returns me an error: cannot build account meta list without address tables.
ResolveInstructionAccounts
cannot build account meta list without address tables
Code running:
tx, err := rpcService.GetTransactionInfo(logEvent.Value.Signature) if err != nil { return err } idoPurchase := tx.Message.Instructions[4] accounts, err := idoPurchase.ResolveInstructionAccounts(&tx.Message) // Error returns here! if err != nil { return err } inst, err := system.DecodeInstruction(accounts, idoPurchase.Data) if err != nil { return err } spew.Dump(inst)
Transaction I fetch using code from docs. Code for fetching transaction looks like this:
func (s *SolanaRpcService) GetTransactionInfo(signature solana.Signature) (*solana.Transaction, error) { version := uint64(0) out, err := s.rpcClient.GetTransaction( context.Background(), signature, &rpc.GetTransactionOpts{ Encoding: solana.EncodingBase64, MaxSupportedTransactionVersion: &version, }, ) if err != nil { return nil, err } tx, err := solana.TransactionFromDecoder(bin.NewBinDecoder(out.Transaction.GetBinary())) if err != nil { return nil, err } return tx, nil }
I am not quite sure what am I doing wrong? Please, elaborate me or give me a reference to the doc part which I missed.
You need to resolve the address table lookups first
https://github.com/gagliardetto/solana-go#address-lookup-tables
Yep it's worked. Thank you.
Assume I have a code simply fetches a transaction. Then I take specific instruction and try to call
ResolveInstructionAccounts
method. It returns me an error:cannot build account meta list without address tables
.Code running:
Transaction I fetch using code from docs. Code for fetching transaction looks like this:
I am not quite sure what am I doing wrong? Please, elaborate me or give me a reference to the doc part which I missed.