NethermindEth / juno

Starknet client implementation.
https://juno.nethermind.io
Apache License 2.0
371 stars 157 forks source link

Pps sandbox #1860

Open rianhughes opened 1 month ago

rianhughes commented 1 month ago

Note: this is an exercise - it's NOT to be merged

rianhughes commented 1 month ago

You should also remove the changes to cmd/juno, and the juno/*.sst files.

After that run make format, make lint, and fix any lint errors.

Finally, just make sure the tests pass on the workflows (you may need to ping someone from the juno team to run the workflows)

PsychoPunkSage commented 1 month ago

Hi.. I'm getting this error image

on running the tests. Can anyone help?

I think I am getting error here..

func (h *Handler) JunoGetNodesFromRoot(key felt.Felt) (string, *jsonrpc.Error) {
    stateReader, _, error := h.bcReader.HeadState()
    if error != nil {
        return "", ErrBlockNotFound
    }
@>  try, _, errTry := stateReader.NodeFromRoot()
@>  if errTry != nil {
@>      return "", ErrBlockNotFound
@>  }

    k := try.FeltToKeyConverter(&key)
    storageNodes, err := try.GetNodesFromRoot(&k)
    if err != nil {
        return "", ErrBlockNotFound
    }

    parsedNodes := try.NodeParser(storageNodes)

    jsonBytes, err := json.Marshal(parsedNodes)
    if err != nil {
        return "", ErrParsingError
    }
    return string(jsonBytes), nil
}
PsychoPunkSage commented 1 month ago

Hi @rianhughes Please have a look at task 5

PsychoPunkSage commented 1 month ago

Hi @rianhughes I tried to implement NodesFromRoot Mock... but I'm facing little difficulty in doing so... Can you please have a look at the code and tell me what I'm doing Wrong?? Or what changes I have to make??

Link to Mocks

PsychoPunkSage commented 1 month ago

I also want to ask one more thing... I have to also do exercise 6?? Or after completing 5 I can do some contribution to juno??