Skip to content

Commit

Permalink
two1: Increase fees
Browse files Browse the repository at this point in the history
  • Loading branch information
jianli committed May 18, 2017
1 parent e9dd155 commit ac38482
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/bitserv/test_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create_deposit_tx(self, hash160):
utxo_script_sig = Script.build_p2pkh(self._private_key.public_key.hash160())
inp = TransactionInput(
outpoint=Hash('0' * 64), outpoint_index=0, script=utxo_script_sig, sequence_num=0xffffffff)
out = TransactionOutput(value=120000, script=Script.build_p2sh(hash160))
out = TransactionOutput(value=500000, script=Script.build_p2sh(hash160))
txn = Transaction(version=Transaction.DEFAULT_TRANSACTION_VERSION, inputs=[inp], outputs=[out], lock_time=0)
txn.sign_input(
input_index=0, hash_type=Transaction.SIG_HASH_ALL, private_key=self._private_key,
Expand Down Expand Up @@ -98,7 +98,7 @@ def mock_lookup_spent_txid(self, txid, output_index):
TEST_DEP_AMOUNT = 100000
TEST_DUST_AMOUNT = 1
TEST_PMT_AMOUNT = 5000
TEST_FEE_AMOUNT = 30000
TEST_FEE_AMOUNT = 125000
TEST_EXPIRY = 86400 * 8
cust_wallet = MockTwo1Wallet()
merch_wallet = MockTwo1Wallet()
Expand Down
24 changes: 12 additions & 12 deletions tests/channels/test_paymentchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def test_paymentchannel_typical():
# Clear mock payment channel server channels.
mock.MockPaymentChannelServer.channels = {}

# Open a payment channel with 100000 deposit, default expiration, and 30000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 30000, False)
# Open a payment channel with 100000 deposit, default expiration, and 125000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 125000, False)

# Assert payment channel properties
expected_state = {}
Expand All @@ -44,7 +44,7 @@ def test_paymentchannel_typical():
expected_state['ready'] = False
expected_state['balance'] = 100000
expected_state['deposit'] = 100000
expected_state['fee'] = 30000
expected_state['fee'] = 125000
expected_state['creation_time'] = lambda pc: pc.creation_time > 0
expected_state['expiration_time'] = int(pc.creation_time + DEFAULT_EXPIRATION)
expected_state['expired'] = False
Expand Down Expand Up @@ -154,8 +154,8 @@ def test_paymentchannel_typical_zeroconf():
# Clear mock payment channel server channels.
mock.MockPaymentChannelServer.channels = {}

# Open a payment channel with 100000 deposit, default expiration, and 30000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 30000, True)
# Open a payment channel with 100000 deposit, default expiration, and 125000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 125000, True)

# Assert payment channel properties
expected_state = {}
Expand All @@ -164,7 +164,7 @@ def test_paymentchannel_typical_zeroconf():
expected_state['ready'] = True
expected_state['balance'] = 100000
expected_state['deposit'] = 100000
expected_state['fee'] = 30000
expected_state['fee'] = 125000
expected_state['creation_time'] = lambda pc: pc.creation_time > 0
expected_state['expiration_time'] = int(pc.creation_time + DEFAULT_EXPIRATION)
expected_state['expired'] = False
Expand Down Expand Up @@ -204,8 +204,8 @@ def test_paymentchannel_expiration():
# Clear mock payment channel server channels.
mock.MockPaymentChannelServer.channels = {}

# Open a payment channel with 100000 deposit, default expiration, and 30000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 30000, False)
# Open a payment channel with 100000 deposit, default expiration, and 125000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 125000, False)

# Confirm the deposit tx
bc.mock_confirm(pc.deposit_txid)
Expand All @@ -218,7 +218,7 @@ def test_paymentchannel_expiration():
expected_state['ready'] = True
expected_state['balance'] = 100000
expected_state['deposit'] = 100000
expected_state['fee'] = 30000
expected_state['fee'] = 125000
expected_state['creation_time'] = lambda pc: pc.creation_time > 0
expected_state['expiration_time'] = int(pc.creation_time + DEFAULT_EXPIRATION)
expected_state['expired'] = False
Expand Down Expand Up @@ -288,8 +288,8 @@ def test_paymentchannel_serverside_close():
# Clear mock payment channel server channels.
mock.MockPaymentChannelServer.channels = {}

# Open a payment channel with 100000 deposit, default expiration, and 30000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 30000, False)
# Open a payment channel with 100000 deposit, default expiration, and 125000 fee
pc = paymentchannel.PaymentChannel.open(db, wallet, bc, 'mock://test', 100000, DEFAULT_EXPIRATION, 125000, False)

# Confirm the deposit tx
bc.mock_confirm(pc.deposit_txid)
Expand All @@ -302,7 +302,7 @@ def test_paymentchannel_serverside_close():
expected_state['ready'] = True
expected_state['balance'] = 100000
expected_state['deposit'] = 100000
expected_state['fee'] = 30000
expected_state['fee'] = 125000
expected_state['creation_time'] = lambda pc: pc.creation_time > 0
expected_state['expiration_time'] = int(pc.creation_time + DEFAULT_EXPIRATION)
expected_state['expired'] = False
Expand Down
2 changes: 1 addition & 1 deletion two1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
TWO1_POOL_URL = os.environ.get('TWO1_POOL_URL', 'swirl+tcp://grid.21.co:21006')
TWO1_DEVICE_ID = os.environ.get('TWO1_DEVICE_ID')
TWO1_CHANNELS_MIN_DURATION = int(os.environ.get('TWO1_CHANNELS_MIN_DURATION', 4 * 24 * 3600))
TWO1_CHANNELS_FEE = int(os.environ.get('TWO1_CHANNELS_FEE', 30000))
TWO1_CHANNELS_FEE = int(os.environ.get('TWO1_CHANNELS_FEE', 125000))
2 changes: 1 addition & 1 deletion two1/wallet/fees.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from two1.wallet import exceptions

DEFAULT_FEE_PER_KB = 150000 # Satoshis
DEFAULT_FEE_PER_KB = 350000 # Satoshis

# Each txn input is ~150 bytes:
# outpoint: 32 bytes
Expand Down

0 comments on commit ac38482

Please sign in to comment.