mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-11-29 08:25:10 +00:00
M3c: fix runner environment detection
This commit is contained in:
@@ -5,16 +5,20 @@ oo::class create ::stomach::AMMRunner {
|
|||||||
|
|
||||||
constructor {} {
|
constructor {} {
|
||||||
set runtime cast
|
set runtime cast
|
||||||
set rpc [expr {[info exists ::env(AMM_RPC_URL)] ? $::env(AMM_RPC_URL) : ""}]
|
set rpc ""
|
||||||
set address [expr {[info exists ::env(AMM_QUERY_ADDRESS)] ? $::env(AMM_QUERY_ADDRESS) : ""}]
|
set address ""
|
||||||
|
if {[info exists ::env(AMM_RPC_URL)]} {
|
||||||
|
set rpc $::env(AMM_RPC_URL)
|
||||||
|
}
|
||||||
|
if {[info exists ::env(AMM_QUERY_ADDRESS)]} {
|
||||||
|
set address $::env(AMM_QUERY_ADDRESS)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
method available {} {
|
method available {} {
|
||||||
expr {
|
if {[auto_execok $runtime] eq ""} { return 0 }
|
||||||
[auto_execok $runtime] ne "" &&
|
if {$rpc eq "" || $address eq ""} { return 0 }
|
||||||
$rpc ne "" &&
|
return [regexp {^0x[0-9A-Fa-f]{40}$} $address]
|
||||||
[regexp {^0x[0-9A-Fa-f]{40}$} $address]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
method _prediction_index {prediction_type} {
|
method _prediction_index {prediction_type} {
|
||||||
|
|||||||
Reference in New Issue
Block a user