Commit a090c62 1 parent 5b94e3c commit a090c62 Copy full SHA for a090c62
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ const readSignature = (bytes: Uint8Array) => new Signature(
37
37
readField ( bytes . subarray ( 32 ) )
38
38
) ;
39
39
40
+ const encoder = new TextEncoder ( ) ;
41
+ const encodedEventInit = encoder . encode ( "KimlikDAO-init" ) ;
42
+ const encodedEventCreate = encoder . encode ( "KimlikDAO-add-HumanIDv1" ) ;
43
+
40
44
class HumanIDv1 extends Struct ( {
41
45
id : Field ,
42
46
commitmentR : Field ,
@@ -108,7 +112,7 @@ class PerHumanIDv1Contract extends SmartContract {
108
112
"KimlikDAO-init" ,
109
113
new EventStruct (
110
114
{
111
- uid : Poseidon . hash ( [ Field ( "KimlikDAO-init" ) ] ) ,
115
+ uid : Poseidon . hash ( [ readField ( encodedEventInit ) ] ) ,
112
116
humanIDv1 : Field ( 32 )
113
117
}
114
118
)
@@ -127,7 +131,7 @@ class PerHumanIDv1Contract extends SmartContract {
127
131
"KimlikDAO-add-HumanIDv1" ,
128
132
new EventStruct (
129
133
{
130
- uid : Poseidon . hash ( [ Field ( "KimlikDAO-add-HumanIDv1" ) ] ) ,
134
+ uid : Poseidon . hash ( [ readField ( encodedEventCreate ) ] ) ,
131
135
humanIDv1 : humanIDv1 . id
132
136
}
133
137
) ) ;
You can’t perform that action at this time.
0 commit comments