File tree 1 file changed +24
-6
lines changed
1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ Get the hash according to eip-712 through the passed parameters.
19
19
### Struct
20
20
```
21
21
typedef struct _eip712_domain {
22
- uint8_t chain_id[32 ];
22
+ uint8_t chain_id[EIP712_HASH_SIZE ];
23
23
char* name;
24
- uint8_t* verifying_contract;
24
+ uint8_t verifying_contract[20] ;
25
25
char* version;
26
26
} eip712_domain;
27
27
@@ -30,11 +30,27 @@ typedef struct _eip712_active {
30
30
char* params;
31
31
} eip712_active;
32
32
33
+ typedef struct _eip712_cell {
34
+ char* capacity;
35
+ char* lock;
36
+ char* type;
37
+ char* data;
38
+ char* extra_data;
39
+ } eip712_cell;
40
+
33
41
typedef struct _eip712_data {
34
- eip712_domain doamin ;
42
+ eip712_domain domain ;
35
43
eip712_active active;
36
- char* cell_extra_data;
37
44
char* transaction_das_message;
45
+ char* inputs_capacity;
46
+ char* outputs_capacity;
47
+ char* fee;
48
+ uint8_t digest[32];
49
+
50
+ eip712_cell* inputs;
51
+ size_t inputs_len;
52
+ eip712_cell* outputs;
53
+ size_t outputs_len;
38
54
} eip712_data;
39
55
```
40
56
@@ -80,5 +96,7 @@ Last message hash: 0xcce661e249e03e2e0c581e1763fa1432491863c625a4128dd966822cc5f
80
96
#### C testcases
81
97
Verify that the C code is executed correctly and check for memory problems, Also need to write fuzzing tests.
82
98
83
- #### Contract Testcases
84
- Test cases that are actually executed in the contract, use rust.
99
+ ## NOTE
100
+ * Only functions declared in eip712.h are tested
101
+ * Tests are executed directly in ckb-debugger
102
+ * All strings must be \0 terminated
You can’t perform that action at this time.
0 commit comments