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

migrate gitcoin from web3js 0.2 to 1.0 #2398

Closed
wants to merge 4 commits into from

Conversation

usmanmuhd
Copy link
Contributor

@usmanmuhd usmanmuhd commented Oct 9, 2018

Fixes #2370

  • repo is upgraded to web3js 1.0
  • all references to web3.eth.coinbase updated
  • BOUNTIES: a funder can post a new bounty
  • BOUNTIES: user can fulfill a bounty
  • BOUNTIES: funder can increase payout
  • BOUNTIES: funder can accept a fulfillment (basic payout)
  • BOUNTIES: advanced payout works
  • TIPS: a user can post a new tip
  • TIPS: a user can receive a tip
  • ENS: a user can register an ENS subdomain at /ens
  • FAUCET: User can submit a new faucet page
  • FAUCET: admin can fund a faucet distribution.
  • REQUESTS: User can submit a new requests request

@usmanmuhd usmanmuhd changed the title migrate gitcoin from web3js 0.2 to 1.0 [WIP] migrate gitcoin from web3js 0.2 to 1.0 Oct 9, 2018
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
@usmanmuhd
Copy link
Contributor Author

@owocki Currently I added the feature to know the current network it is on. Will be adding more in a day or two.

@owocki
Copy link
Contributor

owocki commented Oct 9, 2018

😍

@mbeacom
Copy link
Contributor

mbeacom commented Oct 17, 2018

@usmanmuhd Are you still interested in working on this?

@mbeacom mbeacom added frontend This needs frontend expertise. wip labels Oct 17, 2018
@usmanmuhd
Copy link
Contributor Author

@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.

app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
@usmanmuhd usmanmuhd force-pushed the web3js1 branch 2 times, most recently from f64c17f to 5d06a6c Compare October 18, 2018 01:23
@usmanmuhd usmanmuhd force-pushed the web3js1 branch 3 times, most recently from a2515a5 to 118c660 Compare October 18, 2018 02:14
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
@usmanmuhd usmanmuhd force-pushed the web3js1 branch 2 times, most recently from b514aee to e3b28bf Compare October 18, 2018 10:04
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
app/assets/v2/js/shared.js Show resolved Hide resolved
app/assets/v2/js/shared.js Outdated Show resolved Hide resolved
@usmanmuhd
Copy link
Contributor Author

usmanmuhd commented Oct 18, 2018

@mbeacom In /tips , web3js 0.2 is being loaded instead of 1.0. How do I fix this?
And also how do I test the promptForAuth function with a custom token?

@owocki
Copy link
Contributor

owocki commented Oct 19, 2018

@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

@usmanmuhd
Copy link
Contributor Author

usmanmuhd commented Oct 19, 2018

Ah, never mind. Fixed it.

@mbeacom
Copy link
Contributor

mbeacom commented Oct 20, 2018

Do we want this branch based on kevin/kevin-demo or master ? 🤔

@owocki
Copy link
Contributor

owocki commented Oct 22, 2018

prob master

2 similar comments
@owocki
Copy link
Contributor

owocki commented Oct 22, 2018

prob master

@owocki
Copy link
Contributor

owocki commented Oct 22, 2018

prob master

@usmanmuhd usmanmuhd changed the base branch from kevin/kevin-demo to master November 19, 2018 12:43
return false;
}

return (web3.eth.coinbase.toLowerCase() == bountyAddress.toLowerCase());
const accounts = await web3.eth.getAccounts();

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);

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;

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) {

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) {

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);

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');

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();

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon. (semi)

@mbeacom
Copy link
Contributor

mbeacom commented Nov 29, 2018

@usmanmuhd Anything we can help you with here?

cc @gitcoinco/frontend

@mbeacom mbeacom requested a review from a team November 29, 2018 03:16
@usmanmuhd
Copy link
Contributor Author

@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!

@mbeacom
Copy link
Contributor

mbeacom commented Nov 29, 2018

Thanks for the update @usmanmuhd !

@mbeacom mbeacom closed this Nov 29, 2018
@mbeacom mbeacom changed the title [WIP] migrate gitcoin from web3js 0.2 to 1.0 migrate gitcoin from web3js 0.2 to 1.0 Nov 29, 2018
@usmanmuhd usmanmuhd deleted the web3js1 branch November 30, 2018 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont merge frontend This needs frontend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants