Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(polkadot.js) fix -infinity in keys error by adding genesis field #1573

Merged
merged 4 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chain/dev/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ grandpa = ""
sync = ""

[init]
genesis = "./chain/dev/genesis-spec.json"
genesis = "./chain/dev/genesis.json"

[account]
key = "alice"
Expand Down
2 changes: 1 addition & 1 deletion chain/dev/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
// InitConfig

// DefaultGenesis is the default genesis configuration path
DefaultGenesis = string("./chain/dev/genesis-spec.json")
DefaultGenesis = string("./chain/dev/genesis.json")

// AccountConfig

Expand Down
35 changes: 35 additions & 0 deletions chain/dev/genesis.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dot/rpc/modules/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ func (sm *StateModule) GetStorage(r *http.Request, req *StateStorageRequest, res
)

reqBytes, _ := common.HexToBytes(req.Key) // no need to catch error here

if req.Bhash != nil {
item, err = sm.storageAPI.GetStorageByBlockHash(*req.Bhash, reqBytes)
if err != nil {
Expand Down
7 changes: 5 additions & 2 deletions dot/rpc/subscription/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *WSConn) HandleComm() {
logger.Warn("websocket failed to read message", "error", err)
return
}
logger.Debug("websocket received", "message", mbytes)
logger.Trace("websocket received", "message", mbytes)

// determine if request is for subscribe method type
var msg map[string]interface{}
Expand All @@ -69,11 +69,14 @@ func (c *WSConn) HandleComm() {
c.safeSendError(0, big.NewInt(-32600), "Invalid request")
continue
}

method := msg["method"]
params := msg["params"]
logger.Debug("ws method called", "method", method, "params", params)

// if method contains subscribe, then register subscription
if strings.Contains(fmt.Sprintf("%s", method), "subscribe") {
reqid := msg["id"].(float64)
params := msg["params"]
switch method {
case "chain_subscribeNewHeads", "chain_subscribeNewHead":
bl, err1 := c.initBlockListener(reqid)
Expand Down