Skip to content

Commit 009edd5

Browse files
committed
Documenting objects
1 parent b2993fe commit 009edd5

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

api/api/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ var mutationType = graphql.NewObject(
166166
},
167167
)
168168

169+
//Start start the API
169170
func Start() error {
170171
http.HandleFunc("/bftx-api", httpHandler(&schema))
171172
fmt.Println("Now server is running on: http://localhost:12345")

api/handlers/transactionHandler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
abciTypes "github.com/tendermint/abci/types"
2727
)
2828

29+
//TendermintClient object to call function from tendermint
2930
var TendermintClient abcicli.Client
3031

3132
// ConstructBfTx function to create a BFTX via API

config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ import (
5353
"github.com/blockfreight/go-bftx/lib/pkg/common" // Implements common functions for Blockfreight™
5454
)
5555

56+
//Config objetc to isolate all the app config in a single object
5657
type Config struct {
5758
BFTX_API_ADDRESS string `json:"bftx-api-address"`
5859
}
5960

61+
//LoadConfiguration loads the app config into an object
6062
func LoadConfiguration() (Config, error) {
6163
var config Config
6264
configFile, err := common.ReadJSON("./config.json")

lib/app/bft/bft.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ func (app *BftApplication) Commit() types.ResponseCommit {
143143
return types.ResponseCommit{Code: code.CodeTypeOK, Data: hash}
144144
}
145145

146+
//Query retrieves a transaction from the network
146147
func (app *BftApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) {
147148
if reqQuery.Prove {
148149
value, proof, err := app.state.GetWithProof(reqQuery.Data)

0 commit comments

Comments
 (0)