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

[WIP] Grants #2393

Closed
wants to merge 359 commits into from
Closed

[WIP] Grants #2393

wants to merge 359 commits into from

Conversation

mbeacom
Copy link
Contributor

@mbeacom mbeacom commented Oct 9, 2018

Description

The goal of this PR is to introduce the grants module into the Gitcoin core platform.

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

grants

@mbeacom mbeacom added frontend This needs frontend expertise. backend This needs backend expertise. new feature labels Oct 9, 2018
@mbeacom mbeacom changed the title Grants [WIP] Grants Oct 9, 2018
@mbeacom mbeacom added the wip label Oct 9, 2018
pgweb:
image: sosedoff/pgweb
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432?sslmode=disable

Choose a reason for hiding this comment

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

[error] wrong indentation: expected 6 but found 8 (indentation)

environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432?sslmode=disable
links:
- db

Choose a reason for hiding this comment

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

[error] wrong indentation: expected 6 but found 8 (indentation)

links:
- db
ports:
- "8081:8081"

Choose a reason for hiding this comment

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

[error] wrong indentation: expected 6 but found 8 (indentation)

@gitcoinco gitcoinco deleted a comment from stickler-ci Oct 9, 2018
@codecov
Copy link

codecov bot commented Oct 9, 2018

Codecov Report

Merging #2393 into master will increase coverage by 0.51%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2393      +/-   ##
=========================================
+ Coverage   29.98%   30.5%   +0.51%     
=========================================
  Files         171     181      +10     
  Lines       13430   13908     +478     
  Branches     1790    1815      +25     
=========================================
+ Hits         4027    4242     +215     
- Misses       9270    9533     +263     
  Partials      133     133
Impacted Files Coverage Δ
app/app/pipeline.py 0% <0%> (ø) ⬆️
app/app/log_filters.py 0% <0%> (ø) ⬆️
app/app/urls.py 87.23% <100%> (+0.27%) ⬆️
app/app/utils.py 23.66% <12.5%> (ø) ⬆️
app/app/context.py 70.37% <33.33%> (ø) ⬆️
app/app/sitemaps.py 68.62% <70%> (ø) ⬆️
app/app/settings.py 80.07% <90.9%> (ø) ⬆️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 894cc4c...b6a3f05. Read the comment docs.

/* eslint-disable no-console */

$(document).ready(function() {

Choose a reason for hiding this comment

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

More than 2 blank lines not allowed. (no-multiple-empty-lines)

$(this).removeClass('is-dragging');
});

$("#img-project").on('change', function() {

Choose a reason for hiding this comment

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

Strings must use singlequote. (quotes)


$("#img-project").on('change', function() {
if (this.files && this.files[0]) {
var reader = new FileReader();

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)

$('#js-drop span').hide();
$('#js-drop input').css('visible', 'invisible');
$('#js-drop').css('padding', 0);
}

Choose a reason for hiding this comment

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

Trailing spaces not allowed. (no-trailing-spaces)
Missing semicolon. (semi)

$('#js-newGrant').validate({
submitHandler: function(form) {

var data = {};

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)


waitforWeb3(function() {
tokens(document.web3network).forEach(function(ele) {
let option = document.createElement('option');

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)

"""Return the string representation of a Grant."""
return f"id: {self.pk}, status: {self.status}, title: {self.title}, description: {self.description}"

class Subscription(SuperModel):

Choose a reason for hiding this comment

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

E302 expected 2 blank lines, found 1

from
}, function(err, result) {
if (err)
return console.error(err);

Choose a reason for hiding this comment

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

Unexpected console statement. (no-console)

if (err)
return console.error(err);
if (result.error)
return console.error(result.error);

Choose a reason for hiding this comment

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

Unexpected console statement. (no-console)

.travis.yml Outdated
@@ -41,6 +30,15 @@ jobs:
- cp app/app/travis.env app/app/.env
- pip install pip setuptools --upgrade
- pip install codecov
# Fetch and Install GeoIP database files.
- sudo apt-get update && sudo apt-get install -y libmaxminddb-dev
- wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz

Choose a reason for hiding this comment

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

[error] line too long (87 > 80 characters) (line-length)

.travis.yml Outdated
# Fetch and Install GeoIP database files.
- sudo apt-get update && sudo apt-get install -y libmaxminddb-dev
- wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
- wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz

Choose a reason for hiding this comment

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

[error] line too long (90 > 80 characters) (line-length)

.travis.yml Outdated
local-dir: _build/site
fqdn: docs.gitcoin.co
target-branch: gh-pages
on:

Choose a reason for hiding this comment

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

[warning] truthy value should be true or false (truthy)

@@ -117,7 +118,7 @@ def receive_tip_v3(request, key, txid, network):
these_tips = Tip.objects.filter(web3_type='v3', txid=txid, network=network)
tips = these_tips.filter(metadata__reference_hash_for_receipient=key) | these_tips.filter(metadata__reference_hash_for_funder=key)
tip = tips.first()
is_authed = request.user.username == tip.username or request.user.username == tip.from_username
is_authed = request.user.username.lower() == tip.username.lower() or request.user.username.lower() == tip.from_username.lower()

Choose a reason for hiding this comment

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

E501 line too long (131 > 120 characters)

@@ -128,7 +129,7 @@ def receive_tip_v3(request, key, txid, network):
elif tip.receive_txid:
messages.info(request, 'This tip has been received')
elif not is_authed:
messages.error(request, f'This tip is for {tip.username} but you are logged in as {request.user.username}. Please logout and log back in as {tip.username}.')
messages.error(request, f'This tip is for @{tip.username} but you are logged in as @{request.user.username}. Please logout and log back in as {tip.username}.')

Choose a reason for hiding this comment

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

E501 line too long (168 > 120 characters)

@@ -106,6 +106,8 @@ def membership_length_in_days(self, instance):
return 'Unknown'



admin.site.register(AccountDeletionRequest, GeneralAdmin)

Choose a reason for hiding this comment

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

E303 too many blank lines (3)

from marketing.mails import quarterly_stats
from marketing.models import EmailSubscriber
from marketing.models import EmailSubscriber, LeaderboardRank

Choose a reason for hiding this comment

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

F401 'marketing.models.EmailSubscriber' imported but unused

queryset = queryset.filter(email__startswith=filter_startswith)
queryset = queryset.order_by('email')
email_list = set(queryset.values_list('email', flat=True))
def handle(self, *args, **options):

Choose a reason for hiding this comment

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

E303 too many blank lines (2)

@octavioamu octavioamu removed their assignment Oct 11, 2018
mbeacom and others added 8 commits October 16, 2018 15:36
* web3.js 1.0.0 implented. now to rebuild web3 functionality.

* implementing grant contract deployment in web3 1.0. contracts deploying, need to wire out db.

* contract deployed on grant creation and data saved correctly db.

* signatures receovering correctly. On plane, need internet to see if transactions submit to the chain. Next to implement approve, then cancel functionality.

* working on subscriptions. signatures aubmitting twice for some reason...

* appove functionality working. Ironing out tx submission by subminer. tx is currently reverting on submission. Almost there.

* appove functionality working. Ironing out tx submission by subminer. tx is currently reverting on submission. Almost there.

* successful transaction from miner with hard coded data. need to make dynamic and coordinate with Mark on miner migration.

* successful transactions from miner with hardcoded data and successfully storing single record of subscription in db.

* back to successful transaction from miner and correct storage after merge

* run linters

* added cancel functionality

* made fund functionality dynamic. Still need to iron out why the approve function isn't setting limit. Probably a decimals thing.

* address comments by mbeacom

* a few more changes re: mbeacom

* easy changes while writing view specific tickets

* change subscription_cancel url, revert network max_length in models

* removed show.html

* added period_seconds to Subscription model

* implement adding block_number data

* implement block_number data

* run migrations to resolve circleci sql issue

* update package.json to master

* update package-lock.json

* removing and re-running migrations
…#2485)

* Update grant models with help_text and require login on some grant views

Signed-off-by: Mark Beacom <[email protected]>

* Whoops - revert base return in gh_login
* Update new grant to save team members and full receipt from transaction - squash migrations

* Whoops json import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This needs backend expertise. frontend This needs frontend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants