Skip to content

Commit

Permalink
fix: update message and fix close contract validation
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas committed Jul 12, 2024
1 parent fd9a7b9 commit a9b1637
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/claim-contract.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ CLIENT_PUBKEY=$($BIN debug pubkey-raw "$CLIENT_PUBKEY_RAW" | grep "Bech32 Acc" |

SIGNATURE=$(signhere -u "$USER" -m "$CONTRACT_ID:$CLIENT_PUBKEY:$NONCE")

$BIN tx $BIN_TX claim-contract-income -y -b block --from "$USER" --keyring-backend test -- "$CONTRACT_ID" "$CLIENT_PUBKEY" "$NONCE" "$SIGNATURE"
$BIN tx $BIN_TX claim-contract-income -y -b block --from "$USER" --keyring-backend test -- "$CONTRACT_ID" "$NONCE" "$SIGNATURE" "$CLIENT_PUBKEY"
4 changes: 2 additions & 2 deletions x/arkeo/client/cli/tx_close_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

func CmdCloseContract() *cobra.Command {
cmd := &cobra.Command{
Use: "close-contract [contract-id]",
Use: "close-contract [contract-id] [client-pubkey] [delegate-optional]",
Short: "Broadcast message closeContract",
Args: cobra.ExactArgs(1),
Args: cobra.MinimumNArgs(2),
RunE: func(cmd *cobra.Command, args []string) (err error) {
argContractId, err := cast.ToUint64E(args[0])
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion x/arkeo/types/message_close_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func NewMsgCloseContract(creator cosmos.AccAddress, contractId uint64, client co
return &MsgCloseContract{
Creator: creator,
ContractId: contractId,
Client: client,
Delegate: delegate,
}
}

Expand Down Expand Up @@ -51,7 +53,7 @@ func (msg *MsgCloseContract) ValidateBasic() error {
return errors.Wrap(ErrContractNotFound, "invalid contract id")
}

if msg.Client != nil {
if msg.Client == nil {
return errors.Wrap(ErrCloseContractUnauthorized, "client id cannot be empty")
}

Expand Down

0 comments on commit a9b1637

Please sign in to comment.