From 3c61da1c0f0fa7297b5fb7894d3d4c8cd524ed98 Mon Sep 17 00:00:00 2001 From: Ilya Koltsov Date: Tue, 16 Apr 2024 19:17:46 +0100 Subject: [PATCH] Fix Tuple3 constructor (CMW-1060) --- tests/types/cl_value/tuple3_test.go | 8 ++++++++ types/clvalue/tuple3.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/types/cl_value/tuple3_test.go b/tests/types/cl_value/tuple3_test.go index 30df36f..76146bf 100644 --- a/tests/types/cl_value/tuple3_test.go +++ b/tests/types/cl_value/tuple3_test.go @@ -39,3 +39,11 @@ func Test_FromBytesByType_Tuple3U32ToVal(t *testing.T) { require.NoError(t, err) assert.Equal(t, "(10, 11, 12)", res.String()) } + +func Test_NewCLTuple3(t *testing.T) { + val1 := clvalue.NewCLUInt32(10) + val2 := clvalue.NewCLUInt32(11) + val3 := clvalue.NewCLUInt32(12) + res := clvalue.NewCLTuple3(*val1, *val2, *val3) + assert.Equal(t, "(10, 11, 12)", res.String()) +} diff --git a/types/clvalue/tuple3.go b/types/clvalue/tuple3.go index 4e8c2ed..8ed5a27 100644 --- a/types/clvalue/tuple3.go +++ b/types/clvalue/tuple3.go @@ -31,7 +31,7 @@ func NewCLTuple3(val1 CLValue, val2 CLValue, val3 CLValue) CLValue { innerType: tupleType, Inner1: val1, Inner2: val2, - Inner3: val2, + Inner3: val3, }} }