-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
migrate gitcoin from web3js 0.2 to 1.0 #2398
Conversation
@owocki Currently I added the feature to know the current network it is on. Will be adding more in a day or two. |
😍 |
@usmanmuhd Are you still interested in working on this? |
Yes. Sorry, I was stuck with quite a bit of work today. Will try my best to push in changes by tomorrow. |
f64c17f
to
5d06a6c
Compare
a2515a5
to
118c660
Compare
b514aee
to
e3b28bf
Compare
@mbeacom In /tips , web3js 0.2 is being loaded instead of 1.0. How do I fix this? |
add the code to load web3js 1.0 to the template for tips |
Ah, never mind. Fixed it. |
Do we want this branch based on |
prob master |
2 similar comments
prob master |
prob master |
return false; | ||
} | ||
|
||
return (web3.eth.coinbase.toLowerCase() == bountyAddress.toLowerCase()); | ||
const accounts = await web3.eth.getAccounts(); |
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.
Expected blank line after variable declarations. (newline-after-var)
|
||
web3.eth.getCoinbase(function(error, coinbase) { | ||
present_coinbase = coinbase; | ||
var hasChanged = (document.lastCoinbase != present_coinbase) || (document.lastWeb3Network != document.web3network); |
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.
Expected blank line after variable declarations. (newline-after-var)
var hasChanged = (document.lastCoinbase != present_coinbase) || (document.lastWeb3Network != document.web3network); | ||
if (hasChanged) { | ||
_alert(gettext('Detected a web3 change. Refreshing the page. '), 'info'); | ||
document.location.href = document.location.href; |
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.
'document.location.href' is assigned to itself. (no-self-assign)
@@ -712,17 +720,18 @@ var build_detail_page = function(result) { | |||
$('.title').html(gettext('Funded Issue Details: ') + result['title']); | |||
|
|||
// funded by | |||
if (isBountyOwnerPerLogin(result) && !isBountyOwner(result)) { | |||
$('#funder_notif_info').html(gettext('Funder Address: ') + | |||
isBountyOwner(result).then(function (isBountyOwnerResult) { |
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.
Unexpected space before function parentheses. (space-before-function-paren)
buttonclass: 'button--warning' | ||
}; | ||
|
||
isBountyOwner(result).then(function (isBountyOwnerResult) { |
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.
Unexpected space before function parentheses. (space-before-function-paren)
let show_payout = !is_status_expired && !is_status_done && isBountyOwnerResult; | ||
let show_extend_deadline = isBountyOwnerResult && !is_status_expired && !is_status_done; | ||
let show_invoice = isBountyOwnerResult; | ||
const show_change_bounty = is_still_on_happy_path && (isBountyOwnerResult || show_admin_methods); |
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.
Expected blank line after variable declarations. (newline-after-var)
input.val(addr); | ||
} | ||
web3.eth.getCoinbase(function(error, coinbase) { | ||
const input = $('#eth_address'); |
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.
Expected blank line after variable declarations. (newline-after-var)
} | ||
web3.eth.getBalance(coinbase, function(errors, result) { | ||
var balance = result.toNumber(); |
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.
Expected blank line after variable declarations. (newline-after-var)
} | ||
web3.eth.getBalance(coinbase, function(errors, result) { | ||
var balance = result.toNumber(); | ||
console.log(coinbase, balance) |
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.
Missing semicolon. (semi)
@usmanmuhd Anything we can help you with here? cc @gitcoinco/frontend |
@mbeacom I have stopped work as I did not have enough time to work on this. Forgot to close the PR. Hope @pinkiebell can take over the changes made in this PR and push it past the finish line! |
Thanks for the update @usmanmuhd ! |
Fixes #2370