Skip to content
Merged
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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem 'rails', '4.2.11.3'
gem 'acts_as_paranoid', github: 'ActsAsParanoid/acts_as_paranoid'
gem 'airbrake', '~> 3.1.15'
gem 'bcrypt', '~> 3.1.12'
gem 'bech32', '~> 1.0.5'
gem 'bootstrap_form', github: 'bootstrap-ruby/rails-bootstrap-forms'
gem 'cancancan'
gem 'coffee-rails', '~> 4.0.0'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ GEM
backports (3.18.2)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.0)
bech32 (1.0.5)
builder (3.2.4)
cancancan (1.7.1)
capistrano (3.4.1)
Expand Down Expand Up @@ -403,6 +404,7 @@ DEPENDENCIES
airbrake (~> 3.1.15)
bcrypt (~> 3.1.12)
bcrypt_pbkdf (~> 1.0.0)
bech32 (~> 1.0.5)
bootstrap_form!
cancancan
capistrano (~> 3.4.0)
Expand Down
5 changes: 2 additions & 3 deletions config/config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ min_tip: 50000 # optional

deposit_address: 1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ

address_versions: # 0/5 for bitcoin addresses, 111/196 for testnet, see chainparams.cpp
- 0
- 5
# Can be testnet or mainnet
network: mainnet
72 changes: 72 additions & 0 deletions features/bitcoin_address.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Feature: Users should be able to change their bitcoin address
Background:
Given a developer named "seldon" exists without a bitcoin address
And I'm signed in as "seldon"

@vcr-ignore-params
Scenario: Users should be able to set P2PKH address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
And I click "Update user info"
Then I should see "Your information saved!"

@vcr-ignore-params
Scenario: Users should not be able to set invalid P2PKH address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVA"
And I click "Update user info"
Then I should not see "Your information saved!"
And I should see "Bitcoin address is invalid"

@vcr-ignore-params
Scenario: Users should be able to set P2SH address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"
And I click "Update user info"
Then I should see "Your information saved!"

@vcr-ignore-params
Scenario: Users should not be able to set invalid P2SH address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLA"
And I click "Update user info"
Then I should not see "Your information saved!"
And I should see "Bitcoin address is invalid"

@vcr-ignore-params
Scenario: Users should not be able to set testnet address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "mtXWDB6k5yC5v7TcwKZHB89SUp85yCKshy"
And I click "Update user info"
Then I should not see "Your information saved!"
And I should see "Bitcoin address is invalid"

@vcr-ignore-params
Scenario: Users should be able to set Bech32 P2WPKH address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"
And I click "Update user info"
Then I should see "Your information saved!"

@vcr-ignore-params
Scenario: Users should be able to set Bech32 P2WSH address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3"
And I click "Update user info"
Then I should see "Your information saved!"

@vcr-ignore-params
Scenario: Users should not be able to set testnet Bech32 address
Given I visit the "seldon user" page
Then I should see "Bitcoin address"
When I fill "Bitcoin address" with: "tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
And I click "Update user info"
Then I should not see "Your information saved!"
And I should see "Bitcoin address is invalid"
Loading