Skip to content

Instantly share code, notes, and snippets.

currentQualifiedStake = 0
for worker in qualifiedWorkers:
currentQualifiedStake = currentQualifiedStake + worker.totalStake
randNumber = rand[0,1]
for worker in qualifiedWorkers:
worker.weight = worker.totalStake / currentQualifiedStake
if randNumber < worker.weight:
selectedWorker = worker
break
getTranscoderState(worker.PuK):
# The call fails if the worker is not registered else returns
# one of the following states.
# enum TranscoderState { BONDING, BONDED, UNBONDED, UNBONDING }
worker.stakeReady is equal to BONDED state. The current implementation allows delegation in any of the states.
onlineWorkers = select online workers \
where worker.directStake > minDirectStake \
AND getTranscoderState(worker.PuK) == BONDED
### Keybase proof
I hereby claim:
* I am devadutta on github.
* I am devadutta (https://keybase.io/devadutta) on keybase.
* I have a public key whose fingerprint is 727C 26E8 847C 9A95 18A3 D6DE 7C2D 332D 49BD 3929
To claim this, I am signing this object:
SELECT l_returnflag,
l_linestatus,
Sum(l_quantity) AS SUM_QTY,
Sum(l_extendedprice)AS SUM_BASE_PRICE,
Sum(l_extendedprice * ( 1 - l_discount ))AS SUM_DISC_PRICE
FROM lineitem
GROUP BY l_returnflag,
l_linestatus
ORDER BY l_returnflag,
l_linestatus