Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle upgrade: legacy oracle compatibility #522

Merged
merged 13 commits into from
Feb 2, 2023
Merged
Prev Previous commit
Next Next commit
remove unused and incorrectly named fn
  • Loading branch information
skozin committed Feb 1, 2023
commit 09c4cb00c08655d1c4724ef46e429645ce025cb4
3 changes: 1 addition & 2 deletions test/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ function strip0x(s) {
return s.substr(0, 2) == '0x' ? s.substr(2) : s
}

// converts BN to number
const bnToStr = x => BN.isBN(x) ? +x : x
// transforms all object entries
const transformEntries = (obj, tr) => Object.fromEntries(
Object.entries(obj).map(tr).filter(x => x !== undefined)
)

// converts all object BN keys to strings, drops positional keys
const processNamedTuple = (obj) => transformEntries(obj, ([k, v]) => {
return /^\d+$/.test(k) ? undefined : [k, BN.isBN(v) ? v.toString() : v]
Expand Down