concrete-eth / concrete-geth

Concrete is a framework for building application-specific rollups on the OP Stack
GNU Lesser General Public License v3.0
47 stars 19 forks source link

Add proper mock Caller and BlockContext for testing #37

Closed therealbytes closed 1 month ago

therealbytes commented 1 month ago

Rationale

The current mocks in concrete/api/mock.go return nil/zero values for every method, which is insufficient for proper testing.

Implementation

Create mocks that expose the right interface while also exposing methods to manipulate their internal state and hook into their execution during testing.

[ODHack 4.0] Contributors: Note that we highly recommend that you comment on the issue by introducing yourself and how you plan on tackling the issue! Just saying you want an issue is not helpful. This will help with assigning tasks, especially if many comment.

DevPelz commented 1 month ago

can i hop on this?

rajeshkumarrobert commented 1 month ago

Can I work on this for ODHack?

My approach would be

  1. For mockBlockContext I'll take this as reference https://github.com/concrete-eth/concrete-geth/blob/bbfb219b2b3d4df32837818a8a52062bede0c1ac/core/vm/evm.go#L104-L124
  2. For mockCaller I would refer go-ethereum https://github.com/ethereum/go-ethereum/blob/master/accounts/abi/bind/base_test.go
therealbytes commented 1 month ago

Hey @rajeshkumarrobert , any progress here?