Skip to content

Commit

Permalink
style: rename nodeCli to nodeClient - less confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Mar 26, 2019
1 parent 76a0ff6 commit 528eba0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions aeternity/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func getNextNonce(node *apiclient.Node, accountID string) (nextNonce uint64, err
}

// waitForTransaction to appear on the chain
func waitForTransaction(nodeCli *apiclient.Node, txHash string) (blockHeight uint64, blockHash string, err error) {
func waitForTransaction(nodeClient *apiclient.Node, txHash string) (blockHeight uint64, blockHash string, err error) {
// caclulate the date for the timeout
ctm := Config.Tuning.ChainTimeout
tm := time.Now().Add(time.Millisecond * time.Duration(ctm))
Expand All @@ -87,7 +87,7 @@ func waitForTransaction(nodeCli *apiclient.Node, txHash string) (blockHeight uin
err = fmt.Errorf("Timeout waiting for the transaction to appear")
break // timeout execed
}
tx, err := getTransactionByHash(nodeCli, txHash)
tx, err := getTransactionByHash(nodeClient, txHash)
if err != nil {
break
}
Expand All @@ -114,7 +114,7 @@ func SpendTxStr(sender, recipient string, amount, fee utils.BigInt, message stri
}

// BroadcastTransaction recalculates the transaction hash and sends the transaction to the node.
func BroadcastTransaction(nodeCli *apiclient.Node, txSignedBase64 string) (err error) {
func BroadcastTransaction(nodeClient *apiclient.Node, txSignedBase64 string) (err error) {
// Get back to RLP to calculate txhash
txRLP, _ := Decode(txSignedBase64)

Expand All @@ -124,7 +124,7 @@ func BroadcastTransaction(nodeCli *apiclient.Node, txSignedBase64 string) (err e
signedEncodedTxHash := Encode(PrefixTransactionHash, rlpTxHashRaw)

// send it to the network
err = postTransaction(nodeCli, txSignedBase64, signedEncodedTxHash)
err = postTransaction(nodeClient, txSignedBase64, signedEncodedTxHash)
return
}

Expand Down Expand Up @@ -167,7 +167,7 @@ func (n *Aens) NameClaimTxStr(name string, nameSalt, ttl, nonce uint64) (tx stri
// NameUpdateTxStr perform a name update
func (n *Aens) NameUpdateTxStr(name string, targetAddress string, ttl, nonce uint64) (tx string, err error) {
encodedNameHash := Encode(PrefixName, namehash(name))
absNameTTL, err := getTTL(n.nodeCli, Config.Client.Names.NameTTL)
absNameTTL, err := getTTL(n.nodeClient, Config.Client.Names.NameTTL)
if err != nil {
return "", err
}
Expand Down
18 changes: 9 additions & 9 deletions aeternity/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,32 @@ type Ae struct {

// Wallet high level abstraction for operation on a wallet
type Wallet struct {
nodeCli *apiclient.Node
nodeClient *apiclient.Node
owner *Account
}

// Aens abstractions for aens operations
type Aens struct {
nodeCli *apiclient.Node
nodeClient *apiclient.Node
owner *Account
name string
preClaimSalt []byte
}

// Contract abstractions for contracts
type Contract struct {
nodeCli *apiclient.Node
nodeClient *apiclient.Node
owner *Account
source string
}

// Oracle abstractions for oracles
type Oracle struct {
nodeCli *apiclient.Node
nodeClient *apiclient.Node
owner *Account
}

// NewCli obtain a new nodeCli instance
// NewCli obtain a new nodeClient instance
func NewCli(nodeURL string, debug bool) *Ae {
// create the transport
host, schemas := urlComponents(nodeURL)
Expand All @@ -53,16 +53,16 @@ func NewCli(nodeURL string, debug bool) *Ae {
aecli := &Ae{
Node: openAPIClient,
Wallet: &Wallet{
nodeCli: openAPIClient,
nodeClient: openAPIClient,
},
Aens: &Aens{
nodeCli: openAPIClient,
nodeClient: openAPIClient,
},
Contract: &Contract{
nodeCli: openAPIClient,
nodeClient: openAPIClient,
},
Oracle: &Oracle{
nodeCli: openAPIClient,
nodeClient: openAPIClient,
},
}
return aecli
Expand Down

0 comments on commit 528eba0

Please sign in to comment.