Skip to content

Commit

Permalink
Added additional test, refactored list of features
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Oct 15, 2020
1 parent 784a600 commit 1210454
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,10 @@ View the generated [documentation](https://pkg.go.dev/github.com/bitcoinschema/g
- **Addresses**
- [Address from PrivateKey (bsvec.PrivateKey)](address.go)
- [Address from Script](address.go)
- **Private Keys**
- [Create PrivateKey](private_key.go)
- [PrivateKey (string) to Address (string)](address.go)
- [PrivateKey from string](private_key.go)
- [Get Private and Public keys](private_key.go)
- [WIF to PrivateKey](private_key.go)
- [PrivateKey to WIF](private_key.go)
- **Encryption**
- [Encrypt With Private Key](encryption.go)
- [Decrypt With Private Key](encryption.go)
- **PubKeys**
- [Create PubKey from PrivateKey](pubkey.go)
- [PubKey from String](pubkey.go)
- **HD Keys**
- **HD Keys** _(Master / xPub)_
- [Generate HD Keys](hd_key.go)
- [Generate HD Key from string](hd_key.go)
- [Get HD Key by Path](hd_key.go)
Expand All @@ -65,16 +55,26 @@ View the generated [documentation](https://pkg.go.dev/github.com/bitcoinschema/g
- [Get Addresses from HD Key](hd_key.go)
- [Get PublicKeys for Path](hd_key.go)
- [Get Addresses for Path](hd_key.go)
- **PubKeys**
- [Create PubKey from PrivateKey](pubkey.go)
- [PubKey from String](pubkey.go)
- **Private Keys**
- [Create PrivateKey](private_key.go)
- [PrivateKey (string) to Address (string)](address.go)
- [PrivateKey from string](private_key.go)
- [Get Private and Public keys](private_key.go)
- [WIF to PrivateKey](private_key.go)
- [PrivateKey to WIF](private_key.go)
- **Scripts**
- [Script from Address](script.go)
- **Signatures**
- [Sign](sign.go) & [Verify a Bitcoin Message](verify.go)
- [Verify a DER Signature](verify.go)
- **Transactions**
- [Create Tx](transaction.go)
- [Create Tx with Change](transaction.go)
- [Tx from Hex](transaction.go)
- [Calculate Fee](transaction.go)
- **Scripts**
- [Script from Address](script.go)
- **Signatures**
- [Sign](sign.go) & [Verify](verify.go) a Bitcoin Message
- [Verify DER Signature](verify.go)


<details>
Expand Down
21 changes: 21 additions & 0 deletions transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,12 @@ func TestCalculateFeeForTxVariousTxs(t *testing.T) {
"8785ca5f11795a38eb1f50f62562cb5e0335b283762fe8a2c7e96d5f7f79bb15",
109,
},
{"0100000001760595866e99c1ce920197844740f5598b34763878696371d41b3a7c0a65b0b7000000006a47304402200083bb297d53210cf9379b3f47de2eff38e6906e5982fbfeef9bf59778750f3e022046da020811e9a2d1e6db8da103d17598abc194125612be6b108d49cb60cbca95412102ea87d1fd77d169bd56a71e700628113d0f8dfe57faa0ba0e55a36f9ce8e10be3ffffffff0000000000",
&FeeAmount{Bytes: 157, Satoshis: 1},
&FeeAmount{Bytes: 157, Satoshis: 1},
"d3350a4ef4b2c72b23e5117979590d768e61f2102337e2ae956d152a80cd37ac",
1,
},
}

// Run tests
Expand All @@ -429,6 +435,21 @@ func TestCalculateFeeForTxVariousTxs(t *testing.T) {
}
}

func TestA25_ComputeChecksum(t *testing.T) {
utxo := &Utxo{
TxID: "",
Vout: 0,
ScriptSig: "",
Satoshis: 1000,
}
tx, err := CreateTx([]*Utxo{utxo}, nil, nil, "L3VJH2hcRGYYG6YrbWGmsxQC1zyYixA82YjgEyrEUWDs4ALgk8Vu")
if err != nil {
t.Fatalf("error occurred: %s", err.Error())
}
t.Log(tx.ToString())

}

// ExampleCalculateFeeForTx example using CalculateFeeForTx()
func ExampleCalculateFeeForTx() {

Expand Down

0 comments on commit 1210454

Please sign in to comment.