You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO TxManager isn't hooked into the Database logic, so we have// to pass along the repay and seize addresses hereif(!String(c.ctokenidpay).startsWith("0x")){constrepay=`0x${awaitthis._tCTokens.getAddress(c.ctokenidpay)}`;this._candidates[i].ctokenidpay=repay;}if(!String(c.ctokenidseize).startsWith("0x")){constseize=`0x${awaitthis._tCTokens.getAddress(c.ctokenidseize)}`;this._candidates[i].ctokenidseize=seize;}
The text was updated successfully, but these errors were encountered:
Not only is the data structure poor (sticking two differently-typed things into the ctokenidpay and ctokenidseize variables depending on circumstance) but we can also make this more efficient by keeping a mapping from id-> address in memory, rather than asking the database to retrieve it every single time. The mapping would only change when new markets are added or if the database is reset/reinitialized, in which case we'd be restarting the code anyway.
The text was updated successfully, but these errors were encountered: