Giter Club home page Giter Club logo

seer's People

Stargazers

 avatar

Watchers

 avatar

seer's Issues

"seer evm generate" does not properly handle nested byte arrays

Currently, if a method argument or return type is a struct which contains a field that is a byte array (of arbitrary depth), then the code generated by seer evm generate does not properly handle that field.

This is a somewhat deep issue caused by the behavior of encoding/json.

There are a few solutions that come to mind:

  1. Extend the way that seer evm generate handles method arguments which are themselves byte arrays.
  2. Write a drop-in replacement for encoding/json which represents []byte as string when marshaling (and vice versa when unmarshaling).

Error with arrays of 252-bit field elements in "seer starknet generate"

When generating code from this Dojo ABI: https://raw.githubusercontent.com/dojoengine/dojo/5a1176e8b00e11101410bda889c854bc5bef76d5/examples/spawn-and-move/abis/base/models/moves.json

All the ..._Felt252 types are buggy.

// Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 is the Go struct corresponding to the core::array::Span::<(core::felt252, core::array::Span::<core::felt252>)> struct.
type Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 struct {
	Snapshot []core_Felt252Core_Array_Span_core_Felt252
}

// ParseCore_Array_Span_core_Felt252Core_Array_Span_core_Felt252 parses a Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 struct from a list of felts. This function returns a tuple of:
// 1. The parsed Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252 struct
// 2. The number of field elements consumed in the parse
// 3. An error if the parse failed, nil otherwise
func ParseCore_Array_Span_core_Felt252Core_Array_Span_core_Felt252(parameters []*felt.Felt) (Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252, int, error) {
	currentIndex := 0
	result := Core_Array_Span_core_Felt252Core_Array_Span_core_Felt252{}

	value0, consumed, err := ParseArray[core_Felt252Core_Array_Span_core_Felt252](Parsecore_Felt252Core_Array_Span_core_Felt252)(parameters[currentIndex:])
	if err != nil {
		return result, 0, err
	}
	result.Snapshot = value0
	currentIndex += consumed

	return result, currentIndex, nil
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.