Commit f7e4cb60 authored by Andreas Bigger's avatar Andreas Bigger

remove explicit reference on instantiation for frameData

parent ccba6519
...@@ -295,14 +295,14 @@ func TestBuilderNextFrame(t *testing.T) { ...@@ -295,14 +295,14 @@ func TestBuilderNextFrame(t *testing.T) {
// Push one frame into to the channel builder // Push one frame into to the channel builder
expectedTx := txID{chID: co.ID(), frameNumber: fn} expectedTx := txID{chID: co.ID(), frameNumber: fn}
expectedBytes := buf.Bytes() expectedBytes := buf.Bytes()
frameData := &frameData{ frameData := frameData{
id: frameID{ id: frameID{
chID: co.ID(), chID: co.ID(),
frameNumber: fn, frameNumber: fn,
}, },
data: expectedBytes, data: expectedBytes,
} }
cb.PushFrame(*frameData) cb.PushFrame(frameData)
// There should only be 1 frame in the channel builder // There should only be 1 frame in the channel builder
require.Equal(t, 1, cb.NumFrames()) require.Equal(t, 1, cb.NumFrames())
...@@ -336,22 +336,20 @@ func TestBuilderWrongFramePanic(t *testing.T) { ...@@ -336,22 +336,20 @@ func TestBuilderWrongFramePanic(t *testing.T) {
// The frame push should panic since we constructed a new channel out // The frame push should panic since we constructed a new channel out
// so the channel out id won't match // so the channel out id won't match
require.PanicsWithValue(t, "wrong channel", func() { require.PanicsWithValue(t, "wrong channel", func() {
frame := &frameData{ frame := frameData{
id: frameID{ id: frameID{
chID: co.ID(), chID: co.ID(),
frameNumber: fn, frameNumber: fn,
}, },
data: buf.Bytes(), data: buf.Bytes(),
} }
cb.PushFrame(*frame) cb.PushFrame(frame)
}) })
} }
// TestOutputFrames tests the OutputFrames function // TestOutputFrames tests the OutputFrames function
func TestOutputFrames(t *testing.T) { func TestOutputFrames(t *testing.T) {
channelConfig := defaultTestChannelConfig channelConfig := defaultTestChannelConfig
// Lower the max frame size so that we can test
channelConfig.MaxFrameSize = 2 channelConfig.MaxFrameSize = 2
// Construct the channel builder // Construct the channel builder
...@@ -401,8 +399,6 @@ func TestOutputFrames(t *testing.T) { ...@@ -401,8 +399,6 @@ func TestOutputFrames(t *testing.T) {
// function errors when the max RLP bytes per channel is reached. // function errors when the max RLP bytes per channel is reached.
func TestMaxRLPBytesPerChannel(t *testing.T) { func TestMaxRLPBytesPerChannel(t *testing.T) {
channelConfig := defaultTestChannelConfig channelConfig := defaultTestChannelConfig
// Lower the max frame size so that we can test
channelConfig.MaxFrameSize = 2 channelConfig.MaxFrameSize = 2
// Construct the channel builder // Construct the channel builder
...@@ -420,8 +416,6 @@ func TestMaxRLPBytesPerChannel(t *testing.T) { ...@@ -420,8 +416,6 @@ func TestMaxRLPBytesPerChannel(t *testing.T) {
// function errors when the max frame index is reached. // function errors when the max frame index is reached.
func TestOutputFramesMaxFrameIndex(t *testing.T) { func TestOutputFramesMaxFrameIndex(t *testing.T) {
channelConfig := defaultTestChannelConfig channelConfig := defaultTestChannelConfig
// Lower the max frame size so that we can test
channelConfig.MaxFrameSize = 1 channelConfig.MaxFrameSize = 1
channelConfig.TargetNumFrames = math.MaxInt channelConfig.TargetNumFrames = math.MaxInt
channelConfig.TargetFrameSize = 1 // math.MaxUint64 channelConfig.TargetFrameSize = 1 // math.MaxUint64
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment