Skip to content

Commit

Permalink
Merge pull request #11273 from filecoin-project/fix/wrap-sign-error
Browse files Browse the repository at this point in the history
fix: cli: Wrap error in wallet sign
  • Loading branch information
arajasek authored Sep 21, 2023
2 parents 30e4259 + f7c254b commit 70cb445
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/filecoin-project/go-state-types/network"

"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/tablewriter"
)
Expand Down Expand Up @@ -459,7 +460,12 @@ var walletSign = &cli.Command{
sig, err := api.WalletSign(ctx, addr, msg)

if err != nil {
return err
// Check if the address is a multisig address
act, actErr := api.StateGetActor(ctx, addr, types.EmptyTSK)
if actErr == nil && builtin.IsMultisigActor(act.Code) {
return xerrors.Errorf("specified signer address is a multisig actor, it doesn’t have keys to sign transactions. To send a message with a multisig, signers of the multisig need to propose and approve transactions.")
}
return xerrors.Errorf("failed to sign message: %w", err)
}

sigBytes := append([]byte{byte(sig.Type)}, sig.Data...)
Expand Down

0 comments on commit 70cb445

Please sign in to comment.