Skip to content

Commit

Permalink
Return RPC call
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Aug 24, 2023
1 parent cfd7541 commit baf13be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/noderpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package noderpc
import (
"bytes"
"context"
stdJSON "encoding/json"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -267,7 +268,11 @@ func (rpc *NodeRPC) GetRawScript(ctx context.Context, address string, level int6

// GetScriptStorageRaw -
func (rpc *NodeRPC) GetScriptStorageRaw(ctx context.Context, address string, level int64) ([]byte, error) {
return rpc.getRaw(ctx, fmt.Sprintf("chains/main/blocks/%s/context/contracts/%s/storage", getBlockString(level), address))
var response struct {
Storage stdJSON.RawMessage `json:"storage"`
}
err := rpc.get(ctx, fmt.Sprintf("chains/main/blocks/%s/context/contracts/%s/script", getBlockString(level), address), &response)
return response.Storage, err
}

// GetContractBalance -
Expand Down

0 comments on commit baf13be

Please sign in to comment.