Skip to content

Commit

Permalink
docs: comments for Context{}
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Jan 21, 2020
1 parent f20236e commit f0a24e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aeternity/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,35 @@ func NewContext(signingAccount *account.Account, node transactionSender) (b *Con
}, nil
}

// SenderAccount returns the address of the signing account, which should also
// be the sender address (for many transaction types)
func (c *Context) SenderAccount() string {
return c.SigningAccount.Address
}

// TTLNoncer returns the TTLNoncer of Context.SigningAccount
func (c *Context) TTLNoncer() transactions.TTLNoncer {
return c.ttlNoncer
}

// Compiler returns the compiler interface
func (c *Context) Compiler() compileencoder {
return c.compiler
}

// NodeInfo returns the networkID and version of the currently connected node,
// needed for contract Tx creation
func (c *Context) NodeInfo() (networkID string, version string) {
return c.txSender.Info()
}

// SignBroadcastWait signs, sends and waits for the transaction to be mined.
func (c *Context) SignBroadcastWait(tx transactions.Transaction, blocks uint64) (txReceipt *TxReceipt, err error) {
networkID, _ := c.txSender.Info()
return SignBroadcastWaitTransaction(tx, c.SigningAccount, c.txSender, networkID, blocks)
}

// SetCompiler changes the Context's compiler instance.
func (c *Context) SetCompiler(compiler compileencoder) {
c.compiler = compiler
}
1 change: 1 addition & 0 deletions aeternity/oracles.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (o *Oracle) Listen() error {
if err != nil {
return err
}

queryChan := make(chan *models.OracleQuery)
errChan := make(chan error)
go o.Listener(o.node, o.ID, queryChan, errChan, o.ListenPollInterval)
Expand Down

0 comments on commit f0a24e4

Please sign in to comment.