You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
types.EventRecordsRaw(*storageDataRaw).DecodeEventRecords(metadata, &events0) has a err for "Encoded array length is higher than allowed by the protocol (32-bit unsigned integer)"
the err appear at codec.go, because the event System_ExtrinsicSuccess.DispatchInfo.Weight.RefTime is a uint64 format, but the sdk restricted to uint32, when it over uint32, there will be return this err. in my test code, the blockNumber(number) is 12472776
my code detail is:
import (
"encoding/hex"
"encoding/json"
"fmt"
gsrpc "github.com/centrifuge/go-substrate-rpc-client/v4"
"github.com/centrifuge/go-substrate-rpc-client/v4/registry"
"github.com/centrifuge/go-substrate-rpc-client/v4/registry/parser"
"github.com/centrifuge/go-substrate-rpc-client/v4/registry/state"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types/codec"
"github.com/vedhavyas/go-subkey/v2"
"io/ioutil"
"net/http"
"strconv"
"strings"
)
func getEvents(number int, hash, url string) {
api, err := gsrpc.NewSubstrateAPI(url)
if err != nil {
panic("NewSubstrateAPI")
}
}
call the func getEvents in a main func like this:
func main() {
getEvents(12472776, "hash", "https://docs-demo.dot-mainnet.quiknode.pro/")
}
The text was updated successfully, but these errors were encountered: