Skip to content

Commit

Permalink
Public network case added
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Aug 13, 2018
1 parent b4f68c5 commit 6947d0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mobius_client_python/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from ..client import Client

class App(object):
def __init__(self, app_account, user_account):
def __init__(self, app_account, user_account, network=None):
self.app_account = app_account
self.user_account = user_account
self.client_instance = Client().get_horizon_client()
self.client_instance = Client(network).get_horizon_client()

def authorized(self):
return self.user_account.authorized(self.app_keypair())
Expand Down
4 changes: 2 additions & 2 deletions mobius_client_python/app/app_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from .app import App

class AppBuilder(object):
def build(self, developer_secret, address):
def build(self, developer_secret, address, network=None):
dev_keypair = Keypair.from_seed(developer_secret)
dev_account = AccountBuilder().build(dev_keypair)

user_keypair = Keypair.from_address(address)
user_account = AccountBuilder().build(user_keypair)

return App(dev_account,user_account)
return App(dev_account,user_account,network)
2 changes: 1 addition & 1 deletion mobius_client_python/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Client(object):
def __init__(self, network=None):
self.stellar_asset = None
self.horizon_client = None
if network == None:
if network == None or network == 'TESTNET':
self.network = Network(NETWORKS['TESTNET'])
else:
self.network = Network(NETWORKS['PUBLIC'])
Expand Down
6 changes: 5 additions & 1 deletion teardown.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@
cosig = AddCosigner().call(keypair=user_keypair, cosigner_keypair=dev_keypair)

# App
app = AppBuilder().build(dev_keypair.seed(),user_keypair.address().decode())
app = AppBuilder().build(dev_keypair.seed(),user_keypair.address().decode(),network='TESTNET')

client = Client()

mobius = Client().network
mobius = Client().stellar_asset
mobius = Client().horizon_client

asset = client.get_stellar_asset()

print('| user | dev |')
Expand Down

0 comments on commit 6947d0e

Please sign in to comment.