Skip to content

Commit

Permalink
Removed comment (not needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Dec 18, 2020
1 parent 67e9de7 commit 313427b
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 72 deletions.
10 changes: 0 additions & 10 deletions address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ func TestValidA58(t *testing.T) {

t.Parallel()

// Create the list of tests
var tests = []struct {
input string
expectedValid bool
Expand All @@ -31,7 +30,6 @@ func TestValidA58(t *testing.T) {
{"0", false, true},
}

// Run tests
for _, test := range tests {
if valid, err := ValidA58([]byte(test.input)); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%s] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down Expand Up @@ -71,7 +69,6 @@ func BenchmarkValidA58(b *testing.B) {
func TestGetAddressFromPrivateKey(t *testing.T) {
t.Parallel()

// Create the list of tests
var tests = []struct {
input string
expectedAddress string
Expand All @@ -86,7 +83,6 @@ func TestGetAddressFromPrivateKey(t *testing.T) {
{"54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", "1DfGxKmgL3ETwUdNnXLBueEvNpjcDGcKgK", true, false},
}

// Run tests
for _, test := range tests {
if address, err := GetAddressFromPrivateKeyString(test.input, test.compressed); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%s] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down Expand Up @@ -147,7 +143,6 @@ func testGetPublicKeyFromPrivateKey(privateKey string) *bsvec.PublicKey {
func TestGetAddressFromPubKey(t *testing.T) {
t.Parallel()

// Create the list of tests
var tests = []struct {
input *bsvec.PublicKey
expectedAddress string
Expand All @@ -162,7 +157,6 @@ func TestGetAddressFromPubKey(t *testing.T) {

// todo: add more error cases of invalid *bsvec.PublicKey

// Run tests
for _, test := range tests {
if rawKey, err := GetAddressFromPubKey(test.input, true); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%v] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down Expand Up @@ -201,7 +195,6 @@ func BenchmarkGetAddressFromPubKey(b *testing.B) {
func TestGetAddressFromScript(t *testing.T) {
t.Parallel()

// Create the list of tests
var tests = []struct {
inputScript string
expectedAddress string
Expand All @@ -220,7 +213,6 @@ func TestGetAddressFromScript(t *testing.T) {
{"47304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901", "", true},
}

// Run tests
for _, test := range tests {
if address, err := GetAddressFromScript(test.inputScript); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%v] inputted and error not expected but got: %s", t.Name(), test.inputScript, err.Error())
Expand Down Expand Up @@ -254,7 +246,6 @@ func BenchmarkGetAddressFromScript(b *testing.B) {
func TestGetAddressFromPubKeyString(t *testing.T) {
t.Parallel()

// Create the list of tests
var tests = []struct {
input string
expectedAddress string
Expand All @@ -267,7 +258,6 @@ func TestGetAddressFromPubKeyString(t *testing.T) {
{"0000", "", true, true},
}

// Run tests
for _, test := range tests {
if rawKey, err := GetAddressFromPubKeyString(test.input, true); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%v] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down
8 changes: 0 additions & 8 deletions encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func TestEncryptWithPrivateKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, privateKey)

// Create the list of tests
var tests = []struct {
inputKey *bsvec.PrivateKey
inputData string
Expand All @@ -36,7 +35,6 @@ func TestEncryptWithPrivateKey(t *testing.T) {
{privateKey, `PLXfZ8ZNN9emRVLapZlvsDpjti3TazobtrY1LWibG5ogf07R5u6xwTGSsBGH10E5naTJLOhj38dFFDeG7giLIvK9QbiF8xSqbXoxvILl09AeXSFfOx7154KdOQdoXMxsghUFi91Efh4uWNl53d7feec7NXh7WrRk68sYUQrfGNdvgxyJlYXBpp7pq5f9Yhhm2TxbNyTyh4dkgvXVJtVfFLwiOWYfO9PAwmfDAgoFyP1vpNcL7G2lCsDW2LuaO1PO0L8a0Z55jpqYrYwzUG3IK4HKnx61xWvawFSzapzGLMrrdxVK56WuToZPOVlLpXjGKYNXlfBXh6T4d1uYUQg9aKfrdIZWCXjVnCXrqDa8vrF0djypIPq24zE0KM0oQZfQJT2Vptu1OPJkes2nIpAUTKxtiLIiunbk8EXaRFBAgGYFFHYm3tHLQUaFQ0K6USoTN3Nr92SjgKUcXVJtSeH854fFpSAoi8je74XPLFHU54GJ0LB3ixHFmD1YQFbBJux7738gI05pxZTwl69KXoat8OfFamLhwNxg8BcA8GXpkN6i5UZW8VfvOQ11nfpd5RykehgYeFyZaewUizPTZkVfI8BT5fdBGQAGXfNT8Xo0OiRxb64rB3Q3YcKiwXjpD1gc14vZXb5EzP6y274yh9RODHPi3rZuVYeGDBd1woFHng2cFeu1ZZ1kBpB30jqqoxDvYzHWvUEpeP3mRyyL51pqYECgOoTEB9nZlb8J31sbAAyY5EXGp6mPuxnhYfR03wIPdkVaDgY9IUdBfKxiIfghTw9Zk9NYZWz1THnqe1GfnBqtHTWiHHuBt0vEJ5QNiMyvcsZbLb6djbbtVFV5sEMzRWf8cJInSEQFgcXPRFaZYow2bJiugFTGvt0ZZKscHqn2SJFNKGRgr3zlcTgF3Y33PVJVTg1uOaZw6y6mbVituSAR5LuDN0zlFuvkOvr63Hys3fE4dONIOxphiDyNG0Nvci5I3bB3E1H1gT8vUDCq`, false},
}

// Run tests
var encrypted string
for _, test := range tests {
if encrypted, err = EncryptWithPrivateKey(test.inputKey, test.inputData); err != nil && !test.expectedError {
Expand Down Expand Up @@ -101,7 +99,6 @@ func TestEncryptWithPrivateKeyString(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, privateKey)

// Create the list of tests
var tests = []struct {
inputKey string
inputData string
Expand All @@ -118,7 +115,6 @@ func TestEncryptWithPrivateKeyString(t *testing.T) {
{privateKey, `PLXfZ8ZNN9emRVLapZlvsDpjti3TazobtrY1LWibG5ogf07R5u6xwTGSsBGH10E5naTJLOhj38dFFDeG7giLIvK9QbiF8xSqbXoxvILl09AeXSFfOx7154KdOQdoXMxsghUFi91Efh4uWNl53d7feec7NXh7WrRk68sYUQrfGNdvgxyJlYXBpp7pq5f9Yhhm2TxbNyTyh4dkgvXVJtVfFLwiOWYfO9PAwmfDAgoFyP1vpNcL7G2lCsDW2LuaO1PO0L8a0Z55jpqYrYwzUG3IK4HKnx61xWvawFSzapzGLMrrdxVK56WuToZPOVlLpXjGKYNXlfBXh6T4d1uYUQg9aKfrdIZWCXjVnCXrqDa8vrF0djypIPq24zE0KM0oQZfQJT2Vptu1OPJkes2nIpAUTKxtiLIiunbk8EXaRFBAgGYFFHYm3tHLQUaFQ0K6USoTN3Nr92SjgKUcXVJtSeH854fFpSAoi8je74XPLFHU54GJ0LB3ixHFmD1YQFbBJux7738gI05pxZTwl69KXoat8OfFamLhwNxg8BcA8GXpkN6i5UZW8VfvOQ11nfpd5RykehgYeFyZaewUizPTZkVfI8BT5fdBGQAGXfNT8Xo0OiRxb64rB3Q3YcKiwXjpD1gc14vZXb5EzP6y274yh9RODHPi3rZuVYeGDBd1woFHng2cFeu1ZZ1kBpB30jqqoxDvYzHWvUEpeP3mRyyL51pqYECgOoTEB9nZlb8J31sbAAyY5EXGp6mPuxnhYfR03wIPdkVaDgY9IUdBfKxiIfghTw9Zk9NYZWz1THnqe1GfnBqtHTWiHHuBt0vEJ5QNiMyvcsZbLb6djbbtVFV5sEMzRWf8cJInSEQFgcXPRFaZYow2bJiugFTGvt0ZZKscHqn2SJFNKGRgr3zlcTgF3Y33PVJVTg1uOaZw6y6mbVituSAR5LuDN0zlFuvkOvr63Hys3fE4dONIOxphiDyNG0Nvci5I3bB3E1H1gT8vUDCq`, false},
}

// Run tests
var encrypted string
for _, test := range tests {
if encrypted, err = EncryptWithPrivateKeyString(test.inputKey, test.inputData); err != nil && !test.expectedError {
Expand Down Expand Up @@ -173,7 +169,6 @@ func TestDecryptWithPrivateKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, privateKey)

// Create the list of tests
var tests = []struct {
inputKey *bsvec.PrivateKey
inputEncrypted string
Expand Down Expand Up @@ -237,7 +232,6 @@ func TestDecryptWithPrivateKey(t *testing.T) {
},
}

// Run tests
var decrypted string
for _, test := range tests {
if decrypted, err = DecryptWithPrivateKey(test.inputKey, test.inputEncrypted); err != nil && !test.expectedError {
Expand Down Expand Up @@ -290,7 +284,6 @@ func TestDecryptWithPrivateKeyString(t *testing.T) {
// Create a valid private key
privateKey := "bb66a48a9f6dd7b8fb469a6f08a75c25770591dc509c72129b2aaeca77a5269e"

// Create the list of tests
var tests = []struct {
inputKey string
inputEncrypted string
Expand Down Expand Up @@ -364,7 +357,6 @@ func TestDecryptWithPrivateKeyString(t *testing.T) {
},
}

// Run tests
for _, test := range tests {
if decrypted, err := DecryptWithPrivateKeyString(test.inputKey, test.inputEncrypted); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%s] [%s] inputted and error not expected but got: %s", t.Name(), test.inputKey, test.inputEncrypted, err.Error())
Expand Down
30 changes: 0 additions & 30 deletions hd_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func TestGenerateHDKey(t *testing.T) {

t.Parallel()

// Create the list of tests
var tests = []struct {
inputSeed uint8
expectedNil bool
Expand All @@ -30,7 +29,6 @@ func TestGenerateHDKey(t *testing.T) {
{SecureSeedLength, false, false},
}

// Run tests
for _, test := range tests {
if hdKey, err := GenerateHDKey(test.inputSeed); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%d] inputted and error not expected but got: %s", t.Name(), test.inputSeed, err.Error())
Expand Down Expand Up @@ -76,7 +74,6 @@ func TestGenerateHDKeyPair(t *testing.T) {

t.Parallel()

// Create the list of tests
var tests = []struct {
inputSeed uint8
expectedError bool
Expand All @@ -89,7 +86,6 @@ func TestGenerateHDKeyPair(t *testing.T) {
{SecureSeedLength, false},
}

// Run tests
for _, test := range tests {
if privateKey, publicKey, err := GenerateHDKeyPair(test.inputSeed); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%d] inputted and error not expected but got: %s", t.Name(), test.inputSeed, err.Error())
Expand Down Expand Up @@ -142,7 +138,6 @@ func TestGetPrivateKeyByPath(t *testing.T) {
t.Fatalf("error occurred: %s", err.Error())
}

// Create the list of tests
var tests = []struct {
inputHDKey *hdkeychain.ExtendedKey
inputChain uint32
Expand All @@ -164,7 +159,6 @@ func TestGetPrivateKeyByPath(t *testing.T) {
{validKey, 1<<32 - 1, 1<<32 - 1, false, false},
}

// Run tests
var privateKey *bsvec.PrivateKey
for _, test := range tests {
if privateKey, err = GetPrivateKeyByPath(test.inputHDKey, test.inputChain, test.inputNum); err != nil && !test.expectedError {
Expand Down Expand Up @@ -249,7 +243,6 @@ func TestGetHDKeyByPath(t *testing.T) {
}
*/

// Create the list of tests
var tests = []struct {
inputHDKey *hdkeychain.ExtendedKey
inputChain uint32
Expand All @@ -270,7 +263,6 @@ func TestGetHDKeyByPath(t *testing.T) {
{validKey, 1<<32 - 1, 1<<32 - 1, false, false},
}

// Run tests
for _, test := range tests {
if hdKey, err := GetHDKeyByPath(test.inputHDKey, test.inputChain, test.inputNum); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%v] [%d] [%d] inputted and error not expected but got: %s", t.Name(), test.inputHDKey, test.inputChain, test.inputNum, err.Error())
Expand Down Expand Up @@ -360,7 +352,6 @@ func TestGetHDKeyChild(t *testing.T) {
}
*/

// Create the list of tests
var tests = []struct {
inputHDKey *hdkeychain.ExtendedKey
inputNum uint32
Expand All @@ -381,7 +372,6 @@ func TestGetHDKeyChild(t *testing.T) {
{validKey, 1<<32 - 1, false, false},
}

// Run tests
for _, test := range tests {
if hdKey, err := GetHDKeyChild(test.inputHDKey, test.inputNum); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%v] [%d] inputted and error not expected but got: %s", t.Name(), test.inputHDKey, test.inputNum, err.Error())
Expand Down Expand Up @@ -439,7 +429,6 @@ func BenchmarkGetHDKeyChild(b *testing.B) {
func TestGenerateHDKeyFromString(t *testing.T) {
t.Parallel()

// Create the list of tests
var tests = []struct {
input string
expectedNil bool
Expand All @@ -453,7 +442,6 @@ func TestGenerateHDKeyFromString(t *testing.T) {
{"xprv9s21ZrQH143K3XJueaaswvbJ38UX3FhnXkcA7xF8kqeN62qEu116M1XnqaDpSE7SoKp8NxejVJG9dfpuvBC314VZNdB7W1kQN3Viwgkjr8L", false, false},
}

// Run tests
for _, test := range tests {
if hdKey, err := GenerateHDKeyFromString(test.input); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%s] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down Expand Up @@ -498,7 +486,6 @@ func TestGetPrivateKeyFromHDKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
expectedKey string
Expand All @@ -509,7 +496,6 @@ func TestGetPrivateKeyFromHDKey(t *testing.T) {
{validHdKey, "8511f5e1e35ab748e7639aa68666df71857866af13fda1d081d5917948a6cd34", false, false},
}

// Run tests
for _, test := range tests {
if privateKey, err := GetPrivateKeyFromHDKey(test.input); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%v] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down Expand Up @@ -570,7 +556,6 @@ func TestGetPrivateKeyStringFromHDKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
expectedKey string
Expand All @@ -580,7 +565,6 @@ func TestGetPrivateKeyStringFromHDKey(t *testing.T) {
{validHdKey, "8511f5e1e35ab748e7639aa68666df71857866af13fda1d081d5917948a6cd34", false},
}

// Run tests
var privateKey string
for _, test := range tests {
if privateKey, err = GetPrivateKeyStringFromHDKey(test.input); err != nil && !test.expectedError {
Expand Down Expand Up @@ -638,7 +622,6 @@ func TestGetPublicKeyFromHDKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
expectedKey string
Expand All @@ -649,7 +632,6 @@ func TestGetPublicKeyFromHDKey(t *testing.T) {
{validHdKey, "02f2a2942b9d1dba033d36ab0c193e680415f5c8c1ff5d854f805c8c42ed9dd1fd", false, false},
}

// Run tests
var publicKey *bsvec.PublicKey
for _, test := range tests {
if publicKey, err = GetPublicKeyFromHDKey(test.input); err != nil && !test.expectedError {
Expand Down Expand Up @@ -711,7 +693,6 @@ func TestGetAddressFromHDKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
expectedAddress string
Expand All @@ -722,7 +703,6 @@ func TestGetAddressFromHDKey(t *testing.T) {
{validHdKey, "13xHrMdZuqa2gpweHf37w8hu6tfv3JrnaW", false, false},
}

// Run tests
var address *bsvutil.LegacyAddressPubKeyHash
for _, test := range tests {
if address, err = GetAddressFromHDKey(test.input); err != nil && !test.expectedError {
Expand Down Expand Up @@ -784,7 +764,6 @@ func TestGetAddressStringFromHDKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
expectedAddress string
Expand All @@ -794,7 +773,6 @@ func TestGetAddressStringFromHDKey(t *testing.T) {
{validHdKey, "13xHrMdZuqa2gpweHf37w8hu6tfv3JrnaW", false},
}

// Run tests
var address string
for _, test := range tests {
if address, err = GetAddressStringFromHDKey(test.input); err != nil && !test.expectedError {
Expand Down Expand Up @@ -852,7 +830,6 @@ func TestGetPublicKeysForPath(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
inputNum uint32
Expand All @@ -868,7 +845,6 @@ func TestGetPublicKeysForPath(t *testing.T) {
{validHdKey, 4, "0366dcdebfc8abfd34bffc181ccb54f1706839a80ad4f0842ae5a43f39fdd35c1e", "03a095db29ae9ee0b22c775118b4444b59db40acdea137fd9ecd9c68dacf50a644", false, false},
}

// Run tests
var pubKeys []*bsvec.PublicKey
for _, test := range tests {
if pubKeys, err = GetPublicKeysForPath(test.input, test.inputNum); err != nil && !test.expectedError {
Expand Down Expand Up @@ -933,7 +909,6 @@ func TestGetAddressesForPath(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
inputNum uint32
Expand All @@ -947,7 +922,6 @@ func TestGetAddressesForPath(t *testing.T) {
{validHdKey, 2, "18s3peTU7fMSwgui54avpnqm1126pRVccw", "1KgZZ3NsJDw3v1GPHBj8ASnxutA1kFxo2i", false, false},
}

// Run tests
var addresses []string
for _, test := range tests {
if addresses, err = GetAddressesForPath(test.input, test.inputNum); err != nil && !test.expectedError {
Expand Down Expand Up @@ -1010,7 +984,6 @@ func TestGetExtendedPublicKey(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, validHdKey)

// Create the list of tests
var tests = []struct {
input *hdkeychain.ExtendedKey
expectedKey string
Expand All @@ -1020,7 +993,6 @@ func TestGetExtendedPublicKey(t *testing.T) {
{new(hdkeychain.ExtendedKey), "zeroed extended key", false},
}

// Run tests
var xPub string
for _, test := range tests {
if xPub, err = GetExtendedPublicKey(test.input); err != nil && !test.expectedError {
Expand Down Expand Up @@ -1073,7 +1045,6 @@ func BenchmarkGetExtendedPublicKey(b *testing.B) {
func TestGetHDKeyFromExtendedPublicKey(t *testing.T) {
t.Parallel()

// Create the list of tests
var tests = []struct {
input string
expectedKey string
Expand Down Expand Up @@ -1106,7 +1077,6 @@ func TestGetHDKeyFromExtendedPublicKey(t *testing.T) {
},
}

// Run tests
for _, test := range tests {
if xPub, err := GetHDKeyFromExtendedPublicKey(test.input); err != nil && !test.expectedError {
t.Fatalf("%s Failed: [%s] inputted and error not expected but got: %s", t.Name(), test.input, err.Error())
Expand Down
Loading

0 comments on commit 313427b

Please sign in to comment.