From e9fe044c719e2a014f9a7d2f131e417c5467607d Mon Sep 17 00:00:00 2001 From: thiagodeev Date: Fri, 24 May 2024 17:08:24 -0300 Subject: [PATCH] Fixed TestClassAt at mock environment --- rpc/contract_test.go | 2 -- rpc/mock_test.go | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/rpc/contract_test.go b/rpc/contract_test.go index 461b0e43..e1eb70af 100644 --- a/rpc/contract_test.go +++ b/rpc/contract_test.go @@ -89,7 +89,6 @@ func TestClassAt(t *testing.T) { require.Condition(func() bool { for _, deprecatedCairoEntryPoint := range class.DeprecatedEntryPointsByType.External { - t.Log(deprecatedCairoEntryPoint) if test.ExpectedOperation == deprecatedCairoEntryPoint.Selector.String() { return true } @@ -104,7 +103,6 @@ func TestClassAt(t *testing.T) { require.Condition(func() bool { for _, entryPointsByType := range class.EntryPointsByType.External { - t.Log(entryPointsByType) if test.ExpectedOperation == entryPointsByType.Selector.String() { return true } diff --git a/rpc/mock_test.go b/rpc/mock_test.go index fd388590..dc0083a0 100644 --- a/rpc/mock_test.go +++ b/rpc/mock_test.go @@ -410,8 +410,22 @@ func mock_starknet_getClassAt(result interface{}, method string, args ...interfa if len(args) != 2 { return errWrongArgs } + fakeSelector, err := utils.HexToFelt("0xdeadbeef") + if err != nil { + return err + } var class = DeprecatedContractClass{ Program: "H4sIAAAAAAAE/+Vde3PbOJL/Kj5VXW1mVqsC36Sr9g8n0c6mzonnbM", + DeprecatedEntryPointsByType: DeprecatedEntryPointsByType{ + Constructor: []DeprecatedCairoEntryPoint{}, + External: []DeprecatedCairoEntryPoint{ + { + Offset: "0x0xdeadbeef", + Selector: fakeSelector, + }, + }, + L1Handler: []DeprecatedCairoEntryPoint{}, + }, } outputContent, err := json.Marshal(class) if err != nil {