Skip to content

Commit 4d5b760

Browse files
committed
[FAB-2580] Fix return of unexported type
https://jira.hyperledger.org/browse/FAB-2580 `NewTestChain` --an exported function-- would return `ramLedger`, an unexported type. This changeset fixes that by changing the function to its unexported equivalent. This changeset message is longer than the fix it introduces. Change-Id: I306fe9efc1152cccd8ba4d588439297c750dbf79 Signed-off-by: Kostas Christidis <[email protected]>
1 parent d611b10 commit 4d5b760

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

orderer/ledger/ram/impl_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func init() {
3131
logging.SetLevel(logging.DEBUG, "")
3232
}
3333

34-
func NewTestChain(maxSize int) *ramLedger {
34+
func newTestChain(maxSize int) *ramLedger {
3535
rlf := New(maxSize)
3636
chain, err := rlf.GetOrCreate(provisional.TestChainID)
3737
if err != nil {
@@ -45,7 +45,7 @@ func NewTestChain(maxSize int) *ramLedger {
4545
// Note that 'only' is applicable because the genesis block will be discarded
4646
func TestAppend(t *testing.T) {
4747
maxSize := 3
48-
rl := NewTestChain(maxSize)
48+
rl := newTestChain(maxSize)
4949
var blocks []*cb.Block
5050
for i := 0; i < 3; i++ {
5151
blocks = append(blocks, &cb.Block{Header: &cb.BlockHeader{Number: uint64(i + 1)}})
@@ -70,7 +70,7 @@ func TestAppend(t *testing.T) {
7070
// TestSignal checks if the signal channel closes when an item is appended
7171
func TestSignal(t *testing.T) {
7272
maxSize := 3
73-
rl := NewTestChain(maxSize)
73+
rl := newTestChain(maxSize)
7474
item := rl.newest
7575
select {
7676
case <-item.signal:
@@ -91,7 +91,7 @@ func TestSignal(t *testing.T) {
9191
func TestTruncationSafety(t *testing.T) {
9292
maxSize := 3
9393
newBlocks := 10
94-
rl := NewTestChain(maxSize)
94+
rl := newTestChain(maxSize)
9595
item := rl.newest
9696
for i := 0; i < newBlocks; i++ {
9797
rl.appendBlock(&cb.Block{Header: &cb.BlockHeader{Number: uint64(i + 1)}})

0 commit comments

Comments
 (0)