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

Claim reference #142

Merged
merged 2 commits into from
Feb 22, 2020
Merged
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
5 changes: 5 additions & 0 deletions migration/021_claim_reference.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- +migrate Up

-- +migrate StatementBegin
ALTER TABLE claim CHANGE COLUMN claim_reference claim_reference CHAR(40) CHARACTER SET 'latin1' COLLATE 'latin1_general_ci' NULL DEFAULT NULL ;
-- +migrate StatementEnd
19 changes: 19 additions & 0 deletions util/utility_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package util

import (
"encoding/hex"
"testing"
)

func TestReverseBytes(t *testing.T) {
originalHex := "ad779413d8710f52a5c1d79af7e10a329147576f"
bytes, err := hex.DecodeString(originalHex)
if err != nil {
t.Error(err)
}
reversed := ReverseBytes(bytes)
reversedHex := hex.EncodeToString(reversed)
if reversedHex != "6f574791320ae1f79ad7c1a5520f71d8139477ad" {
t.Error("it doesnt match")
}
}