From 313427b3546ade7854c00d010c368b73499cdb21 Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Fri, 18 Dec 2020 12:45:59 -0500 Subject: [PATCH] Removed comment (not needed) --- address_test.go | 10 ---------- encryption_test.go | 8 -------- hd_key_test.go | 30 ------------------------------ private_key_test.go | 12 ------------ pubkey_test.go | 6 ------ script_test.go | 2 -- sign_test.go | 2 -- verify_test.go | 2 -- 8 files changed, 72 deletions(-) diff --git a/address_test.go b/address_test.go index 2649cf8..7ca4d9a 100644 --- a/address_test.go +++ b/address_test.go @@ -13,7 +13,6 @@ func TestValidA58(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedValid bool @@ -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()) @@ -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 @@ -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()) @@ -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 @@ -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()) @@ -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 @@ -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()) @@ -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 @@ -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()) diff --git a/encryption_test.go b/encryption_test.go index 396074b..a2924c8 100644 --- a/encryption_test.go +++ b/encryption_test.go @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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()) diff --git a/hd_key_test.go b/hd_key_test.go index 2f24270..e58ea97 100644 --- a/hd_key_test.go +++ b/hd_key_test.go @@ -16,7 +16,6 @@ func TestGenerateHDKey(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputSeed uint8 expectedNil bool @@ -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()) @@ -76,7 +74,6 @@ func TestGenerateHDKeyPair(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputSeed uint8 expectedError bool @@ -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()) @@ -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 @@ -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 { @@ -249,7 +243,6 @@ func TestGetHDKeyByPath(t *testing.T) { } */ - // Create the list of tests var tests = []struct { inputHDKey *hdkeychain.ExtendedKey inputChain uint32 @@ -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()) @@ -360,7 +352,6 @@ func TestGetHDKeyChild(t *testing.T) { } */ - // Create the list of tests var tests = []struct { inputHDKey *hdkeychain.ExtendedKey inputNum uint32 @@ -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()) @@ -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 @@ -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()) @@ -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 @@ -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()) @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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 { @@ -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 @@ -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()) diff --git a/private_key_test.go b/private_key_test.go index f85e10a..d612422 100644 --- a/private_key_test.go +++ b/private_key_test.go @@ -65,7 +65,6 @@ func BenchmarkCreatePrivateKeyString(b *testing.B) { func TestPrivateKeyFromString(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedKey string @@ -81,7 +80,6 @@ func TestPrivateKeyFromString(t *testing.T) { {"", "", true, true}, } - // Run tests for _, test := range tests { if rawKey, err := PrivateKeyFromString(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()) @@ -121,7 +119,6 @@ func TestPrivateAndPublicKeys(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedPrivateKey string @@ -136,7 +133,6 @@ func TestPrivateAndPublicKeys(t *testing.T) { {"54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", false, false}, } - // Run tests for _, test := range tests { if privateKey, publicKey, err := PrivateAndPublicKeys(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()) @@ -177,7 +173,6 @@ func TestPrivateKeyToWif(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedWif string @@ -192,7 +187,6 @@ func TestPrivateKeyToWif(t *testing.T) { {"54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", "5JTHas7yTFMBLqgFogxZFf8Vc5uKEbkE7yQAQ2g3xPHo2sNG1Ei", false, false}, } - // Run tests for _, test := range tests { if wif, err := PrivateKeyToWif(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()) @@ -234,7 +228,6 @@ func TestPrivateKeyToWifString(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedWif string @@ -248,7 +241,6 @@ func TestPrivateKeyToWifString(t *testing.T) { {"54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", "5JTHas7yTFMBLqgFogxZFf8Vc5uKEbkE7yQAQ2g3xPHo2sNG1Ei", false}, } - // Run tests for _, test := range tests { if wif, err := PrivateKeyToWifString(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()) @@ -285,7 +277,6 @@ func BenchmarkPrivateKeyToWifString(b *testing.B) { func TestWifToPrivateKey(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedKey string @@ -300,7 +291,6 @@ func TestWifToPrivateKey(t *testing.T) { {"5JTHas7yTFMBLqgFogxZFf8Vc5uKEbkE7yQAQ2g3xPHo2sNG1Ei", "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", false, false}, } - // Run tests for _, test := range tests { if privateKey, err := WifToPrivateKey(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()) @@ -339,7 +329,6 @@ func BenchmarkWifToPrivateKey(b *testing.B) { func TestWifToPrivateKeyString(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { input string expectedKey string @@ -353,7 +342,6 @@ func TestWifToPrivateKeyString(t *testing.T) { {"5JTHas7yTFMBLqgFogxZFf8Vc5uKEbkE7yQAQ2g3xPHo2sNG1Ei", "54035dd4c7dda99ac473905a3d82f7864322b49bab1ff441cc457183b9bd8abd", false}, } - // Run tests for _, test := range tests { if privateKey, err := WifToPrivateKeyString(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()) diff --git a/pubkey_test.go b/pubkey_test.go index db2eb18..a5598b1 100644 --- a/pubkey_test.go +++ b/pubkey_test.go @@ -13,7 +13,6 @@ import ( func TestPubKeyFromPrivateKeyString(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputKey string expectedPubKey string @@ -24,7 +23,6 @@ func TestPubKeyFromPrivateKeyString(t *testing.T) { {"", "", true}, } - // Run tests for _, test := range tests { if pubKey, err := PubKeyFromPrivateKeyString(test.inputKey, true); err != nil && !test.expectedError { t.Fatalf("%s Failed: [%s] inputted and error not expected but got: %s", t.Name(), test.inputKey, err.Error()) @@ -63,7 +61,6 @@ func TestPubKeyFromPrivateKey(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, priv) - // Create the list of tests var tests = []struct { inputKey *bsvec.PrivateKey expectedPubKey string @@ -72,7 +69,6 @@ func TestPubKeyFromPrivateKey(t *testing.T) { {priv, "031b8c93100d35bd448f4646cc4678f278351b439b52b303ea31ec9edb5475e73f", false}, } - // Run tests for _, test := range tests { if pubKey := PubKeyFromPrivateKey(test.inputKey, true); pubKey != test.expectedPubKey { t.Fatalf("%s Failed: [%v] inputted and [%s] expected, but got: %s", t.Name(), test.inputKey, test.expectedPubKey, pubKey) @@ -116,7 +112,6 @@ func TestPubKeyFromString(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputKey string expectedPubKey string @@ -129,7 +124,6 @@ func TestPubKeyFromString(t *testing.T) { {"031b8c93100d35bd448f4646cc4678f278351b439b52b303ea31ec9edb5475e73f", "031b8c93100d35bd448f4646cc4678f278351b439b52b303ea31ec9edb5475e73f", false, false}, } - // Run tests for _, test := range tests { if pubKey, err := PubKeyFromString(test.inputKey); err != nil && !test.expectedError { t.Fatalf("%s Failed: [%s] inputted and error not expected but got: %s", t.Name(), test.inputKey, err.Error()) diff --git a/script_test.go b/script_test.go index f58c714..6381738 100644 --- a/script_test.go +++ b/script_test.go @@ -9,7 +9,6 @@ import ( func TestScriptFromAddress(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputAddress string expectedScript string @@ -22,7 +21,6 @@ func TestScriptFromAddress(t *testing.T) { {"13Rj7G3pn2GgG8KE6SFXLc7dCJdLNnNK7M", "76a9141a9d62736746f85ca872dc555ff51b1fed2471e288ac", false}, } - // Run tests for _, test := range tests { if script, err := ScriptFromAddress(test.inputAddress); err != nil && !test.expectedError { t.Fatalf("%s Failed: [%v] inputted and error not expected but got: %s", t.Name(), test.inputAddress, err.Error()) diff --git a/sign_test.go b/sign_test.go index a2d34c8..c78de57 100644 --- a/sign_test.go +++ b/sign_test.go @@ -47,7 +47,6 @@ func TestSignMessage(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputKey string inputMessage string @@ -122,7 +121,6 @@ func TestSignMessage(t *testing.T) { }, } - // Run tests for idx, test := range tests { if signature, err := SignMessage(test.inputKey, test.inputMessage, false); err != nil && !test.expectedError { t.Fatalf("%d %s Failed: [%s] [%s] inputted and error not expected but got: %s", idx, t.Name(), test.inputKey, test.inputMessage, err.Error()) diff --git a/verify_test.go b/verify_test.go index 3f4ffb9..cb9e28d 100644 --- a/verify_test.go +++ b/verify_test.go @@ -18,7 +18,6 @@ func TestVerifyMessage(t *testing.T) { t.Parallel() - // Create the list of tests var tests = []struct { inputAddress string inputSignature string @@ -90,7 +89,6 @@ func TestVerifyMessage(t *testing.T) { }, } - // Run tests for _, test := range tests { if err := VerifyMessage(test.inputAddress, test.inputSignature, test.inputData); err != nil && !test.expectedError { t.Fatalf("%s Failed: [%s] [%s] [%s] inputted and error not expected but got: %s", t.Name(), test.inputAddress, test.inputSignature, test.inputData, err.Error())