Skip to content

Commit 930af6b

Browse files
all tested: Windows, Ubuntu
1 parent dcc1fa2 commit 930af6b

23 files changed

+100
-120
lines changed

contracts/eosio_token/src/eosio_token.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @copyright defined in eos/LICENSE.txt
44
*/
55

6-
#include <eosio_token.hpp>
6+
#include "include/eosio_token.hpp"
77

88
namespace eosio {
99

contracts/tic_tac_toe/src/tic_tac_toe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @copyright defined in eos/LICENSE.txt
44
*/
55

6-
#include <tic_tac_toe.hpp>
6+
#include "include/tic_tac_toe.hpp"
77

88
namespace eosio {
99

docs/comments/symbolic_names.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ $ python3
1515
```
1616

1717
```python
18+
import eosfactory.core.setup as setup
1819
from eosfactory.eosf import *
1920
```
2021

docs/comments/symbolic_names.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
import eosfactory.core.setup as setup
23
from eosfactory.eosf import *
34

45
reset()

eosfactory/clear_easy_install_pth.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

eosfactory/core/account.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import eosfactory.core.manager as manager
77
import eosfactory.core.logger as logger
88

9+
910
class Eosio(interface.Account):
10-
def __init__(self, account_object_name):
11-
self.name = "eosio"
12-
self.account_object_name = account_object_name
13-
self.owner_key = cleos.CreateKey(
11+
def __init__(self, account_object_name):
12+
interface.Account.__init__(self, "eosio",
13+
cleos.CreateKey(
1414
config.eosio_key_public(),
1515
config.eosio_key_private()
16-
)
17-
self.active_key = self.owner_key
16+
))
17+
self.account_object_name = account_object_name
1818

1919
def info(self):
2020
msg = manager.accout_names_2_object_names(
@@ -36,7 +36,7 @@ class GetAccount(cleos.GetAccount):
3636
def __init__(
3737
self,
3838
account_object_name, name=None,
39-
owner_key=None, active_key=None, verbosity=None):
39+
owner_key=None, active_key=None):
4040

4141
self.account_object_name = account_object_name
4242
if name is None:
@@ -91,7 +91,7 @@ def __str__(self):
9191

9292

9393
class RestoreAccount(cleos.RestoreAccount):
94-
def __init__(self, name, verbosity=None):
94+
def __init__(self, name):
9595
cleos.RestoreAccount.__init__(self, name, is_verbose=False)
9696

9797

@@ -107,8 +107,7 @@ def __init__(
107107
max_cpu_usage=0,
108108
max_net_usage=0,
109109
ref_block=None,
110-
delay_sec=0,
111-
verbosity=None):
110+
delay_sec=0):
112111
cleos.CreateAccount.__init__(
113112
self, creator, name, owner_key, active_key, permission,
114113
expiration_sec, skip_sign, dont_broadcast, force_unique,
@@ -127,8 +126,7 @@ def __init__(
127126
expiration_sec=None,
128127
skip_sign=0, dont_broadcast=0, force_unique=0,
129128
max_cpu_usage=0, max_net_usage=0,
130-
ref_block=None,
131-
verbosity=None):
129+
ref_block=None):
132130

133131
cleos_sys.SystemNewaccount.__init__(
134132
self, creator, name, owner_key, active_key,

eosfactory/core/cleos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def __init__(self, account, is_info=True, is_verbose=True):
211211
if permission["perm_name"] == "active":
212212
self.active_key = key
213213
else:
214-
owner = re.search('owner\s+1\:\s+1\s(.*)\n', self.out_msg)
215-
active = re.search('active\s+1\:\s+1\s(.*)\n', self.out_msg)
214+
owner = re.search(r'owner\s+1\:\s+1\s(.*)\n', self.out_msg)
215+
active = re.search(r'active\s+1\:\s+1\s(.*)\n', self.out_msg)
216216
if owner and active:
217217
self.owner_key = owner.group(1)
218218
self.active_key = active.group(1)

eosfactory/core/cleos_set.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import re
2-
import types
32

43
import eosfactory.core.errors as errors
5-
import eosfactory.core.logger as logger
64
import eosfactory.core.manager as manager
75
import eosfactory.core.interface as interface
86
import eosfactory.core.cleos as cleos
@@ -45,7 +43,6 @@ def __init__(
4543
Cannot determine the contract directory. The clue is
4644
{}.
4745
""".format(contract_dir))
48-
return
4946

5047
contract_path_absolute = files[0]
5148
wasm_file = files[1]
@@ -182,6 +179,8 @@ def __init__(
182179
args.append("--dont-broadcast")
183180
if force_unique:
184181
args.append("--force-unique")
182+
if return_packed:
183+
args.append("--return-packed")
185184
if max_cpu_usage:
186185
args.extend(["--max-cpu-usage-ms", str(max_cpu_usage)])
187186
if max_net_usage:
@@ -212,7 +211,7 @@ class SetActionPermission(cleos.Cleos):
212211
permission authority for.
213212
code (str or .interface.Account): The account that owns the code for \
214213
the action.
215-
type (str): The type of the action.
214+
action_type (str): The type of the action.
216215
requirement (str): The permission name require for executing the given
217216
action.
218217
@@ -227,7 +226,7 @@ class SetActionPermission(cleos.Cleos):
227226
component of EOSIO cleos responce.
228227
'''
229228
def __init__(
230-
self, account, code, type, requirement,
229+
self, account, code, action_type, requirement,
231230
permission=None,
232231
expiration_sec=None,
233232
skip_sign=0, dont_broadcast=0, return_packed=0, force_unique=0,
@@ -242,7 +241,7 @@ def __init__(
242241
code_name = interface.account_arg(code)
243242
args.append(code_name)
244243

245-
args.append(type)
244+
args.append(action_type)
246245

247246
if requirement:
248247
requirement_name = interface.account_arg(requirement)
@@ -265,6 +264,8 @@ def __init__(
265264
args.append("--dont-broadcast")
266265
if force_unique:
267266
args.append("--force-unique")
267+
if return_packed:
268+
args.append("--return-packed")
268269
if max_cpu_usage:
269270
args.extend(["--max-cpu-usage-ms", str(max_cpu_usage)])
270271
if max_net_usage:
@@ -274,7 +275,7 @@ def __init__(
274275
if delay_sec:
275276
args.extend(["--delay-sec", str(delay_sec)])
276277

277-
self = cleos.Cleos(args, "set", "action permission", is_verbose)
278+
cleos.Cleos.__init__(self, args, "set", "action permission", is_verbose)
278279
self.console = None
279280
self.data = None
280281

eosfactory/core/cleos_sys.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import eosfactory.core.cleos as cleos
2-
import eosfactory.core.setup as setup
32
import eosfactory.core.interface as interface
43

54
def reload():
@@ -47,7 +46,7 @@ def __init__(
4746
stake_cpu = "{} EOS".format(stake_cpu)
4847

4948
if name is None:
50-
name = account_name()
49+
name = cleos.account_name()
5150
interface.Account.__init__(self, name)
5251

5352
self.owner_key = None # private keys
@@ -76,6 +75,8 @@ def __init__(
7675
p = interface.permission_arg(permission)
7776
for perm in p:
7877
args.extend(["--permission", perm])
78+
if expiration_sec:
79+
args.extend(["--expiration", str(expiration_sec)])
7980
if skip_sign:
8081
args.append("--skip-sign")
8182
if dont_broadcast:
@@ -136,6 +137,8 @@ def __init__(
136137

137138
if buy_ram_kbytes:
138139
args.extend(["--kbytes"])
140+
if expiration_sec:
141+
args.extend(["--expiration", str(expiration_sec)])
139142
if skip_sign:
140143
args.append("--skip-sign")
141144
if dont_broadcast:

eosfactory/core/errors.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import re
22
import sys
3-
import inspect
43

54
import eosfactory.core.logger as logger
65
import eosfactory.core.interface as interface
@@ -16,8 +15,8 @@ def validate(omittable):
1615
if "unknown key" in err_msg:
1716
raise AccountDoesNotExistError(omittable)
1817
elif "Error 3080001: Account using more than allotted RAM" in err_msg:
19-
needs = int(re.search('needs\s(.*)\sbytes\shas', err_msg).group(1))
20-
has = int(re.search('bytes\shas\s(.*)\sbytes', err_msg).group(1))
18+
needs = int(re.search(r'needs\s(.*)\sbytes\shas', err_msg).group(1))
19+
has = int(re.search(r'bytes\shas\s(.*)\sbytes', err_msg).group(1))
2120
raise LowRamError(needs, needs - has)
2221
elif "transaction executed locally, but may not be" in err_msg:
2322
pass
@@ -44,7 +43,7 @@ def validate(omittable):
4443
raise Error(err_msg)
4544

4645

47-
def excepthook(type, value, traceback):
46+
def excepthook(exc_type, value, traceback):
4847
print(value)
4948

5049

@@ -62,7 +61,7 @@ def __init__(
6261
else:
6362
sys.excepthook = excepthook
6463
sys.tracebacklimit = 0
65-
from inspect import currentframe, getframeinfo, stack
64+
from inspect import getframeinfo, stack
6665
frameinfo = getframeinfo(stack()[stack_frame][0])
6766
details = " {} {}".format(frameinfo.filename, frameinfo.lineno)
6867
self.message = logger.error(message, translate, details=details)

0 commit comments

Comments
 (0)