Skip to content

Commit

Permalink
chore: remove duplicate conditoinal, commented out panic, and run `go…
Browse files Browse the repository at this point in the history
… fmt`
  • Loading branch information
janaakhterov committed Dec 24, 2020
1 parent 23d94df commit 6f81289
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions contract_update_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ func (transaction *ContractUpdateTransaction) Execute(
return TransactionResponse{}, transaction.freezeError
}

if transaction.freezeError != nil {
return TransactionResponse{}, transaction.freezeError
}

if !transaction.IsFrozen() {
_, err := transaction.FreezeWith(client)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion topic_message_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func TestTopicMessageQuery_NoStartTime_Execute(t *testing.T) {
assert.NoError(t, err)

for {
if err != nil|| !wait || uint64(time.Since(start).Seconds()) > 30 {
if err != nil || !wait || uint64(time.Since(start).Seconds()) > 30 {
break
}

Expand Down
5 changes: 2 additions & 3 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Transaction struct {
signedTransactions []*proto.SignedTransaction
nodeIDs []AccountID

freezeError error
freezeError error
}

func newTransaction() Transaction {
Expand All @@ -40,7 +40,7 @@ func newTransaction() Transaction {
transactions: make([]*proto.Transaction, 0),
signedTransactions: make([]*proto.SignedTransaction, 0),
nodeIDs: make([]AccountID, 0),
freezeError: nil,
freezeError: nil,
}
}

Expand Down Expand Up @@ -291,7 +291,6 @@ func (transaction *Transaction) isFrozen() bool {

func (transaction *Transaction) requireNotFrozen() {
if transaction.isFrozen() {
//panic("Transaction is immutable; it has at least one signature or has been explicitly frozen")
transaction.freezeError = errTransactionIsFrozen
}
}
Expand Down

0 comments on commit 6f81289

Please sign in to comment.