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

ServiceRegistry (without parameter reconfiguration) #1116

Merged
merged 40 commits into from
Jul 16, 2019
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9764a2a
Compute the price movements
pirapira Jul 5, 2019
f3b0744
Maybe a single formula works better
pirapira Jul 5, 2019
8567da5
Formatted the exponentiation
pirapira Jul 5, 2019
0ef446f
Fix compilation
pirapira Jul 8, 2019
6dba747
Fixed tests
pirapira Jul 8, 2019
29f6e9b
Fixed tests
pirapira Jul 8, 2019
0903166
Use a constant instead of literals
pirapira Jul 8, 2019
1ba3e90
Rename owner to withdrawer
pirapira Jul 8, 2019
9b112ef
Use a more consistent min_price
pirapira Jul 8, 2019
5b1b6da
deploy_service_contracts() fail for older versions
pirapira Jul 8, 2019
ae72e12
Fix test
pirapira Jul 8, 2019
95b3406
Documented Deposit contract
pirapira Jul 9, 2019
4d99852
Rename a variable
pirapira Jul 9, 2019
6b70ba6
Documented ServiceRegistry and gave better names
pirapira Jul 9, 2019
6d96854
Add a test about withdrawing from Deposit
pirapira Jul 9, 2019
b27023f
Add tests for the new function
pirapira Jul 9, 2019
a715003
Increase test coverage
pirapira Jul 11, 2019
4b96f41
Remove a weird empty line
pirapira Jul 11, 2019
a430667
Check length before accessing elements
pirapira Jul 11, 2019
fc3b464
Check the number of constructor arguments
pirapira Jul 12, 2019
d6036d5
Add gas measurements for
pirapira Jul 12, 2019
0adaa62
Update raiden_contracts/data/source/services/ServiceRegistry.sol
pirapira Jul 15, 2019
41b6832
Remove ServiceRegistry.owner
pirapira Jul 15, 2019
b0ab66a
Remove duplicate validity extension
pirapira Jul 15, 2019
514c6b1
Fix help text
pirapira Jul 15, 2019
95b333e
Removed a test about ServiceRegistry.owner
pirapira Jul 15, 2019
137aba2
Document the return value policy
pirapira Jul 16, 2019
dfbbc1c
The old overflow check was not effective
pirapira Jul 16, 2019
f5e16ca
Fix a typo
pirapira Jul 16, 2019
8e64cce
Add a test for a too late withdraw from Deposit
pirapira Jul 16, 2019
b16bfa5
Test extension of ServiceRegistry registration
pirapira Jul 16, 2019
f085044
Document the event RegisteredService
pirapira Jul 16, 2019
0143fdc
Add error messages to ServiceRegistry
pirapira Jul 16, 2019
fcb2d56
Add boolean success flags
pirapira Jul 16, 2019
5f59f7a
Change the name of option for setting the initial
pirapira Jul 16, 2019
d002a6b
Deposit contract can disappear after withdrawal
pirapira Jul 16, 2019
8da6fba
Add error messages to Deposit contract's
pirapira Jul 16, 2019
9ec2205
Compile contracts
pirapira Jul 16, 2019
fc68cc1
ServiceRegistry.withdraw() cannot return anything
pirapira Jul 16, 2019
a7051ee
Camel-case ServiceRegistry
pirapira Jul 16, 2019
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
Prev Previous commit
Next Next commit
Use a constant instead of literals
pirapira committed Jul 15, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 09031664e9ef084a2288b4cbaa1fc94364a144ce
14 changes: 7 additions & 7 deletions raiden_contracts/tests/test_service_registry.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
from eth_tester.exceptions import TransactionFailed
from web3.contract import Contract

from raiden_contracts.tests.utils.constants import CONTRACT_DEPLOYER_ADDRESS
from raiden_contracts.tests.utils.constants import CONTRACT_DEPLOYER_ADDRESS, SERVICE_DEPOSIT


def test_owner_of_service_registry(service_registry: Contract) -> None:
@@ -16,15 +16,15 @@ def test_deposit(
service_registry: Contract, custom_token: Contract, get_accounts: Callable
) -> None:
(A,) = get_accounts(1)
custom_token.functions.mint(5000 * (10 ** 18)).call_and_transact({"from": A})
custom_token.functions.approve(service_registry.address, 5000 * (10 ** 18)).call_and_transact(
custom_token.functions.mint(SERVICE_DEPOSIT).call_and_transact({"from": A})
custom_token.functions.approve(service_registry.address, SERVICE_DEPOSIT).call_and_transact(
{"from": A}
)

# happy path
old_balance = custom_token.functions.balanceOf(A).call()
old_price = service_registry.functions.current_price().call()
service_registry.functions.deposit(5000 * (10 ** 18)).call_and_transact({"from": A})
service_registry.functions.deposit(SERVICE_DEPOSIT).call_and_transact({"from": A})
assert old_balance > custom_token.functions.balanceOf(A).call() > old_balance - old_price
assert service_registry.functions.current_price().call() > old_price

@@ -40,11 +40,11 @@ def test_setURL(
url1 = "http://example.com"
url2 = "http://raiden.example.com"

custom_token.functions.mint(5000 * (10 ** 18)).call_and_transact({"from": A})
custom_token.functions.approve(service_registry.address, 5000 * (10 ** 18)).call_and_transact(
custom_token.functions.mint(SERVICE_DEPOSIT).call_and_transact({"from": A})
custom_token.functions.approve(service_registry.address, SERVICE_DEPOSIT).call_and_transact(
{"from": A}
)
service_registry.functions.deposit(5000 * (10 ** 18)).call_and_transact({"from": A})
service_registry.functions.deposit(SERVICE_DEPOSIT).call_and_transact({"from": A})

service_registry.functions.setURL(url1).call_and_transact({"from": A})
assert service_registry.functions.urls(A).call() == url1