From d793918bd3713665820a4c6876ead87e83a6f97f Mon Sep 17 00:00:00 2001 From: Thomas Saunders Date: Fri, 3 Nov 2017 07:32:45 -0500 Subject: [PATCH] style fixes --- neo/Implementations/Wallets/peewee/UserWallet.py | 16 +++++++--------- neo/Prompt/Commands/Wallet.py | 6 ++---- neo/SmartContract/ApplicationEngine.py | 5 ++--- neo/Wallets/Wallet.py | 2 +- prompt.py | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/neo/Implementations/Wallets/peewee/UserWallet.py b/neo/Implementations/Wallets/peewee/UserWallet.py index babe36180..451858ddd 100755 --- a/neo/Implementations/Wallets/peewee/UserWallet.py +++ b/neo/Implementations/Wallets/peewee/UserWallet.py @@ -22,8 +22,8 @@ from .PWDatabase import PWDatabase from neo.Implementations.Wallets.peewee.Models import Account, Address, Coin, \ - Contract, Key, Transaction, \ - TransactionInfo, NEP5Token + Contract, Key, Transaction, \ + TransactionInfo, NEP5Token from autologging import logged import json @@ -162,8 +162,7 @@ def AddWatchOnly(self, script_hash): else: raise Exception("Address already exists in wallet") - - def AddNEP5Token(self,token): + def AddNEP5Token(self, token): super(UserWallet, self).AddNEP5Token(token) @@ -174,15 +173,14 @@ def AddNEP5Token(self,token): pass db_token = NEP5Token.create( - ContractHash = token.ScriptHash.ToBytes(), - Name = token.name, - Symbol = token.symbol, - Decimals = token.decimals + ContractHash=token.ScriptHash.ToBytes(), + Name=token.name, + Symbol=token.symbol, + Decimals=token.decimals ) db_token.save() return True - def FindUnspentCoins(self, from_addr=None, use_standard=False, watch_only_val=0): return super(UserWallet, self).FindUnspentCoins(from_addr, use_standard, watch_only_val=watch_only_val) diff --git a/neo/Prompt/Commands/Wallet.py b/neo/Prompt/Commands/Wallet.py index 395d0f874..10e9a73e3 100644 --- a/neo/Prompt/Commands/Wallet.py +++ b/neo/Prompt/Commands/Wallet.py @@ -3,6 +3,7 @@ import binascii import json + def DeleteAddress(prompter, wallet, addr): scripthash = wallet.ToScriptHash(addr) @@ -39,7 +40,7 @@ def ImportToken(wallet, contract_hash): if contract: hex_script = binascii.hexlify(contract.Code.Script) - token = NEP5Token(script= hex_script) + token = NEP5Token(script=hex_script) result = token.Query(wallet) @@ -52,6 +53,3 @@ def ImportToken(wallet, contract_hash): else: print("Could not import token") - - - diff --git a/neo/SmartContract/ApplicationEngine.py b/neo/SmartContract/ApplicationEngine.py index 3937d2585..aca46497c 100644 --- a/neo/SmartContract/ApplicationEngine.py +++ b/neo/SmartContract/ApplicationEngine.py @@ -11,9 +11,10 @@ from neo.Implementations.Blockchains.LevelDB.DBPrefix import DBPrefix from neo.Implementations.Blockchains.LevelDB.DBCollection import DBCollection from neo.Implementations.Blockchains.LevelDB.CachedScriptTable import CachedScriptTable -from neo.Core.State import ContractState,AssetState,AccountState,ValidatorState,StorageItem +from neo.Core.State import ContractState, AssetState, AccountState, ValidatorState, StorageItem from neo.SmartContract import TriggerType + @logged class ApplicationEngine(ExecutionEngine): @@ -298,8 +299,6 @@ def GetPriceForSysCall(self): return 1 - - @staticmethod def Run(script, container=None): diff --git a/neo/Wallets/Wallet.py b/neo/Wallets/Wallet.py index 6e5741323..96a2b3541 100755 --- a/neo/Wallets/Wallet.py +++ b/neo/Wallets/Wallet.py @@ -40,7 +40,7 @@ class Wallet(object): _master_key = None _keys = {} # holds keypairs _contracts = {} # holds Contracts - _tokens = {} # holds references to NEP5 tokens + _tokens = {} # holds references to NEP5 tokens _watch_only = [] # holds set of hashes _coins = {} # holds Coin References diff --git a/prompt.py b/prompt.py index aba03757a..750c9d15f 100644 --- a/prompt.py +++ b/prompt.py @@ -20,7 +20,7 @@ from neo.Prompt.Commands.Withdraw import RequestWithdraw, RedeemWithdraw from neo.Prompt.Commands.LoadSmartContract import LoadContract, GatherContractDetails, ImportContractAddr, ImportMultiSigContractAddr from neo.Prompt.Commands.Send import construct_and_send, parse_and_sign -from neo.Prompt.Commands.Wallet import DeleteAddress, ImportWatchAddr,ImportToken +from neo.Prompt.Commands.Wallet import DeleteAddress, ImportWatchAddr, ImportToken from neo.Prompt.Utils import get_arg from neo.Prompt.Notify import SubscribeNotifications from neo.Settings import settings