Skip to content

Commit

Permalink
Improves TraceBlock test
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodeev committed Aug 29, 2024
1 parent 575a676 commit 80ab4ef
Show file tree
Hide file tree
Showing 3 changed files with 10,100 additions and 10,105 deletions.
9 changes: 4 additions & 5 deletions rpc/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1304,19 +1304,18 @@ func mock_starknet_traceBlockTransactions(result interface{}, args ...interface{
if !ok {
return errors.Wrap(errWrongArgs, fmt.Sprintf("args[0] should be BlockID, got %T\n", args[0]))
}
if blockID.Hash.String() == "0x42a4c6a4c3dffee2cce78f04259b499437049b0084c3296da9fbbec7eda79b2" {
if blockID.Hash != nil && blockID.Hash.String() == "0x42a4c6a4c3dffee2cce78f04259b499437049b0084c3296da9fbbec7eda79b2" {

var rawBlockTrace []Trace

var rawBlockTrace struct {
Result []Trace `json:"result"`
}
read, err := os.ReadFile("tests/trace/sepoliaBlockTrace_0x42a4c6a4c3dffee2cce78f04259b499437049b0084c3296da9fbbec7eda79b2.json")
if err != nil {
return err
}
if nil != json.Unmarshal(read, &rawBlockTrace) {
return err
}
BlockTrace, err := json.Marshal(rawBlockTrace.Result)
BlockTrace, err := json.Marshal(rawBlockTrace)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 80ab4ef

Please sign in to comment.