Skip to content

Commit

Permalink
Merge pull request #1275 from hypersign-protocol/custom-contract
Browse files Browse the repository at this point in the history
Custom contract
  • Loading branch information
Pratap2018 authored Jun 2, 2022
2 parents 7398668 + 0b764bf commit c718c2e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -226,7 +226,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -240,7 +240,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
this.notifySuccess("Success");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -225,7 +225,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -239,7 +239,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
this.notifySuccess("Success");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -225,7 +225,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -239,7 +239,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
this.notifySuccess("Success");
Expand Down
14 changes: 9 additions & 5 deletions src/components/participant/ActionInputs/BinanceNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,23 @@
v-for="(param, index) in value.paramsList"
v-bind:key="index"
>
<div class="text-left col-lg-3 col-md-3 text-left">
<div
class="text-left col-lg-3 col-md-3 text-left"
v-if="param.value != ''"
>
<label for="title" class="col-form-label"
>{{ param.name }}<span style="color: red">*</span>:
</label>
</div>

<div class="col-lg-9 col-md-9 px-0">
<div class="col-lg-9 col-md-9 px-0" v-if="param.value != ''">
<input
v-model="param.value"
type=""
id="title"
:required="true"
class="form-control w-100"
:disabled="done"
/>
</div>
</div>
Expand Down Expand Up @@ -212,7 +216,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -226,7 +230,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -240,7 +244,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
this.notifySuccess("Success");
Expand Down
37 changes: 20 additions & 17 deletions src/components/participant/ActionInputs/EthereumNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,23 @@
v-for="(param, index) in value.paramsList"
v-bind:key="index"
>
<div class="text-left col-lg-3 col-md-3 text-left">
<div
class="text-left col-lg-3 col-md-3 text-left"
v-if="param.value != ''"
>
<label for="title" class="col-form-label"
>{{ param.name }}<span style="color: red">*</span>:
</label>
</div>

<div class="col-lg-9 col-md-9 px-0">
<div class="col-lg-9 col-md-9 px-0" v-if="param.value != ''">
<input
v-model="param.value"
type=""
id="title"
:required="true"
class="form-control w-100"
:disabled="done"
/>
</div>
</div>
Expand Down Expand Up @@ -169,16 +173,17 @@ export default {
if (this.data.value) {
Object.assign(this.value, { ...JSON.parse(this.data.value) });
}
eventBus.$on(`disableInput${this.data._id}`, this.disableInput);
console.log(this.value);
let s = this.value.methods;
s = s.substring(s.indexOf("(") + 1, s.indexOf(")"));
if (s !== "") {
s = s.split(",");
s.forEach((element) => {
this.value.paramsList.push({ name: element, value: "" });
});
}
eventBus.$on(`disableInput${this.data._id}`, this.disableInput);
},
methods: {
async update() {
Expand Down Expand Up @@ -210,7 +215,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -224,7 +229,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -234,11 +239,10 @@ export default {
}
case "bool": {
if (!!this.value.operand === !!result) {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
this.notifySuccess("Success");
Expand All @@ -259,7 +263,7 @@ export default {
case "uint256": {
result = Number.parseFloat(result);
this.value.operand = Number.parseFloat(this.value.operand);
if (result < this.value.operand) {
if (result < this.value.operand) {
this.notifySuccess("Success");
this.$emit(
Expand All @@ -275,13 +279,13 @@ export default {
}
break;
}
case ">": {
case ">": {
switch (this.value.returnType) {
case "uint8":
case "uint256": {
result = Number.parseFloat(result);
this.value.operand = Number.parseFloat(this.value.operand);
if (result > this.value.operand) {
if (result > this.value.operand) {
this.notifySuccess("Success");
this.$emit(
Expand All @@ -298,14 +302,13 @@ export default {
break;
}
case "<==": {
case "<==": {
switch (this.value.returnType) {
case "uint8":
case "uint256": {
result = Number.parseFloat(result);
this.value.operand = Number.parseFloat(this.value.operand);
if (result<= this.value.operand ) {
if (result <= this.value.operand) {
this.notifySuccess("Success");
this.$emit(
Expand All @@ -321,13 +324,13 @@ export default {
}
break;
}
case ">==": {
case ">==": {
switch (this.value.returnType) {
case "uint8":
case "uint256": {
result = Number.parseFloat(result);
this.value.operand = Number.parseFloat(this.value.operand);
if (result>=this.value.operand) {
if (result >= this.value.operand) {
this.notifySuccess("Success");
this.$emit(
Expand All @@ -336,7 +339,7 @@ export default {
...this.value,
})
);
} else {
} else {
throw new Error("Condition Mismatch");
}
}
Expand Down
14 changes: 9 additions & 5 deletions src/components/participant/ActionInputs/MaticNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,23 @@
v-for="(param, index) in value.paramsList"
v-bind:key="index"
>
<div class="text-left col-lg-3 col-md-3 text-left">
<div
class="text-left col-lg-3 col-md-3 text-left"
v-if="param.value != ''"
>
<label for="title" class="col-form-label"
>{{ param.name }}<span style="color: red">*</span>:
</label>
</div>

<div class="col-lg-9 col-md-9 px-0">
<div class="col-lg-9 col-md-9 px-0" v-if="param.value != ''">
<input
v-model="param.value"
type=""
id="title"
:required="true"
class="form-control w-100"
:disabled="done"
/>
</div>
</div>
Expand Down Expand Up @@ -211,7 +215,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -225,7 +229,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
} else {
Expand All @@ -239,7 +243,7 @@ export default {
this.$emit(
"input",
JSON.stringify({
...this.value.operand,
...this.value,
})
);
this.notifySuccess("Success");
Expand Down

0 comments on commit c718c2e

Please sign in to comment.