add --hex option to create-evm-actor
This commit is contained in:
parent
61de2f4a4a
commit
b9ed239cf4
10
cli/chain.go
10
cli/chain.go
@ -1522,6 +1522,10 @@ var ChainExecEVMCmd = &cli.Command{
|
||||
Name: "from",
|
||||
Usage: "optionally specify the account to use for sending the exec message",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "hex",
|
||||
Usage: "use when input contract is in hex",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
afmt := NewAppFmt(cctx.App)
|
||||
@ -1541,6 +1545,12 @@ var ChainExecEVMCmd = &cli.Command{
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to read contract: %w", err)
|
||||
}
|
||||
if cctx.Bool("hex") {
|
||||
contract, err = hex.DecodeString(string(contract))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to decode contract: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
constructorParams, err := actors.SerializeParams(&evm.ConstructorParams{
|
||||
Bytecode: contract,
|
||||
|
Loading…
Reference in New Issue
Block a user