Skip to content

Commit

Permalink
unit-test fix
Browse files Browse the repository at this point in the history
Signed-off-by: Angelo De Caro <[email protected]>
  • Loading branch information
adecaro committed Nov 28, 2024
1 parent 6459633 commit 2f66da8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion platform/common/core/generic/vault/interceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func TestConcurrency(t *testing.T) {
qe := mocks.MockQE{}
qe := mocks.NewMockQE()
idsr := mocks.MockTXIDStoreReader{}

i := newInterceptor(flogging.MustGetLogger("interceptor_test"), qe, idsr, "1")
Expand Down
12 changes: 12 additions & 0 deletions platform/common/core/generic/vault/mocks/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ type MockQE struct {
Metadata map[string][]byte
}

func NewMockQE() MockQE {
return MockQE{
State: driver.VersionedValue{
Raw: []byte("raw"),
Version: blockTxIndexToBytes(1, 1),
},
Metadata: map[string][]byte{
"md": []byte("meta"),
},
}
}

func (qe MockQE) GetStateMetadata(driver.Namespace, driver.PKey) (driver.Metadata, driver.RawVersion, error) {
return qe.Metadata, blockTxIndexToBytes(1, 1), nil
}
Expand Down

0 comments on commit 2f66da8

Please sign in to comment.