MCPcopy Create free account
hub / github.com/ethstorage/es-node / SendRPC

Function SendRPC

ethstorage/p2p/protocol/utils.go:108–120  ·  view source on GitHub ↗
(stream network.Stream, req interface{}, resp interface{})

Source from the content-addressed store, hash-verified

106}
107
108func SendRPC(stream network.Stream, req interface{}, resp interface{}) (byte, error) {
109 s, err := Send(stream, req)
110 if err != nil {
111 return clientError, err
112 }
113
114 msg, returnCode, err := ReadMsg(s)
115 if err != nil {
116 return returnCode, err
117 }
118
119 return returnCode, rlp.DecodeBytes(msg, resp)
120}
121
122func ConvertToContractShards(shards map[common.Address][]uint64) []*ContractShards {
123 cs := make([]*ContractShards, 0)

Callers 3

RequestShardListMethod · 0.92
RequestBlobsByRangeMethod · 0.85
RequestBlobsByListMethod · 0.85

Calls 2

SendFunction · 0.85
ReadMsgFunction · 0.85

Tested by

no test coverage detected