Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
localhuman committed Nov 3, 2017
1 parent dff1a4f commit d793918
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
16 changes: 7 additions & 9 deletions neo/Implementations/Wallets/peewee/UserWallet.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down
6 changes: 2 additions & 4 deletions neo/Prompt/Commands/Wallet.py
Expand Up @@ -3,6 +3,7 @@
import binascii
import json


def DeleteAddress(prompter, wallet, addr):

scripthash = wallet.ToScriptHash(addr)
Expand Down Expand Up @@ -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)

Expand All @@ -52,6 +53,3 @@ def ImportToken(wallet, contract_hash):
else:

print("Could not import token")



5 changes: 2 additions & 3 deletions neo/SmartContract/ApplicationEngine.py
Expand Up @@ -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):

Expand Down Expand Up @@ -298,8 +299,6 @@ def GetPriceForSysCall(self):

return 1



@staticmethod
def Run(script, container=None):

Expand Down
2 changes: 1 addition & 1 deletion neo/Wallets/Wallet.py
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion prompt.py
Expand Up @@ -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
Expand Down

0 comments on commit d793918

Please sign in to comment.