Merge branch 'ranchimall:master' into testnet
This commit is contained in:
commit
30d4a0e6bb
32
index.html
32
index.html
@ -1442,7 +1442,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="grid gap-0-5">
|
<div class="grid gap-0-5">
|
||||||
<span class="label">Contract address FLO private key</span>
|
<span class="label">Committee address FLO private key</span>
|
||||||
<sm-input id="trigger_private_key" class="password-field" type="password" error-text="Invalid private key" data-private-key="" required="">
|
<sm-input id="trigger_private_key" class="password-field" type="password" error-text="Invalid private key" data-private-key="" required="">
|
||||||
<label slot="right" class="interact">
|
<label slot="right" class="interact">
|
||||||
<input type="checkbox" class="hidden" readonly="" onchange="togglePrivateKeyVisibility(this)">
|
<input type="checkbox" class="hidden" readonly="" onchange="togglePrivateKeyVisibility(this)">
|
||||||
@ -2852,17 +2852,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function filterSmartContracts(options) {
|
function filterSmartContracts(options) {
|
||||||
const { type, subType, dynamic = false } = options || {}
|
const { type, subType, dynamic = false } = options || {};
|
||||||
let filteredSmartContracts = (floGlobals.smartContracts || [])
|
let filteredSmartContracts = floGlobals.smartContracts || [];
|
||||||
.filter(sc => sc.status === 'active')
|
|
||||||
if (type) {
|
if (type) {
|
||||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.contractType === type)
|
filteredSmartContracts = filteredSmartContracts.filter(sc => {
|
||||||
if (type === 'continuos-event' && dynamic)
|
if (type === 'external-trigger') {
|
||||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.oracle_address)
|
return sc.status !== 'active'; // only inactive contracts can be triggered externally
|
||||||
|
} else if (type === 'continuos-event' && dynamic) {
|
||||||
|
return sc.status === 'active' && sc.contractType === type && sc.oracle_address;
|
||||||
|
} else {
|
||||||
|
return sc.status === 'active' && sc.contractType === type;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (subType)
|
if (subType) {
|
||||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.contractSubType === subType)
|
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.contractSubType === subType);
|
||||||
return filteredSmartContracts
|
}
|
||||||
|
return filteredSmartContracts;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSmartContractSelection(actionType) {
|
function handleSmartContractSelection(actionType) {
|
||||||
@ -3028,9 +3034,9 @@
|
|||||||
const triggerOutcome = getRef('smart_contract_trigger_form').querySelector('input[name="outcome"]:checked').value
|
const triggerOutcome = getRef('smart_contract_trigger_form').querySelector('input[name="outcome"]:checked').value
|
||||||
const floData = `${contractName}@ triggerCondition:"${triggerOutcome}"`
|
const floData = `${contractName}@ triggerCondition:"${triggerOutcome}"`
|
||||||
console.log(floData)
|
console.log(floData)
|
||||||
if (contractAddress !== triggerAddress) {
|
// if (contractAddress !== triggerAddress) {
|
||||||
return notify(`Private key doesn't match with contract trigger address`, 'error')
|
// return notify(`Private key doesn't match with contract trigger address`, 'error')
|
||||||
}
|
// }
|
||||||
getConfirmation('Trigger contract', {
|
getConfirmation('Trigger contract', {
|
||||||
message: `Triggering ${contractName} with outcome: ${triggerOutcome}`,
|
message: `Triggering ${contractName} with outcome: ${triggerOutcome}`,
|
||||||
confirmText: 'Trigger',
|
confirmText: 'Trigger',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user