Closed GoudanWoo closed 8 months ago
if I try to call rpc with option encoding: base64
, it will return:
{
"jsonrpc": "2.0",
"result": {
"blockTime": 1710904462,
"slot": 255260375,
"transaction": [
"...",
"base64"
],
"version": "legacy"
},
"id": "24c1f13e-93f0-4e4b-9d13-ea84c8b65ed5"
}
{
"jsonrpc": "2.0",
"result": {
"blockTime": 1711158614,
"slot": 255862259,
"transaction": [
"...",
"base64"
],
"version": 0
},
"id": "24c1f13e-93f0-4e4b-9d13-ea84c8b65ed5"
}
I found that
so it is my misunderstanding.
You defined
LegacyMessage
as0
andVersionedMessage
as1
.https://github.com/gagliardetto/solana-go/blob/a8900f8a1f2cddbd2dc09c81d036eeb956274ac8/message.go#L84-L87
But according to the docs,
LegacyMessage
isnil
andVersionedMessage
is0
.legacy demo
2PrNuegoDfneMGVAf1akbNPo1omkpNX7yZxYhwH42AWYD78wA6c3ZE5wYdRtL6fAMwjCpAjFVsviubFiWDSNhU3Y
rpc will return:
you can see that
.result.version
isundefined
/nil
.and GetTransaction return:
versioned demo
Gb3VpwEi4s6ikQ32iwcaJUd8zk8NqEYARe8QvsDNq554Bsb8X7RC1gPGEtq6iURwiUAEXzAngqU7vh2Dch3NUzf
rpc will return:
you can see that
.result.version
is0
.and GetTransaction return:
so all unmarshal and marshal of transaction message may have bugs.