diff --git a/api/api_full.go b/api/api_full.go index 09c69a1ba..ceeceb05b 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -308,9 +308,9 @@ type FullNode interface { // MsigGetAvailableBalance returns the portion of a multisig's balance that can be withdrawn or spent MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) // MsigGetAvailableBalance creates a multisig wallet - // It takes the following params: , , , - // , - MsigCreate(context.Context, int64, []address.Address, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) + // It takes the following params: , , + //, , + MsigCreate(context.Context, int64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) // MsigPropose proposes a multisig message // It takes the following params: , , , // , , diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index db6e0b27b..d3b109666 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -158,7 +158,7 @@ type FullNodeStruct struct { StateCompute func(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*api.ComputeStateOutput, error) `perm:"read"` MsigGetAvailableBalance func(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) `perm:"read"` - MsigCreate func(context.Context, int64, []address.Address, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) `perm:"sign"` + MsigCreate func(context.Context, int64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) `perm:"sign"` MsigPropose func(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` MsigApprove func(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` MsigCancel func(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` @@ -692,8 +692,8 @@ func (c *FullNodeStruct) MsigGetAvailableBalance(ctx context.Context, a address. return c.Internal.MsigGetAvailableBalance(ctx, a, tsk) } -func (c *FullNodeStruct) MsigCreate(ctx context.Context, req int64, addrs []address.Address, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) { - return c.Internal.MsigCreate(ctx, req, addrs, val, src, gp) +func (c *FullNodeStruct) MsigCreate(ctx context.Context, req int64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) { + return c.Internal.MsigCreate(ctx, req, addrs, duration, val, src, gp) } func (c *FullNodeStruct) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { diff --git a/build/version.go b/build/version.go index b5d48eac7..26f3bed41 100644 --- a/build/version.go +++ b/build/version.go @@ -53,7 +53,7 @@ func (ve Version) EqMajorMinor(v2 Version) bool { } // APIVersion is a semver version of the rpc api exposed -var APIVersion Version = newVer(0, 5, 0) +var APIVersion Version = newVer(0, 6, 0) //nolint:varcheck,deadcode const ( diff --git a/cli/multisig.go b/cli/multisig.go index 9de881d95..125942054 100644 --- a/cli/multisig.go +++ b/cli/multisig.go @@ -6,6 +6,7 @@ import ( "encoding/binary" "encoding/hex" "fmt" + "github.com/filecoin-project/specs-actors/actors/abi" "os" "sort" "strconv" @@ -57,6 +58,11 @@ var msigCreateCmd = &cli.Command{ Usage: "initial funds to give to multisig", Value: "0", }, + &cli.StringFlag{ + Name: "duration", + Usage: "length of the period over which funds unlock", + Value: "0", + }, &cli.StringFlag{ Name: "from", Usage: "account to send the create message from", @@ -114,9 +120,11 @@ var msigCreateCmd = &cli.Command{ required = int64(len(addrs)) } + d := abi.ChainEpoch(cctx.Uint64("duration")) + gp := types.NewInt(1) - msgCid, err := api.MsigCreate(ctx, required, addrs, intVal, sendAddr, gp) + msgCid, err := api.MsigCreate(ctx, required, addrs, d, intVal, sendAddr, gp) if err != nil { return err } diff --git a/node/impl/full/multisig.go b/node/impl/full/multisig.go index 65e64e22f..2fe123621 100644 --- a/node/impl/full/multisig.go +++ b/node/impl/full/multisig.go @@ -26,7 +26,7 @@ type MsigAPI struct { MpoolAPI MpoolAPI } -func (a *MsigAPI) MsigCreate(ctx context.Context, req int64, addrs []address.Address, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) { +func (a *MsigAPI) MsigCreate(ctx context.Context, req int64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) { lenAddrs := int64(len(addrs)) @@ -50,6 +50,7 @@ func (a *MsigAPI) MsigCreate(ctx context.Context, req int64, addrs []address.Add msigParams := &samsig.ConstructorParams{ Signers: addrs, NumApprovalsThreshold: req, + UnlockDuration: duration, } enc, actErr := actors.SerializeParams(msigParams)