Beispiel #1
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.dst = DexStore(
            nobroadcast=True,
            # We want to bundle many operations into a single transaction
            bundle=True,
            # Overwrite wallet to use this list of wifs only
            wif=[wif])
        set_shared_blockchain_instance(self.dst)
        self.dst.set_default_account("init0")
    def test_default_connection2(self):
        b1 = DexStore("ws://127.0.0.1:7738", nobroadcast=True)
        test = Asset("1.3.0", blockchain_instance=b1)
        test.refresh()

        b2 = DexStore("ws://127.0.0.1:7738", nobroadcast=True)
        dst = Asset("1.3.0", blockchain_instance=b2)
        dst.refresh()

        self.assertEqual(test["symbol"], "TEST")
        self.assertEqual(dst["symbol"], "DST")
    def test_default_connection(self):
        b1 = DexStore("ws://127.0.0.1:7738", nobroadcast=True)
        set_shared_dexstore_instance(b1)
        test = Asset("1.3.0", blockchain_instance=b1)
        # Needed to clear cache
        test.refresh()

        b2 = DexStore("ws://127.0.0.1:7738", nobroadcast=True)
        set_shared_dexstore_instance(b2)
        dst = Asset("1.3.0", blockchain_instance=b2)
        # Needed to clear cache
        dst.refresh()

        self.assertEqual(test["symbol"], "TEST")
        self.assertEqual(dst["symbol"], "DST")
 def __init__(self, *args, **kwargs):
     super(Testcases, self).__init__(*args, **kwargs)
     dexstore = DexStore(
         "ws://127.0.0.1:7738",
         nobroadcast=True,
     )
     set_shared_dexstore_instance(dexstore)
Beispiel #5
0
class Testcases(unittest.TestCase):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.dst = DexStore(
            nobroadcast=True,
            # We want to bundle many operations into a single transaction
            bundle=True,
            # Overwrite wallet to use this list of wifs only
            wif=[wif])
        set_shared_blockchain_instance(self.dst)
        self.dst.set_default_account("init0")

    def test_fee_on_transfer(self):
        tx = self.dst.transfer("init1",
                               1,
                               "1.3.0",
                               account="init0",
                               fee_asset="1.3.121")
        op = tx["operations"][0][1]
        self.assertEqual(op["fee"]["asset_id"], "1.3.121")
    def test_dst1dst2(self):
        b1 = DexStore("ws://127.0.0.1:7738", nobroadcast=True)

        b2 = DexStore("ws://127.0.0.1:7738", nobroadcast=True)

        self.assertNotEqual(b1.rpc.url, b2.rpc.url)
Beispiel #7
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.dst = DexStore(nobroadcast=True, )
        set_shared_dexstore_instance(self.dst)
Beispiel #8
0
from dexstore.asset import Asset
from dexstore.account import Account
from dexstore.proposal import Proposals, Proposal

from dexstorebase.operationids import operations

# default wifs key for testing
wifs = [
    "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3",
    "5KCBDTcyDqzsqehcb52tW5nU6pXife6V2rX9Yf7c3saYSzbDZ5W",
]
wif = wifs[0]

# dexstore instance
dexstore = DexStore("ws://127.0.0.1:7738",
                    keys=wifs,
                    nobroadcast=True,
                    num_retries=1)
config = dexstore.config

# Set defaults
dexstore.set_default_account("init0")
set_shared_blockchain_instance(dexstore)

# Ensure we are not going to transaction anythin on chain!
assert dexstore.nobroadcast


def fixture_data():
    # Clear tx buffer
    dexstore.clear()