Skip to content

Commit

Permalink
Merge pull request #3 from moonstream-to/fix-starknet-struct-parsers
Browse files Browse the repository at this point in the history
Fix starknet struct parsers
  • Loading branch information
zomglings authored Jan 24, 2024
2 parents 7bd6237 + 75ec7a6 commit fe32fd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions starknet/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func ParseBigInt(parameters []*felt.Felt) (*big.Int, int, error) {
if len(parameters) < 1 {
return nil, 0, ErrIncorrectParameters
}
var result *big.Int
result := big.NewInt(0)
result = parameters[0].BigInt(result)
return result, 1, nil
}
Expand All @@ -362,17 +362,17 @@ func ParseArray[T any](parser func(parameters []*felt.Felt) (T, int, error)) fun
}
result := make([]T, arrayLength)
currentIndex := 0
currentIndex := 1
for i := 0; i < arrayLength; i++ {
parsed, consumed, err := parser(parameters[currentIndex + 1:])
parsed, consumed, err := parser(parameters[currentIndex:])
if err != nil {
return nil, 0, err
}
result[i] = parsed
currentIndex += consumed
}
return result, currentIndex + 1, nil
return result, currentIndex, nil
}
}
`
Expand Down Expand Up @@ -406,7 +406,7 @@ func {{.ParserName}}(parameters []*felt.Felt) ({{.GoName}}, int, error) {
{{end}}
return result, currentIndex + 1, nil
return result, currentIndex, nil
}
`

Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package version

var SeerVersion string = "0.0.3"
var SeerVersion string = "0.0.4"

0 comments on commit fe32fd9

Please sign in to comment.