Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport features db #117

Open
wants to merge 2 commits into
base: batch_pin_conflict
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/golang-migrate/migrate/v4 v4.15.2
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/hyperledger/firefly-common v1.2.1
github.com/hyperledger/firefly-common v1.2.3
github.com/hyperledger/firefly-signer v1.1.5
github.com/jarcoal/httpmock v1.2.0
github.com/karlseguin/ccache v2.0.3+incompatible
Expand All @@ -28,8 +28,8 @@ require (
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
gitlab.com/hfuss/mux-prometheus v0.0.4
golang.org/x/net v0.4.0
golang.org/x/text v0.5.0
golang.org/x/net v0.7.0
golang.org/x/text v0.7.0
gopkg.in/yaml.v2 v2.4.0
)

Expand Down Expand Up @@ -79,8 +79,8 @@ require (
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,8 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hyperledger/firefly-common v1.2.1 h1:h35T5Ask/ixlW70KZxHpPsO5QfdnKBFEyX+7L10lwoo=
github.com/hyperledger/firefly-common v1.2.1/go.mod h1:aqaq2ZUzSlkwVC/TF+pwUkHxGDLYSE2DzdozZ1MIMeM=
github.com/hyperledger/firefly-common v1.2.3 h1:6vlCEVUHZn8QdXdu3qrzfKLnzXsBffAKjWFiT9uWhA4=
github.com/hyperledger/firefly-common v1.2.3/go.mod h1:02hp5BYzAito5JMTjQZluk92xqhL0LxqEEHNENsVcFk=
github.com/hyperledger/firefly-signer v1.1.5 h1:kCHe4O3tmYaMYf1hXrG40sIlpiGfOICmNNAcuMH5+jQ=
github.com/hyperledger/firefly-signer v1.1.5/go.mod h1:XZP8ZXUZJSAPB6WUSM9RqRdpjnjm6Jsn0784WM4IKug=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
Expand Down Expand Up @@ -1396,8 +1396,8 @@ golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -1552,15 +1552,15 @@ golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1570,8 +1570,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/database/sqlcommon/blob_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (s *SQLCommon) InsertBlobs(ctx context.Context, blobs []*core.Blob) (err er
}
defer s.RollbackTx(ctx, tx, autoCommit)

if s.features.MultiRowInsert {
if s.Features().MultiRowInsert {
query := sq.Insert(blobsTable).Columns(blobColumns...)
for _, blob := range blobs {
query = s.setBlobInsertValues(query, blob)
Expand Down
12 changes: 7 additions & 5 deletions internal/database/sqlcommon/blob_sql_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -124,9 +124,10 @@ func TestInsertBlobsBeginFail(t *testing.T) {
}

func TestInsertBlobsMultiRowOK(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()

blob1 := &core.Blob{Hash: fftypes.NewRandB32(), PayloadRef: "pay1"}
blob2 := &core.Blob{Hash: fftypes.NewRandB32(), PayloadRef: "pay2"}
Expand All @@ -144,9 +145,10 @@ func TestInsertBlobsMultiRowOK(t *testing.T) {
}

func TestInsertBlobsMultiRowFail(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()
blob1 := &core.Blob{Hash: fftypes.NewRandB32(), PayloadRef: "pay1"}
mock.ExpectBegin()
mock.ExpectQuery("INSERT.*").WillReturnError(fmt.Errorf("pop"))
Expand Down
2 changes: 1 addition & 1 deletion internal/database/sqlcommon/data_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (s *SQLCommon) InsertDataArray(ctx context.Context, dataArray core.DataArra
}
defer s.RollbackTx(ctx, tx, autoCommit)

if s.features.MultiRowInsert {
if s.Features().MultiRowInsert {
query := sq.Insert(dataTable).Columns(dataColumnsWithValue...)
for _, data := range dataArray {
query = s.setDataInsertValues(query, data)
Expand Down
12 changes: 7 additions & 5 deletions internal/database/sqlcommon/data_sql_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -240,9 +240,10 @@ func TestInsertDataArrayBeginFail(t *testing.T) {
}

func TestInsertDataArrayMultiRowOK(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()

data1 := &core.Data{ID: fftypes.NewUUID(), Namespace: "ns1"}
data2 := &core.Data{ID: fftypes.NewUUID(), Namespace: "ns1"}
Expand All @@ -262,9 +263,10 @@ func TestInsertDataArrayMultiRowOK(t *testing.T) {
}

func TestInsertDataArrayMultiRowFail(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()
data1 := &core.Data{ID: fftypes.NewUUID(), Namespace: "ns1"}
mock.ExpectBegin()
mock.ExpectQuery("INSERT.*").WillReturnError(fmt.Errorf("pop"))
Expand Down
4 changes: 2 additions & 2 deletions internal/database/sqlcommon/event_sql.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -118,7 +118,7 @@ func (p *eventsPCA) PreCommit(ctx context.Context, tx *dbsql.TXWrapper) (err err
}
}

if p.s.features.MultiRowInsert {
if p.s.Features().MultiRowInsert {
query := sq.Insert(eventsTable).Columns(eventColumns...)
for _, event := range p.events {
query = p.s.setEventInsertValues(query, event)
Expand Down
12 changes: 7 additions & 5 deletions internal/database/sqlcommon/event_sql_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -133,9 +133,10 @@ func TestInsertEventFailCommit(t *testing.T) {
}

func TestInsertEventsPreCommitMultiRowOK(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()

ev1 := &core.Event{ID: fftypes.NewUUID(), Namespace: "ns1"}
ev2 := &core.Event{ID: fftypes.NewUUID(), Namespace: "ns1"}
Expand All @@ -162,9 +163,10 @@ func TestInsertEventsPreCommitMultiRowOK(t *testing.T) {
}

func TestInsertEventsPreCommitMultiRowFail(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()
ev1 := &core.Event{ID: fftypes.NewUUID(), Namespace: "ns1"}
mock.ExpectBegin()
mock.ExpectExec("<acquire lock ns1>").WillReturnResult(driver.ResultNoRows)
Expand Down
5 changes: 2 additions & 3 deletions internal/database/sqlcommon/message_sql.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -210,8 +210,7 @@ func (s *SQLCommon) InsertMessages(ctx context.Context, messages []*core.Message
return err
}
defer s.RollbackTx(ctx, tx, autoCommit)

if s.features.MultiRowInsert {
if s.Features().MultiRowInsert {
msgQuery := sq.Insert(messagesTable).Columns(msgColumns...)
dataRefQuery := sq.Insert(messagesDataJoinTable).Columns(
"namespace",
Expand Down
17 changes: 10 additions & 7 deletions internal/database/sqlcommon/message_sql_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -310,9 +310,10 @@ func TestInsertMessagesBeginFail(t *testing.T) {
}

func TestInsertMessagesMultiRowOK(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()

msg1 := &core.Message{Header: core.MessageHeader{ID: fftypes.NewUUID(), Namespace: "ns1"}, LocalNamespace: "ns1", Data: core.DataRefs{{ID: fftypes.NewUUID()}}}
msg2 := &core.Message{Header: core.MessageHeader{ID: fftypes.NewUUID(), Namespace: "ns1"}, LocalNamespace: "ns1", Data: core.DataRefs{{ID: fftypes.NewUUID()}}}
Expand Down Expand Up @@ -340,9 +341,10 @@ func TestInsertMessagesMultiRowOK(t *testing.T) {
}

func TestInsertMessagesMultiRowDataRefsFail(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()

msg1 := &core.Message{Header: core.MessageHeader{ID: fftypes.NewUUID(), Namespace: "ns1"}, Data: core.DataRefs{{ID: fftypes.NewUUID()}}}

Expand All @@ -356,9 +358,10 @@ func TestInsertMessagesMultiRowDataRefsFail(t *testing.T) {
}

func TestInsertMessagesMultiRowFail(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()
msg1 := &core.Message{Header: core.MessageHeader{ID: fftypes.NewUUID(), Namespace: "ns1"}}
mock.ExpectBegin()
mock.ExpectQuery("INSERT.*").WillReturnError(fmt.Errorf("pop"))
Expand Down
4 changes: 2 additions & 2 deletions internal/database/sqlcommon/pin_sql.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -124,7 +124,7 @@ func (s *SQLCommon) InsertPins(ctx context.Context, pins []*core.Pin) error {
}
defer s.RollbackTx(ctx, tx, autoCommit)

if s.features.MultiRowInsert {
if s.Features().MultiRowInsert {
query := sq.Insert(pinsTable).Columns(pinColumns...)
for _, pin := range pins {
query = s.setPinInsertValues(query, pin)
Expand Down
12 changes: 7 additions & 5 deletions internal/database/sqlcommon/pin_sql_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -146,9 +146,10 @@ func TestInsertPinsBeginFail(t *testing.T) {
}

func TestInsertPinsMultiRowOK(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()

pin1 := &core.Pin{Namespace: "ns1", Hash: fftypes.NewRandB32()}
pin2 := &core.Pin{Namespace: "ns1", Hash: fftypes.NewRandB32()}
Expand All @@ -168,9 +169,10 @@ func TestInsertPinsMultiRowOK(t *testing.T) {
}

func TestInsertPinsMultiRowFail(t *testing.T) {
s, mock := newMockProvider().init()
s.features.MultiRowInsert = true
s := newMockProvider()
s.multiRowInsert = true
s.fakePSQLInsert = true
s, mock := s.init()
pin1 := &core.Pin{Hash: fftypes.NewRandB32()}
mock.ExpectBegin()
mock.ExpectQuery("INSERT.*").WillReturnError(fmt.Errorf("pop"))
Expand Down
5 changes: 4 additions & 1 deletion internal/database/sqlcommon/provider_mock_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2021 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -45,6 +45,7 @@ type mockProvider struct {
openError error
getMigrationDriverError error
individualSort bool
multiRowInsert bool
}

func newMockProvider() *mockProvider {
Expand All @@ -59,6 +60,7 @@ func newMockProvider() *mockProvider {
mp.SQLCommon.InitConfig(mp, mp.config)
mp.config.Set(SQLConfMaxConnections, 10)
mp.mockDB, mp.mdb, _ = sqlmock.New()
mp.multiRowInsert = false
return mp
}

Expand All @@ -84,6 +86,7 @@ func (mp *mockProvider) MigrationsDir() string {
func (psql *mockProvider) Features() dbsql.SQLFeatures {
features := dbsql.DefaultSQLProviderFeatures()
features.UseILIKE = true
features.MultiRowInsert = psql.multiRowInsert
features.AcquireLock = func(lockName string) string {
return fmt.Sprintf(`<acquire lock %s>`, lockName)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/database/sqlcommon/sqlcommon.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 Kaleido, Inc.
// Copyright © 2023 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -33,7 +33,6 @@ type SQLCommon struct {
dbsql.Database
capabilities *database.Capabilities
callbacks callbacks
features dbsql.SQLFeatures
}

type callbacks struct {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/multiparty/ethereum_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package multiparty
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"os/exec"
"testing"
Expand Down Expand Up @@ -316,7 +316,7 @@ func readContractJSON(t *testing.T, contract string) fftypes.JSONObject {
jsonFile, err := os.Open(path)
assert.NoError(t, err)
defer jsonFile.Close()
byteValue, err := ioutil.ReadAll(jsonFile)
byteValue, err := io.ReadAll(jsonFile)
assert.NoError(t, err)
var jsonValue fftypes.JSONObject
err = json.Unmarshal(byteValue, &jsonValue)
Expand Down