-
Notifications
You must be signed in to change notification settings - Fork 36
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
(Thorchain) Replace rpc tx_search with midgard transaction query #822
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit on the any
type usage needed.
let gasPrice = average | ||
switch (opts.networkFeeOption) { | ||
case 'low': { | ||
gasPrice = low | ||
break | ||
} | ||
case 'high': { | ||
gasPrice = high | ||
break | ||
} | ||
case 'custom': { | ||
throw new Error('Custom fee not supported') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't ignore this comment
If only this was valid JS code:
const gasPrice = match opts.networkFeeOption === {
'low': low,
'high': high,
'custom': throw new Error('Custom fee not supported')
}
It's called pattern matching, but the syntax idea that I just thought of seems nice and elegant. But this is in TC39's hands.
const gasPrice = match(opts.networkFeeOption)(
(case = Type('low')) => low,
(case = Type('high')) => high,
(case = Type('custom')) => { throw new Error(...) }
)
^ This API is doable though ^
whatever
Thorchain has enough unique functionality to warrant its own engine. So far, this engine can handle a planned hard fork. Future commits will move transaction query, balance query, transaction fees, and future PRs can move other methods and registry entries
Will be called from multiple transaction query functions
4c9ef5c
to
cd8b2b4
Compare
cd8b2b4
to
4f6d147
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
none