diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index 21730b9a1..8c9041ccf 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -505,11 +505,11 @@ func testInvokeScript(ctx *cli.Context) error { // ProjectConfig contains project metadata. type ProjectConfig struct { Version uint - Contract request.ContractDetails `yaml:"project"` + Contract smartcontract.ContractDetails `yaml:"project"` } -func parseContractDetails() request.ContractDetails { - details := request.ContractDetails{} +func parseContractDetails() smartcontract.ContractDetails { + details := smartcontract.ContractDetails{} reader := bufio.NewReader(os.Stdin) fmt.Print("Author: ") diff --git a/pkg/rpc/request/txBuilder.go b/pkg/rpc/request/txBuilder.go index cd7cd75fc..eb358c0a8 100644 --- a/pkg/rpc/request/txBuilder.go +++ b/pkg/rpc/request/txBuilder.go @@ -78,7 +78,7 @@ func AddInputsAndUnspentsToTx(tx *transaction.Transaction, addr string, assetID // DetailsToSCProperties extract the fields needed from ContractDetails // and converts them to smartcontract.PropertyState. -func DetailsToSCProperties(contract *ContractDetails) smartcontract.PropertyState { +func DetailsToSCProperties(contract *smartcontract.ContractDetails) smartcontract.PropertyState { var props smartcontract.PropertyState if contract.HasStorage { props |= smartcontract.HasStorage @@ -94,7 +94,7 @@ func DetailsToSCProperties(contract *ContractDetails) smartcontract.PropertyStat // CreateDeploymentScript returns a script that deploys given smart contract // with its metadata. -func CreateDeploymentScript(avm []byte, contract *ContractDetails) ([]byte, error) { +func CreateDeploymentScript(avm []byte, contract *smartcontract.ContractDetails) ([]byte, error) { script := io.NewBufBinWriter() emit.Bytes(script.BinWriter, []byte(contract.Description)) emit.Bytes(script.BinWriter, []byte(contract.Email)) diff --git a/pkg/rpc/request/scdetails.go b/pkg/smartcontract/contract_details.go similarity index 65% rename from pkg/rpc/request/scdetails.go rename to pkg/smartcontract/contract_details.go index c53e21e61..05132f0c8 100644 --- a/pkg/rpc/request/scdetails.go +++ b/pkg/smartcontract/contract_details.go @@ -1,6 +1,4 @@ -package request - -import "github.com/nspcc-dev/neo-go/pkg/smartcontract" +package smartcontract // ContractDetails contains contract metadata. type ContractDetails struct { @@ -12,6 +10,6 @@ type ContractDetails struct { HasStorage bool HasDynamicInvocation bool IsPayable bool - ReturnType smartcontract.ParamType - Parameters []smartcontract.ParamType + ReturnType ParamType + Parameters []ParamType }