File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
test/e2e-go/features/transactions Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,15 @@ func (p *SingleLeafProof) ToProof() *Proof {
8484}
8585
8686// GetConcatenatedProof concats the verification path to a single slice
87- // This function converts an empty element (i.e has missing child )
88- // into a sequence of 0s [0...0]
87+ // This function converts an empty element in the path (i.e occurs when the tree is not a full tree )
88+ // into a sequence of digest result of zero.
8989func (p * SingleLeafProof ) GetConcatenatedProof () []byte {
9090 digestSize := p .HashFactory .NewHash ().Size ()
9191 proofconcat := make ([]byte , digestSize * int (p .TreeDepth ))
9292 for i := 0 ; i < int (p .TreeDepth ); i ++ {
93- copy (proofconcat [i * digestSize :(i + 1 )* digestSize ], p .Path [i ])
93+ if p .Path [i ] != nil {
94+ copy (proofconcat [i * digestSize :(i + 1 )* digestSize ], p .Path [i ])
95+ }
9496 }
9597 return proofconcat
9698}
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ func TestTxnMerkleProof(t *testing.T) {
5050 partitiontest .PartitionTest (t )
5151 defer fixtures .ShutdownSynchronizedTest (t )
5252
53+ t .Parallel ()
5354 a := require .New (fixtures .SynchronizedTest (t ))
5455
5556 var fixture fixtures.RestClientFixture
You can’t perform that action at this time.
0 commit comments