MCPcopy Create free account
hub / github.com/Sifchain/sifnode / BroadCast

Function BroadCast

scripts/cli_tests/broadcast.go:9–28  ·  view source on GitHub ↗
(txf tx.Factory, clientCtx sdkclient.Context, msg sdk.Msg)

Source from the content-addressed store, hash-verified

7)
8
9func BroadCast(txf tx.Factory, clientCtx sdkclient.Context, msg sdk.Msg) *sdk.TxResponse {
10 unsignedTx, err := tx.BuildUnsignedTx(txf, msg)
11 if err != nil {
12 panic(err)
13 }
14 err = tx.Sign(txf, clientCtx.GetFromName(), unsignedTx, true)
15 if err != nil {
16 panic(err)
17 }
18
19 txBytes, err := clientCtx.TxConfig.TxEncoder()(unsignedTx.GetTx())
20 if err != nil {
21 panic(err)
22 }
23 res, err := clientCtx.BroadcastTx(txBytes)
24 if err != nil {
25 panic(err)
26 }
27 return res
28}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected