style(x/auth): improve code readability and update exported function comment (#18749)

This commit is contained in:
lilas 2023-12-15 16:44:28 +08:00 committed by GitHub
parent 00f4c14750
commit e84bb238c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,7 @@ func SignTxWithSignerAddress(txFactory tx.Factory, clientCtx client.Context, add
return tx.Sign(clientCtx.CmdContext, txFactory, name, txBuilder, overwrite)
}
// Read and decode a StdTx from the given filename. Can pass "-" to read from stdin.
// ReadTxFromFile read and decode a StdTx from the given filename. Can pass "-" to read from stdin.
func ReadTxFromFile(ctx client.Context, filename string) (tx sdk.Tx, err error) {
var bytes []byte
@ -115,11 +115,10 @@ func ReadTxFromFile(ctx client.Context, filename string) (tx sdk.Tx, err error)
return ctx.TxConfig.TxJSONDecoder()(bytes)
}
// Read and decode a multi transactions (must be in Txs format) from the given filename.
// ReadTxsFromFile read and decode a multi transactions (must be in Txs format) from the given filename.
// Can pass "-" to read from stdin.
func ReadTxsFromFile(ctx client.Context, filename string) (tx []sdk.Tx, err error) {
func ReadTxsFromFile(ctx client.Context, filename string) (txs []sdk.Tx, err error) {
var fileBuff []byte
var txs []sdk.Tx
if filename == "-" {
fileBuff, err = io.ReadAll(os.Stdin)