Skip to content

Commit 5d67e42

Browse files
committed
feat: update transaction message structure to include authority and consensus addresses
1 parent c2f37ae commit 5d67e42

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

  • modules/network/client/cli

modules/network/client/cli/tx.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ func CmdAttest() *cobra.Command {
5151
}
5252

5353
vote := []byte(args[1])
54-
valAddress := sdk.ValAddress(clientCtx.GetFromAddress()).String()
54+
// Authority is the account that signs and pays for the transaction
55+
authority := clientCtx.GetFromAddress().String()
56+
// Consensus address is the validator address
57+
consensusAddress := sdk.ValAddress(clientCtx.GetFromAddress()).String()
5558
msg := types.NewMsgAttest(
56-
valAddress,
59+
authority,
60+
consensusAddress,
5761
height,
5862
vote,
5963
)
@@ -84,7 +88,7 @@ func CmdJoinAttesterSet() *cobra.Command {
8488
if err != nil {
8589
return err
8690
}
87-
91+
8892
if pubkeyStr == "" {
8993
return fmt.Errorf("must specify the validator's public key using --pubkey flag")
9094
}
@@ -95,8 +99,11 @@ func CmdJoinAttesterSet() *cobra.Command {
9599
return fmt.Errorf("failed to parse public key: %w", err)
96100
}
97101

98-
valAddress := sdk.ValAddress(clientCtx.GetFromAddress()).String()
99-
msg, err := types.NewMsgJoinAttesterSet(valAddress, pubkey)
102+
// Authority is the account that signs and pays for the transaction
103+
authority := clientCtx.GetFromAddress().String()
104+
// Consensus address is the validator address
105+
consensusAddress := sdk.ValAddress(clientCtx.GetFromAddress()).String()
106+
msg, err := types.NewMsgJoinAttesterSet(authority, consensusAddress, pubkey)
100107
if err != nil {
101108
return fmt.Errorf("failed to create MsgJoinAttesterSet: %w", err)
102109
}
@@ -124,8 +131,11 @@ func CmdLeaveAttesterSet() *cobra.Command {
124131
return err
125132
}
126133

127-
valAddress := sdk.ValAddress(clientCtx.GetFromAddress()).String()
128-
msg := types.NewMsgLeaveAttesterSet(valAddress)
134+
// Authority is the account that signs and pays for the transaction
135+
authority := clientCtx.GetFromAddress().String()
136+
// Consensus address is the validator address
137+
consensusAddress := sdk.ValAddress(clientCtx.GetFromAddress()).String()
138+
msg := types.NewMsgLeaveAttesterSet(authority, consensusAddress)
129139

130140
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
131141
},

0 commit comments

Comments
 (0)