Skip to content

Commit

Permalink
fix: more test fixes for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
andrix10 authored and janaakhterov committed Mar 8, 2021
1 parent e8cf6e7 commit e0d7498
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 57 deletions.
4 changes: 2 additions & 2 deletions file_contents_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ func TestFileContentsQueryCost_SmallMax_Execute(t *testing.T) {
SetMaxQueryPayment(HbarFromTinybar(1)).
SetNodeAccountIDs([]AccountID{resp.NodeID})

_, err = fileContents.GetCost(client)
cost, err := fileContents.GetCost(client)
assert.NoError(t, err)

_, err = fileContents.Execute(client)
if err != nil {
assert.Equal(t, fmt.Sprintf("cost of FileContentsQuery (8 tħ) without explicit payment is greater than the max query payment of 1 tħ"), err.Error())
assert.Equal(t, fmt.Sprintf("cost of FileContentsQuery (" + cost.String() + ") without explicit payment is greater than the max query payment of 1 tħ"), err.Error())
}

resp, err = NewFileDeleteTransaction().
Expand Down
2 changes: 1 addition & 1 deletion token_delete_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ func Test_TokenDelete_NoTokenID(t *testing.T) {
Execute(client)
assert.Error(t, err)
if err != nil {
assert.Equal(t, fmt.Sprintf("exceptional precheck status INVALID_TOKEN_ID received for transaction %s", resp.TransactionID), err.Error())
assert.Equal(t, fmt.Sprintf("exceptional precheck status NOT_SUPPORTED received for transaction %s", resp.TransactionID), err.Error())
}
}
54 changes: 0 additions & 54 deletions token_info_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ func TestTokenInfoQuery_Execute(t *testing.T) {
assert.Equal(t, info.SupplyKey.String(), client.GetOperatorPublicKey().String())
assert.False(t, *info.DefaultFreezeStatus)
assert.False(t, *info.DefaultKycStatus)

resp, err = NewTokenDeleteTransaction().
SetNodeAccountIDs([]AccountID{resp.NodeID}).
SetTokenID(tokenID).
Execute(client)
assert.NoError(t, err)

_, err = resp.GetReceipt(client)
assert.NoError(t, err)
}

func TestTokenInfoQueryCost_Execute(t *testing.T) {
Expand Down Expand Up @@ -108,15 +99,6 @@ func TestTokenInfoQueryCost_Execute(t *testing.T) {

_, err = infoQuery.SetQueryPayment(cost).Execute(client)
assert.NoError(t, err)

resp, err = NewTokenDeleteTransaction().
SetNodeAccountIDs([]AccountID{resp.NodeID}).
SetTokenID(tokenID).
Execute(client)
assert.NoError(t, err)

_, err = resp.GetReceipt(client)
assert.NoError(t, err)
}

func TestTokenInfoQueryCost_BigMax_Execute(t *testing.T) {
Expand Down Expand Up @@ -152,15 +134,6 @@ func TestTokenInfoQueryCost_BigMax_Execute(t *testing.T) {

_, err = infoQuery.SetQueryPayment(cost).Execute(client)
assert.NoError(t, err)

resp, err = NewTokenDeleteTransaction().
SetNodeAccountIDs([]AccountID{resp.NodeID}).
SetTokenID(tokenID).
Execute(client)
assert.NoError(t, err)

_, err = resp.GetReceipt(client)
assert.NoError(t, err)
}

func TestTokenInfoQueryCost_SmallMax_Execute(t *testing.T) {
Expand Down Expand Up @@ -198,15 +171,6 @@ func TestTokenInfoQueryCost_SmallMax_Execute(t *testing.T) {
if err != nil {
assert.Equal(t, fmt.Sprintf("cost of TokenInfoQuery ("+cost.String()+") without explicit payment is greater than the max query payment of 1 tħ"), err.Error())
}

resp, err = NewTokenDeleteTransaction().
SetNodeAccountIDs([]AccountID{resp.NodeID}).
SetTokenID(tokenID).
Execute(client)
assert.NoError(t, err)

_, err = resp.GetReceipt(client)
assert.NoError(t, err)
}

func TestTokenInfoQueryCost_InsufficientCost_Execute(t *testing.T) {
Expand Down Expand Up @@ -244,15 +208,6 @@ func TestTokenInfoQueryCost_InsufficientCost_Execute(t *testing.T) {
if err != nil {
assert.Equal(t, fmt.Sprintf("exceptional precheck status INSUFFICIENT_TX_FEE"), err.Error())
}

resp, err = NewTokenDeleteTransaction().
SetNodeAccountIDs([]AccountID{resp.NodeID}).
SetTokenID(tokenID).
Execute(client)
assert.NoError(t, err)

_, err = resp.GetReceipt(client)
assert.NoError(t, err)
}

func Test_TokenInfo_NoPayment(t *testing.T) {
Expand Down Expand Up @@ -290,15 +245,6 @@ func Test_TokenInfo_NoPayment(t *testing.T) {
assert.Equal(t, info.Treasury, client.GetOperatorAccountID())
assert.False(t, *info.DefaultFreezeStatus)
assert.False(t, *info.DefaultKycStatus)

resp, err = NewTokenDeleteTransaction().
SetNodeAccountIDs([]AccountID{resp.NodeID}).
SetTokenID(tokenID).
Execute(client)
assert.NoError(t, err)

_, err = resp.GetReceipt(client)
assert.NoError(t, err)
}

func Test_TokenInfo_NoTokenID(t *testing.T) {
Expand Down

0 comments on commit e0d7498

Please sign in to comment.