Skip to content

Commit

Permalink
refactor: NewContext doesn't need to return an error after all; TxRec…
Browse files Browse the repository at this point in the history
…eipt.Tx should not be a pointer to an interface
  • Loading branch information
randomshinichi committed Jan 21, 2020
1 parent 30e6487 commit 1dbe992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aeternity/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ type Context struct {

// NewContext creates a new Context, but does not force one to provide a
// compiler (which can be set via SetCompiler)
func NewContext(signingAccount *account.Account, node transactionSender) (b *Context, err error) {
func NewContext(signingAccount *account.Account, node transactionSender) (b *Context) {
return &Context{
SigningAccount: signingAccount,
ttlNoncer: transactions.NewTTLNoncer(node),
txSender: node,
}, nil
}
}

// SenderAccount returns the address of the signing account, which should also
Expand Down
4 changes: 2 additions & 2 deletions aeternity/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func WaitSynchronous(txReceipt *TxReceipt, waitBlocks uint64, n transactionWaite

// TxReceipt represents the status of a sent transaction
type TxReceipt struct {
Tx *transactions.Transaction
Tx transactions.Transaction
SignedTx string
Hash string
Signature string
Expand All @@ -110,7 +110,7 @@ type TxReceipt struct {
}

func (t *TxReceipt) String() string {
return fmt.Sprintf("Mined: %v\nTx: %+v\nSigned: %s\nHash: %s\nSignature: %s\nBlockHeight: %d\nBlockHash: %s", t.Mined, *t.Tx, t.SignedTx, t.Hash, t.Signature, t.BlockHeight, t.BlockHash)
return fmt.Sprintf("Mined: %v\nTx: %+v\nSigned: %s\nHash: %s\nSignature: %s\nBlockHeight: %d\nBlockHash: %s", t.Mined, t.Tx, t.SignedTx, t.Hash, t.Signature, t.BlockHeight, t.BlockHash)
}

func NewTxReceipt(tx transactions.Transaction, signedTx, hash, signature string) (txReceipt *TxReceipt) {
Expand Down

0 comments on commit 1dbe992

Please sign in to comment.