Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Nov 10, 2024
1 parent 88fb95f commit 05cd715
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions block/fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,14 @@ func TestCreateInstruction(t *testing.T) {
manager := &Manager{
RootDir: t.TempDir(), // Use temporary directory for testing
}
mockSL := new(settlement.MockClientI)
mockSL.On("GetObsoleteDrs").Return([]uint32{}, nil)
mockSL.On("GetRollapp").Return(&types.Rollapp{
Revision: 2,
RevisionStartHeight: 100,
}, nil)

manager.SLClient = mockSL
err := manager.createInstruction(tt.rollapp)
if tt.expectedError {
assert.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion settlement/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *Client) GetRollapp() (*types.Rollapp, error) {

// GetObsoleteDrs returns the list of deprecated DRS.
func (c *Client) GetObsoleteDrs() ([]uint32, error) {
panic("GetObsoleteDrs not implemented in local SL")
return []uint32{}, nil
}

var _ settlement.ClientI = (*Client)(nil)
Expand Down
2 changes: 1 addition & 1 deletion settlement/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (c *Client) GetAllSequencers() ([]types.Sequencer, error) {

// GetObsoleteDrs returns the list of deprecated DRS.
func (c *Client) GetObsoleteDrs() ([]uint32, error) {
panic("GetObsoleteDrs not implemented in local SL")
return []uint32{}, nil
}

// GetBondedSequencers implements settlement.ClientI.
Expand Down
3 changes: 1 addition & 2 deletions types/instruction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ func TestPersistInstruction(t *testing.T) {
require.NoError(t, err)
require.Equal(t, instructionWithNilFaultyDrs, instruction)

faultyDrs := new(uint64)
*faultyDrs = 1
faultyDrs := []uint32{1}
instructionWithFaultyDrs := Instruction{
Revision: 1,
RevisionStartHeight: 1,
Expand Down

0 comments on commit 05cd715

Please sign in to comment.