Skip to content

Commit 9bc5a29

Browse files
authored
Merge pull request #6 from crossbario/master
copy over helper files from deprecated pyethereum repo
2 parents 59923c6 + 6830b89 commit 9bc5a29

8 files changed

+608
-28
lines changed

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md
2+
include LICENSE
3+
include requirements.txt

py_eth_sig_utils/eip712/encoding.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ethereum import utils
1+
from .. import utils
22
from eth_abi import encode_single, encode_abi
33

44
def create_struct_definition(name, schema):

py_eth_sig_utils/signing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ethereum import utils
1+
from . import utils
22
from eth_utils import big_endian_to_int
33
from .eip712 import encode_typed_data
44

py_eth_sig_utils/tests/test_eip712_encode.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import unittest
2-
from ethereum import utils
2+
from .. import utils
33
from ..eip712.encoding import *
44

55
class TestEIP712(unittest.TestCase):
66

77
def test_encode_type_data(self):
88
#print("Test Simple")
9-
data = {
10-
"types": {
11-
"EIP712Domain": [
9+
data = {
10+
"types": {
11+
"EIP712Domain": [
1212
{ "name": 'name', "type": 'string' },
1313
{ "name": 'version', "type": 'string' },
1414
{ "name": 'chainId', "type": 'uint256' },
@@ -41,7 +41,7 @@ def test_encode_type_data(self):
4141
"wallet": '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
4242
},
4343
"contents": 'Hello, Bob!',
44-
},
44+
},
4545
}
4646
#print(create_schema("Mail", data["types"]))
4747
self.assertEqual('Mail(Person from,Person to,string contents)Person(string name,address wallet)', create_schema("Mail", data["types"]))
@@ -58,9 +58,9 @@ def test_encode_type_data(self):
5858

5959
def test_encode_type_data_array(self):
6060
#print("Test Arrays")
61-
data = {
62-
"types": {
63-
"EIP712Domain": [
61+
data = {
62+
"types": {
63+
"EIP712Domain": [
6464
{ "name": 'name', "type": 'string' },
6565
{ "name": 'version', "type": 'string' },
6666
{ "name": 'chainId', "type": 'uint256' },
@@ -93,7 +93,7 @@ def test_encode_type_data_array(self):
9393
"wallet": '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
9494
}],
9595
"contents": 'Hello, Bob!',
96-
},
96+
},
9797
}
9898

9999
#print(create_schema("Mail", data["types"]))
@@ -111,9 +111,9 @@ def test_encode_type_data_array(self):
111111

112112
def test_encode_type_data_array_bytes(self):
113113
#print("Test Arrays and Bytes")
114-
data = {
115-
"types": {
116-
"EIP712Domain": [
114+
data = {
115+
"types": {
116+
"EIP712Domain": [
117117
{ "name": 'name', "type": 'string' },
118118
{ "name": 'version', "type": 'string' },
119119
{ "name": 'chainId', "type": 'uint256' },
@@ -148,7 +148,7 @@ def test_encode_type_data_array_bytes(self):
148148
}],
149149
"contents": 'Hello, Bob!',
150150
"payload": '0x25192142931f380985072cdd991e37f65cf8253ba7a0e675b54163a1d133b8ca'
151-
},
151+
},
152152
}
153153

154154
#print(create_schema("Mail", data["types"]))
@@ -166,9 +166,9 @@ def test_encode_type_data_array_bytes(self):
166166

167167
def test_sign_type_data_bytes(self):
168168
#print("Test Bytes")
169-
data = {
170-
"types": {
171-
"EIP712Domain": [
169+
data = {
170+
"types": {
171+
"EIP712Domain": [
172172
{ "name": 'name', "type": 'string' },
173173
{ "name": 'version', "type": 'string' },
174174
{ "name": 'chainId', "type": 'uint256' },
@@ -203,7 +203,7 @@ def test_sign_type_data_bytes(self):
203203
},
204204
"contents": 'Hello, Bob!',
205205
"payload": '0x25192142931f380985072cdd991e37f65cf8253ba7a0e675b54163a1d133b8ca'
206-
},
206+
},
207207
}
208208

209209
#print(create_schema("Mail", data["types"]))

py_eth_sig_utils/tests/test_sign_typed_data.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import unittest
2-
from ethereum import utils
2+
from .. import utils
33
from ..signing import *
44

55
class TestSignTypedData(unittest.TestCase):
66

7-
data = {
8-
"types": {
9-
"EIP712Domain": [
7+
data = {
8+
"types": {
9+
"EIP712Domain": [
1010
{ "name": 'name', "type": 'string' },
1111
{ "name": 'version', "type": 'string' },
1212
{ "name": 'chainId', "type": 'uint256' },
@@ -39,7 +39,7 @@ class TestSignTypedData(unittest.TestCase):
3939
"wallet": '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
4040
},
4141
"contents": 'Hello, Bob!',
42-
},
42+
},
4343
}
4444

4545
def test_sign(self):

0 commit comments

Comments
 (0)