Skip to content

Commit

Permalink
[FAB-14941] remove unused GenerateIDfromTxSHAHash
Browse files Browse the repository at this point in the history
Change-Id: Ia3f987cb1a5d622404f28728153526885d3bb85e
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
  • Loading branch information
sykesm committed Apr 3, 2019
1 parent f9eae53 commit 1afbf8f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions common/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ func CreateUtcTimestamp() *timestamp.Timestamp {
return &(timestamp.Timestamp{Seconds: secs, Nanos: nanos})
}

// GenerateIDfromTxSHAHash generates SHA256 hash using Tx payload
func GenerateIDfromTxSHAHash(payload []byte) string {
return fmt.Sprintf("%x", ComputeSHA256(payload))
}

func idBytesToStr(id []byte) string {
return fmt.Sprintf("%x-%x-%x-%x-%x", id[0:4], id[4:6], id[6:8], id[8:10], id[10:])
}
Expand Down
8 changes: 0 additions & 8 deletions common/util/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ func TestTimestamp(t *testing.T) {
}
}

func TestGeneratIDfromTxSHAHash(t *testing.T) {
txid := GenerateIDfromTxSHAHash([]byte("foobar"))
txid2 := GenerateIDfromTxSHAHash([]byte("foobar1"))
if txid == txid2 {
t.Fatalf("Two TxIDs are equal. This should never occur")
}
}

func TestFindMissingElements(t *testing.T) {
all := []string{"a", "b", "c", "d"}
some := []string{"b", "c"}
Expand Down

0 comments on commit 1afbf8f

Please sign in to comment.