Skip to content

Commit

Permalink
op-service: end to end encode/decode scalar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Apr 2, 2024
1 parent e041528 commit c0a8fce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions op-service/eth/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ func TestEcotoneScalars(t *testing.T) {
} else {
require.Equal(t, tc.blobBaseFeeScalar, blobScalar)
require.Equal(t, tc.baseFeeScalar, regScalar)

encoded := EncodeScalar(tc.blobBaseFeeScalar, tc.baseFeeScalar)
require.Equal(t, tc.val, encoded)

blob, base, err := DecodeScalar(encoded)
require.NoError(t, err)
require.Equal(t, tc.blobBaseFeeScalar, blob)
require.Equal(t, tc.baseFeeScalar, base)
}
})
}
Expand Down

0 comments on commit c0a8fce

Please sign in to comment.