Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mininny committed Oct 1, 2024
1 parent 08f76b3 commit 1a5a788
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions rvgo/cmd/load_elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"debug/elf"
"fmt"

cannon "github.com/ethereum-optimism/optimism/cannon/cmd"
"github.com/ethereum-optimism/optimism/cannon/serialize"
"github.com/ethereum-optimism/optimism/op-service/ioutil"
Expand Down
1 change: 1 addition & 0 deletions rvgo/cmd/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"

"github.com/urfave/cli/v2"

"github.com/ethereum-optimism/asterisc/rvgo/fast"
Expand Down
14 changes: 14 additions & 0 deletions rvgo/fast/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,17 @@ func TestMemoryJSON(t *testing.T) {
m.GetUnaligned(8, dest[:])
require.Equal(t, uint8(123), dest[0])
}

func TestMemoryBinary(t *testing.T) {
m := NewMemory()
m.SetUnaligned(8, []byte{123})
ser := new(bytes.Buffer)
err := m.Serialize(ser)
require.NoError(t, err, "must serialize state")
m2 := NewMemory()
err = m2.Deserialize(ser)
require.NoError(t, err, "must deserialize state")
var dest [1]byte
m.GetUnaligned(8, dest[:])
require.Equal(t, uint8(123), dest[0])
}
3 changes: 2 additions & 1 deletion rvgo/fast/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package fast
import (
"encoding/binary"
"fmt"
"github.com/ethereum-optimism/optimism/cannon/serialize"
"io"

"github.com/ethereum-optimism/optimism/cannon/serialize"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
Expand Down
3 changes: 2 additions & 1 deletion rvgo/fast/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package fast

import (
"bytes"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/require"
"testing"
)

func TestSerializeStateRoundTrip(t *testing.T) {
Expand Down

0 comments on commit 1a5a788

Please sign in to comment.