Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements SNIP-12 #637

Merged
merged 45 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0395ba1
General semantic updates and EncodeType adjustment
thiagodeev Oct 14, 2024
64d2145
Improvements and bug fixes
thiagodeev Oct 16, 2024
4df1af7
Implements typedData unmarshal
thiagodeev Oct 16, 2024
5459a56
Adds Message support on Unmarshal typedData
thiagodeev Oct 17, 2024
43e67de
Rename files and create types file
thiagodeev Oct 17, 2024
d3dca1d
Creates TestGeneral_CreateMessageWithTypes
thiagodeev Oct 17, 2024
5494ea4
Clears some curve methods and adds Poseidon method
thiagodeev Oct 21, 2024
0fdc98b
Adds revision.go file, new Revision field of TypedData
thiagodeev Oct 21, 2024
de9cf53
Basic implementation working with a rev 0 typedData
thiagodeev Oct 24, 2024
7b5bbfc
Rename files
thiagodeev Oct 24, 2024
6f171e1
Merge branch 'main' into thiagodeev/feature_snip-12
thiagodeev Oct 24, 2024
1fdcd72
Merge branch 'main' into thiagodeev/feature_snip-12
thiagodeev Nov 20, 2024
2ba0749
Some code adjustments
thiagodeev Nov 20, 2024
a1f7a01
Adds new examples from starknet.js and implements new mock logic
thiagodeev Nov 20, 2024
5d883e4
init function on revision package
thiagodeev Nov 22, 2024
4720826
Adds first version of Validate feature
thiagodeev Nov 22, 2024
9ba0234
Adds revision 1 support to encodeType
thiagodeev Nov 24, 2024
118b41e
Adds 'selector' support in encodeData
thiagodeev Nov 24, 2024
d95c18c
restructs encodeData
thiagodeev Nov 25, 2024
89be528
adds handleStandardTypes and handleArrays functions
thiagodeev Nov 25, 2024
c189f28
support to arrays, new types and new Domain unmarshal
thiagodeev Nov 25, 2024
e261812
fixed support to bool, new example being tested
thiagodeev Nov 25, 2024
f081714
fixes errors in encodeType, 'example_presetTypes' supported
thiagodeev Nov 26, 2024
970e6e5
implements merkletree encode
thiagodeev Nov 26, 2024
b0af345
adds support to 'mail_StructArray' json example
thiagodeev Nov 26, 2024
91f6ee8
Fixes error inStringToByteArrFelt func, 'v1Nested' example passing
thiagodeev Nov 28, 2024
f0416c9
Started to refactor 'encodeType' func
thiagodeev Nov 29, 2024
641019a
Fixes bug with merkletree
thiagodeev Nov 29, 2024
efbf05f
Creates the verifyType func
thiagodeev Nov 29, 2024
312db9d
implements enum encoding
thiagodeev Dec 2, 2024
9a59632
Removes the validation method, it will be added later
thiagodeev Dec 2, 2024
161c1fe
creates big example for testing purpose
thiagodeev Dec 3, 2024
245dee3
removes the types file
thiagodeev Dec 3, 2024
4c80785
adds code comments and descriptions
thiagodeev Dec 3, 2024
48b1a89
rename folder and file names
thiagodeev Dec 3, 2024
1286e84
creates typedData example and change READMEs
thiagodeev Dec 3, 2024
36554fb
Update utils/Felt.go
thiagodeev Dec 4, 2024
905ea9c
Update utils/keccak.go
thiagodeev Dec 4, 2024
9930d06
addresses Rian's comment about GetMessageHash
thiagodeev Dec 4, 2024
58919d6
Revert enum wrong encode as it was fixed by starknet.js
thiagodeev Dec 4, 2024
0a53373
Merge branch 'main' into thiagodeev/feature_snip-12
thiagodeev Dec 13, 2024
af08361
Creates ValidationSignature helper
thiagodeev Dec 13, 2024
3900aee
Removes the StrToFelt utility
thiagodeev Dec 13, 2024
1b5d956
Improves 'chainId' validation
thiagodeev Dec 13, 2024
f597d20
Changes private fields of TypedData to public
thiagodeev Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename files
thiagodeev committed Oct 24, 2024
commit 7b5bbfce7dd4fc72103f1913011e528a3c9e5e57
2 changes: 1 addition & 1 deletion typedData/revision.go → typed/revision.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package typedData
package typed

import (
"fmt"
File renamed without changes.
2 changes: 1 addition & 1 deletion typedData/typedData.go → typed/typed.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package typedData
package typed

import (
"bytes"
2 changes: 1 addition & 1 deletion typedData/typedData_test.go → typed/typed_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package typedData
package typed

import (
"encoding/json"
@@ -53,7 +53,7 @@
ChainId: "1",
}

var message = `

Check failure on line 56 in typed/typed_test.go

GitHub Actions / lint

var `message` is unused (unused)
{
"from": {
"name": "Cow",
2 changes: 1 addition & 1 deletion typedData/types.go → typed/types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package typedData
package typed

import "math/big"