Пример #1
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(
            nobroadcast=True,
        )
        set_shared_peerplays_instance(self.ppy)
Пример #2
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(nobroadcast=True, wif=[wif])
        # from getpass import getpass
        # self.ppy.wallet.unlock(getpass())
        set_shared_peerplays_instance(self.ppy)
Пример #3
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(nobroadcast=True, wif=[wif])
        set_shared_peerplays_instance(self.ppy)
        self.ppy.set_default_account("init0")
        self.mymock()
Пример #4
0
 def new_func(ctx, *args, **kwargs):
     newoptions = ctx.obj
     newoptions.update(kwargsChain)
     ctx.peerplays = PeerPlays(**newoptions)
     ctx.blockchain = ctx.peerplays
     set_shared_peerplays_instance(ctx.peerplays)
     return ctx.invoke(f, *args, **kwargs)
Пример #5
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(nobroadcast=True, )
        set_shared_peerplays_instance(self.ppy)
        self.asset = Asset("1.3.0")
        self.symbol = self.asset["symbol"]
        self.precision = self.asset["precision"]
        self.asset2 = Asset("1.3.1")
Пример #6
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(
            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])
        self.ppy.set_default_account("init0")
        set_shared_peerplays_instance(self.ppy)
Пример #7
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(
            nobroadcast=True,
            wif={
                # Force signing with this key
                "active": wif
            })
        set_shared_peerplays_instance(self.ppy)
        self.ppy.set_default_account("init0")
Пример #8
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ppy = PeerPlays(
            nobroadcast=True,
            # this account creates the proposal
            # proposer="init2",
            # Proposal needs to be approve within 1 hour
            # proposal_expiration=60 * 60 * 24 * 14,
            # 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_peerplays_instance(self.ppy)
        self.ppy.set_default_account("init0")
Пример #9
0
    "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3",
    "5KCBDTcyDqzsqehcb52tW5nU6pXife6V2rX9Yf7c3saYSzbDZ5W",
]
wif = wifs[0]
core_unit = "TEST"

# peerplays instance
peerplays = PeerPlays("wss://api.ppy-beatrice.blckchnd.com",
                      keys=wifs,
                      nobroadcast=True,
                      num_retries=1)
config = peerplays.config

# Set defaults
peerplays.set_default_account("init0")
set_shared_peerplays_instance(peerplays)

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

# Setup base lookup
lookup = Lookup(
    proposer="init0",
    blockchain_instance=peerplays,
    network="unittests",
    sports_folder=os.path.join(os.path.dirname(os.path.realpath(__file__)),
                               "bookiesports"),
)
lookup.set_approving_account("init0")
lookup.set_proposing_account("init0")
Пример #10
0
 def new_func(ctx, *args, **kwargs):
     ctx.obj["offline"] = True
     ctx.peerplays = PeerPlays(**ctx.obj)
     ctx.blockchain = ctx.peerplays
     set_shared_peerplays_instance(ctx.peerplays)
     return ctx.invoke(f, *args, **kwargs)
Пример #11
0
 def __init__(self, *args, **kwargs):
     super(Testcases, self).__init__(*args, **kwargs)
     self.ppy = PeerPlays(nobroadcast=True, keys=wifs)
     set_shared_peerplays_instance(self.ppy)
     self.mockAccount()
Пример #12
0
 def new_func(ctx, *args, **kwargs):
     ctx.peerplays = PeerPlays(**ctx.obj)
     set_shared_peerplays_instance(ctx.peerplays)
     return ctx.invoke(f, *args, **kwargs)