Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multisig support call invoke contract #11743

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions cli/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init"
msig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"

Expand Down Expand Up @@ -410,7 +411,16 @@ var msigProposeCmd = &cli.Command{
if err != nil {
return err
}
params = p

if abi.MethodNum(method) == builtintypes.MethodsEVM.InvokeContract {
var buffer bytes.Buffer
if err := cbg.WriteByteArray(&buffer, p); err != nil {
return xerrors.Errorf("failed to encode evm params as cbor: %w", err)
}
params = buffer.Bytes()
} else {
params = p
}
}

var from address.Address
Expand Down Expand Up @@ -582,7 +592,15 @@ var msigApproveCmd = &cli.Command{
if err != nil {
return err
}
params = p
if abi.MethodNum(method) == builtintypes.MethodsEVM.InvokeContract {
var buffer bytes.Buffer
if err := cbg.WriteByteArray(&buffer, p); err != nil {
return xerrors.Errorf("failed to encode evm params as cbor: %w", err)
}
params = buffer.Bytes()
} else {
params = p
}
}

proto, err := api.MsigApproveTxnHash(ctx, msig, txid, proposer, dest, types.BigInt(value), from, method, params)
Expand Down Expand Up @@ -707,7 +725,16 @@ var msigCancelCmd = &cli.Command{
if err != nil {
return err
}
params = p

if abi.MethodNum(method) == builtintypes.MethodsEVM.InvokeContract {
var buffer bytes.Buffer
if err := cbg.WriteByteArray(&buffer, p); err != nil {
return xerrors.Errorf("failed to encode evm params as cbor: %w", err)
}
params = buffer.Bytes()
} else {
params = p
}
}

proto, err := api.MsigCancelTxnHash(ctx, msig, txid, dest, types.BigInt(value), from, method, params)
Expand Down