-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
125 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package signer | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/cometbft/cometbft/libs/protoio" | ||
cometprotoprivval "github.com/cometbft/cometbft/proto/tendermint/privval" | ||
) | ||
|
||
// ReadMsg reads a message from an io.Reader | ||
func ReadMsg(reader io.Reader) (msg cometprotoprivval.Message, err error) { | ||
const maxRemoteSignerMsgSize = 1024 * 10 | ||
protoReader := protoio.NewDelimitedReader(reader, maxRemoteSignerMsgSize) | ||
_, err = protoReader.ReadMsg(&msg) | ||
return msg, err | ||
} | ||
|
||
// WriteMsg writes a message to an io.Writer | ||
func WriteMsg(writer io.Writer, msg cometprotoprivval.Message) (err error) { | ||
protoWriter := protoio.NewDelimitedWriter(writer) | ||
_, err = protoWriter.WriteMsg(&msg) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters