Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Dogecoin support -- wow #2824

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gratipay/models/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def get_cryptocoin_addresses(self):
SELECT network, address
FROM current_exchange_routes r
WHERE participant = %s
AND network = 'bitcoin'
AND ((network = 'bitcoin') OR (network = 'dogecoin'))
AND error <> 'invalidated'
""", (self.id,))
return {r.network: r.address for r in routes}
Expand Down
9 changes: 4 additions & 5 deletions gratipay/utils/bitcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
[x] Added self-test with remote Bitcoin dataset
[x] Added cmdline interface for checking address
utils.bitcoin.py -i [hash]
[x] Added support for altcoin validation

https://github.com/gratipay/gratipay.com/pull/2886
https://github.com/gratipay/gratipay.com/pull/2824

"""

Expand Down Expand Up @@ -82,11 +84,8 @@ def get_bcaddress_version(strAddress):
return ord(version)
return None

def validate(address):
if get_bcaddress_version(address) == None:
return False
else:
return True
def validate(address, version=0):
return get_bcaddress_version(address) == version

if __name__ == '__main__':
print("running self-tests.. (use -i [hash] for cmdline address check)")
Expand Down
5 changes: 5 additions & 0 deletions gratipay/wireup.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ def cryptocoin_networks(website):
'display_name': 'Bitcoin',
'logo': website.asset('cryptocoins/bitcoin.png'),
},
{
'name': 'dogecoin',
'display_name': 'Dogecoin',
'logo': website.asset('cryptocoins/dogecoin.png')
}
]


Expand Down
3 changes: 3 additions & 0 deletions i18n/core/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ msgstr "Sie müssen zuerst Ihre Identität verifizieren."
msgid "This is not a valid Bitcoin address."
msgstr "Das ist keine valide Bitcoin Addresse."

msgid "This is not a valid Dogecoin address."
msgstr "Das ist keine valide Dogecoin Addresse."

msgid "Your bank account is {0}not connected{1}"
msgstr "Dein Bankkonto ist {0}nicht verbunden{1}"

Expand Down
3 changes: 3 additions & 0 deletions i18n/core/eo.po
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,9 @@ msgstr ""
msgid "This is not a valid Bitcoin address."
msgstr "Tiu Bitmonadreso estas malvalida."

msgid "This is not a valid Bitcoin address."
msgstr "Tiu Dogemonadreso estas malvalida."

msgid "Your bank account is {0}not connected{1}"
msgstr "Via bankokonto {0}ne estas konektitaj{1}"

Expand Down
3 changes: 3 additions & 0 deletions i18n/core/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,9 @@ msgstr ""
msgid "This is not a valid Bitcoin address."
msgstr "Esta no es una dirección válida de Bitcoin."

msgid "This is not a valid Dogecoin address."
msgstr "Esta no es una dirección válida de Dogecoin."

msgid "Your bank account is {0}not connected{1}"
msgstr "Tu cuenta de banco {0}no está conectada{1}"

Expand Down
3 changes: 3 additions & 0 deletions i18n/core/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ msgstr "Vous devez d'abord vérifier votre identité."
msgid "This is not a valid Bitcoin address."
msgstr "Ce n'est pas une adresse Bitcoin valide."

msgid "This is not a valid Dogecoin address."
msgstr "Ce n'est pas une adresse Dogecoin valide."

msgid "Your bank account is {0}not connected{1}"
msgstr "Votre compte bancaire n'est {0}pas connecté{1}"

Expand Down
3 changes: 3 additions & 0 deletions i18n/core/ko.po
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ msgstr "네!"
msgid "This is not a valid Bitcoin address."
msgstr ""

msgid "This is not a valid Dogecoin address."
msgstr ""

msgid ""
"Warning: Doing this will remove all the tips you are currently receiving.\n"
"\n"
Expand Down
3 changes: 3 additions & 0 deletions i18n/core/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,9 @@ msgstr "U dient eerst uw identiteit te verifiëren."
msgid "This is not a valid Bitcoin address."
msgstr "Dit is geen geldig Bitcoin adres."

msgid "This is not a valid Dogecoin address."
msgstr "Dit is geen geldig Dogecoin adres."

msgid "Your bank account is {0}not connected{1}"
msgstr "Uw bank rekening is {0} niet gekoppeld{1}"

Expand Down
3 changes: 3 additions & 0 deletions i18n/core/pt.po
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ msgstr ""
msgid "This is not a valid Bitcoin address."
msgstr "Este não é um endereço de Bitcoin válido."

msgid "This is not a valid Dogecoin address."
msgstr "Este não é um endereço de Dogecoin válido."

msgid "Your bank account is {0}not connected{1}"
msgstr "Sua conta bancária está {0}não conectada{1}"

Expand Down
3 changes: 3 additions & 0 deletions i18n/core/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,9 @@ msgstr "Evet!"
msgid "This is not a valid Bitcoin address."
msgstr "Geçerli bir Bitcoin adresi değil."

msgid "This is not a valid Dogecoin address."
msgstr "Geçerli bir Dogecoin adresi değil."

msgid ""
"Warning: Doing this will remove all the tips you are currently receiving.\n"
"\n"
Expand Down
3 changes: 3 additions & 0 deletions sql/branch.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- https://github.com/gratipay/gratipay.com/pull/2824/files

ALTER TYPE payment_net ADD VALUE 'dogecoin' AFTER 'bitcoin';
5 changes: 5 additions & 0 deletions www/%username/routes/associate.json.spt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ if change:
raise Response(400, _("This is not a valid Bitcoin address."))
ExchangeRoute.insert(participant, network, address)

elif network == 'dogecoin':
if not bitcoin.validate(address, version=0x1E):
raise Response(400, _("This is not a valid Dogecoin address."))
ExchangeRoute.insert(participant, network, address)

else:
raise Response(400, 'unknown network')

Expand Down
12 changes: 12 additions & 0 deletions www/about/faq.spt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ subhead = _("Frequently Asked Questions")
us</a> to request a one-time bitcoin payin (1% + 15&cent;
fee).</li>

<li><a
href="mailto:[email protected]?subject=dogecoin%20payin">Email
us</a> to request a one-time dogecoin payin (1% + 15&cent;
fee).</li>


</ol>

</dd>
Expand All @@ -88,6 +94,12 @@ subhead = _("Frequently Asked Questions")
us</a> to request a one-time bitcoin payout (1% + 15&cent;
fee).</li>

<li><a
href="mailto:[email protected]?subject=dogecoin%20payout">Email
us</a> to request a one-time dogecoin payout (1% + 15&cent;
fee).</li>


</ol>

</dd>
Expand Down
Binary file added www/assets/cryptocoins/dogecoin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.