gagliardetto / solana-go

Go SDK library and RPC client for the Solana Blockchain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[HELP] GetBlockWithOpts using GetParsedTransaction not working in the version v1.8.4

elvis-hp opened this issue · comments

received the error: "detailedTx.GetParsedTransaction data is not in JSONParsed encoding"
Code:

            var maxUint uint64 = 0
            blockInfo, err := e.RpcClient.GetBlockWithOpts(context.Background(), fromBlock, &rpc.GetBlockOpts{
              MaxSupportedTransactionVersion: &maxUint,
            })
            for _, tx := range blockInfo.Transactions {
		txParsed, err := tx.GetParsedTransaction()
		if err != nil {
			fmt.Println("detailedTx.GetParsedTransaction", err)
			continue
		}			
	}
commented

@elvis-hp This functionality is not fully implemented.
BTW, you can log an error instead of ignoring it, maybe it'll help you

blockInfo, err := e.RpcClient.GetBlockWithOpts(context.Background(), fromBlock, &rpc.GetBlockOpts{
    MaxSupportedTransactionVersion: &maxUint,
 })
+if err != nil {
+   log.Fatal(err)
+}

I'll have a couple of free hours this weekend, so I'll try to extend this functionality and add more options for parsing transactions with meta

yep, the jsonParsed format is not implemented.