add support for boolean arguments in contract constructor
@@ -101,13 +101,21 @@ func transformDeploymentsToJSON(configDeployments config.Deployments) jsonDeploy
simple: c.Name,
})
} else {
- args := make([]map[string]string, 0)
+ args := make([]map[string]interface{}, 0)
for _, arg := range c.Args {
- args = append(args, map[string]string{
+ switch arg.Type().ID() {
+ case "Bool":
+ args = append(args, map[string]interface{}{
+ "type": arg.Type().ID(),
+ "value": arg.ToGoValue(),
+ })
+ default:
+ args = append(args, map[string]interface{}{
"type": arg.Type().ID(),
"value": fmt.Sprintf("%v", arg.ToGoValue()),
})
}
+ }
deployments = append(deployments, deployment{
advanced: contractDeployment{
@@ -133,7 +141,7 @@ func transformDeploymentsToJSON(configDeployments config.Deployments) jsonDeploy
type contractDeployment struct {
Name string `json:"name"`
- Args []map[string]string `json:"args"`
+ Args []map[string]interface{} `json:"args"`
}
type deployment struct {
