Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
irina-pereiaslavskaia committed Jan 17, 2024
1 parent 8f3dfbb commit 99fd86a
Show file tree
Hide file tree
Showing 26 changed files with 458 additions and 402 deletions.
18 changes: 9 additions & 9 deletions itests/alias_tx_api_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,22 @@ func (suite *AliasTxApiSuite) Test_SameAliasDiffAddressesApiNegative() {
caseName := utl.GetTestcaseNameWithVersion(name, v)
suite.Run(caseName, func() {
//send alias tx from account that is in first element of testdata slice
tx, _, actualDiffBalanceInWaves := alias.BroadcastAliasTxAndGetWavesBalances(&suite.BaseSuite,
tx1, _, actualDiffBalanceInWaves := alias.BroadcastAliasTxAndGetWavesBalances(&suite.BaseSuite,
tdSlice[0], v, true)
errMsg := caseName + "Broadcast Alias Tx: " + tx.TxID.String()
errMsg := caseName + "Broadcast Alias Tx: " + tx1.TxID.String()

utl.StatusCodesCheck(suite.T(), http.StatusOK, http.StatusOK, tx, errMsg)
utl.TxInfoCheck(suite.T(), tx.WtErr.ErrWtGo, tx.WtErr.ErrWtScala, errMsg)
utl.StatusCodesCheck(suite.T(), http.StatusOK, http.StatusOK, tx1, errMsg)
utl.TxInfoCheck(suite.T(), tx1.WtErr.ErrWtGo, tx1.WtErr.ErrWtScala, errMsg)
utl.WavesDiffBalanceCheck(suite.T(), tdSlice[0].Expected.WavesDiffBalanceAfterFirstTx,
actualDiffBalanceInWaves.BalanceInWavesGo, actualDiffBalanceInWaves.BalanceInWavesScala,
errMsg)
//send alias tx from account that is in each next slice element
for j := 1; j < len(tdSlice); j++ {
tx, _, actualDiffBalanceInWaves := alias.BroadcastAliasTxAndGetWavesBalances(
tx2, _, actualDiffBalanceInWaves := alias.BroadcastAliasTxAndGetWavesBalances(

Check failure on line 147 in itests/alias_tx_api_internal_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

shadow: declaration of "actualDiffBalanceInWaves" shadows declaration at line 136 (govet)
&suite.BaseSuite, tdSlice[j], v, false)
txIds[name] = &tx.TxID
txIds[name] = &tx2.TxID

utl.StatusCodesCheck(suite.T(), http.StatusInternalServerError, http.StatusBadRequest, tx,
utl.StatusCodesCheck(suite.T(), http.StatusInternalServerError, http.StatusBadRequest, tx2,
errMsg)
utl.WavesDiffBalanceCheck(suite.T(), tdSlice[j].Expected.WavesDiffBalance,
actualDiffBalanceInWaves.BalanceInWavesGo, actualDiffBalanceInWaves.BalanceInWavesGo,
Expand All @@ -157,8 +157,8 @@ func (suite *AliasTxApiSuite) Test_SameAliasDiffAddressesApiNegative() {
if v == 3 {
idsCount = 0
utl.ErrorMessageCheck(suite.T(), tdSlice[j].Expected.ErrBrdCstGoMsg,
tdSlice[j].Expected.ErrBrdCstScalaMsg, tx.BrdCstErr.ErrorBrdCstGo,
tx.BrdCstErr.ErrorBrdCstScala, errMsg)
tdSlice[j].Expected.ErrBrdCstScalaMsg, tx2.BrdCstErr.ErrorBrdCstGo,
tx2.BrdCstErr.ErrorBrdCstScala, errMsg)
}
}
})
Expand Down
10 changes: 5 additions & 5 deletions itests/burn_tx_api_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (suite *BurnTxApiSuite) Test_BurnTxApiPositive() {
versions := burn.GetVersions(&suite.BaseSuite)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetBurnPositiveDataMatrix(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -45,7 +45,7 @@ func (suite *BurnTxSuite) Test_BurnTxApiAssetWithMaxAvailableFee() {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
n := transfer.GetNewAccountWithFunds(&suite.BaseSuite, v, utl.TestChainID,
utl.DefaultAccountForLoanFunds, 10000000000)
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetBurnAllAssetWithMaxAvailableFee(&suite.BaseSuite, itx.TxID, n)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -64,15 +64,15 @@ func (suite *BurnTxApiSuite) Test_BurnNFTFromOwnerAccountApiPositive() {
for _, v := range versions {
nft := testdata.GetCommonIssueData(&suite.BaseSuite).NFT
//get NFT
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, nft, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, nft, v, true)
//data for transfer
transferNFT := testdata.GetCommonTransferData(&suite.BaseSuite, &itx.TxID).NFT
tdmatrix := testdata.GetBurnNFTFromOwnerAccount(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
suite.Run(caseName, func() {
//transfer NFT from Account 2 to Account 3
ttx := transfer.TransferBroadcastWithTestData(&suite.BaseSuite, transferNFT, v, true)
ttx := transfer.BroadcastWithTestData(&suite.BaseSuite, transferNFT, v, true)
errMsg := caseName + "Transfer tx" + ttx.TxID.String()

utl.StatusCodesCheck(suite.T(), http.StatusOK, http.StatusOK, ttx, errMsg)
Expand All @@ -94,7 +94,7 @@ func (suite *BurnTxApiSuite) Test_BurnTxApiNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetBurnNegativeDataMatrix(&suite.BaseSuite, itx.TxID)
//TODO (ipereiaslavskaia) For v1 of burn tx negative cases for chainID will be ignored
if v >= 2 {
Expand Down
10 changes: 5 additions & 5 deletions itests/burn_tx_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (suite *BurnTxSuite) Test_BurnTxPositive() {
versions := burn.GetVersions(&suite.BaseSuite)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetBurnPositiveDataMatrix(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -44,7 +44,7 @@ func (suite *BurnTxSuite) Test_BurnTxAssetWithMaxAvailableFeePositive() {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
n := transfer.GetNewAccountWithFunds(&suite.BaseSuite, v, utl.TestChainID,
utl.DefaultAccountForLoanFunds, 10000000000)
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetBurnAllAssetWithMaxAvailableFee(&suite.BaseSuite, itx.TxID, n)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -63,15 +63,15 @@ func (suite *BurnTxSuite) Test_BurnNFTFromOwnerAccountPositive() {
for _, v := range versions {
nft := testdata.GetCommonIssueData(&suite.BaseSuite).NFT
//get NFT
itx := issue.IssueSendWithTestData(&suite.BaseSuite, nft, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, nft, v, true)
//data for transfer
transferNFT := testdata.GetCommonTransferData(&suite.BaseSuite, &itx.TxID).NFT
tdmatrix := testdata.GetBurnNFTFromOwnerAccount(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
suite.Run(caseName, func() {
//transfer NFT from Account 2 to Account 3
ttx := transfer.TransferSendWithTestData(&suite.BaseSuite, transferNFT, v, true)
ttx := transfer.SendWithTestData(&suite.BaseSuite, transferNFT, v, true)
errMsg := caseName + "Transfer tx" + ttx.TxID.String()

utl.TxInfoCheck(suite.BaseSuite.T(), ttx.WtErr.ErrWtGo, ttx.WtErr.ErrWtScala, errMsg)
Expand All @@ -91,7 +91,7 @@ func (suite *BurnTxSuite) Test_BurnTxNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetBurnNegativeDataMatrix(&suite.BaseSuite, itx.TxID)
//TODO (ipereiaslavskaia) For v1 of burn tx negative cases for chainID will be ignored
if v >= 2 {
Expand Down
10 changes: 5 additions & 5 deletions itests/reissue_tx_api_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (suite *ReissueTxApiSuite) Test_ReissueTxApiPositive() {
versions := reissue.GetVersions(&suite.BaseSuite)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetReissuePositiveDataMatrix(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -42,7 +42,7 @@ func (suite *ReissueTxApiSuite) Test_ReissueTxApiMaxQuantityPositive() {
versions := reissue.GetVersions(&suite.BaseSuite)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetReissueMaxQuantityValue(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -61,7 +61,7 @@ func (suite *ReissueTxApiSuite) Test_ReissueNotReissuableApiNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetNotReissuableTestData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand Down Expand Up @@ -91,7 +91,7 @@ func (suite *ReissueTxApiSuite) Test_ReissueTxApiNFTNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
nft := testdata.GetCommonIssueData(&suite.BaseSuite).NFT
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, nft, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, nft, v, true)
tdmatrix := testdata.GetReissueNFTData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -113,7 +113,7 @@ func (suite *ReissueTxApiSuite) Test_ReissueTxApiNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetReissueNegativeDataMatrix(&suite.BaseSuite, itx.TxID)
//TODO (ipereiaslavskaia) For v1 of reissue tx negative cases for chainID will be ignored
if v >= 2 {
Expand Down
10 changes: 5 additions & 5 deletions itests/reissuie_tx_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (suite *ReissueTxSuite) Test_ReissuePositive() {
versions := reissue.GetVersions(&suite.BaseSuite)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetReissuePositiveDataMatrix(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -41,7 +41,7 @@ func (suite *ReissueTxSuite) Test_ReissueMaxQuantityPositive() {
versions := reissue.GetVersions(&suite.BaseSuite)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetReissueMaxQuantityValue(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -60,7 +60,7 @@ func (suite *ReissueTxSuite) Test_ReissueNotReissuableNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetNotReissuableTestData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand Down Expand Up @@ -89,7 +89,7 @@ func (suite *ReissueTxSuite) Test_ReissueNFTNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
nft := testdata.GetCommonIssueData(&suite.BaseSuite).NFT
itx := issue.IssueSendWithTestData(&suite.BaseSuite, nft, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, nft, v, true)
tdmatrix := testdata.GetReissueNFTData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -111,7 +111,7 @@ func (suite *ReissueTxSuite) Test_ReissueNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
reissuable := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, reissuable, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, reissuable, v, true)
tdmatrix := testdata.GetReissueNegativeDataMatrix(&suite.BaseSuite, itx.TxID)
//TODO (ipereiaslavskaia) For v1 of reissue tx negative cases for chainID will be ignored
if v >= 2 {
Expand Down
6 changes: 3 additions & 3 deletions itests/set_asset_script_tx_api_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (suite *SetAssetScriptApiSuite) Test_SetAssetScriptApiPositive() {
versions := set_asset_script.GetVersions(&suite.BaseSuite)
for _, v := range versions {
smartAsset := testdata.GetCommonIssueData(&suite.BaseSuite).Smart
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, smartAsset, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, smartAsset, v, true)
tdmatrix := testdata.GetSetAssetScriptPositiveData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -43,7 +43,7 @@ func (suite *SetAssetScriptApiSuite) Test_SetAssetScriptApiNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
smartAsset := testdata.GetCommonIssueData(&suite.BaseSuite).Smart
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, smartAsset, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, smartAsset, v, true)
tdmatrix := testdata.GetSetAssetScriptNegativeData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -67,7 +67,7 @@ func (suite *SetAssetScriptApiSuite) Test_SetScriptForNotScriptedAssetApiNegativ
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
asset := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueBroadcastWithTestData(&suite.BaseSuite, asset, v, true)
itx := issue.BroadcastWithTestData(&suite.BaseSuite, asset, v, true)
name := "Set script for not scripted asset"
td := testdata.GetSimpleSmartAssetNegativeData(&suite.BaseSuite, itx.TxID)
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand Down
6 changes: 3 additions & 3 deletions itests/set_asset_script_tx_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (suite *SetAssetScriptSuite) Test_SetAssetScriptPositive() {
versions := set_asset_script.GetVersions(&suite.BaseSuite)
for _, v := range versions {
smartAsset := testdata.GetCommonIssueData(&suite.BaseSuite).Smart
itx := issue.IssueSendWithTestData(&suite.BaseSuite, smartAsset, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, smartAsset, v, true)
tdmatrix := testdata.GetSetAssetScriptPositiveData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -42,7 +42,7 @@ func (suite *SetAssetScriptSuite) Test_SetAssetScriptNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
smartAsset := testdata.GetCommonIssueData(&suite.BaseSuite).Smart
itx := issue.IssueSendWithTestData(&suite.BaseSuite, smartAsset, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, smartAsset, v, true)
tdmatrix := testdata.GetSetAssetScriptNegativeData(&suite.BaseSuite, itx.TxID)
for name, td := range tdmatrix {
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand All @@ -65,7 +65,7 @@ func (suite *SetAssetScriptSuite) Test_SetScriptForNotScriptedAssetNegative() {
txIds := make(map[string]*crypto.Digest)
for _, v := range versions {
asset := testdata.GetCommonIssueData(&suite.BaseSuite).Reissuable
itx := issue.IssueSendWithTestData(&suite.BaseSuite, asset, v, true)
itx := issue.SendWithTestData(&suite.BaseSuite, asset, v, true)
name := "Set script for not scripted asset"
td := testdata.GetSimpleSmartAssetNegativeData(&suite.BaseSuite, itx.TxID)
caseName := utl.GetTestcaseNameWithVersion(name, v)
Expand Down
Loading

0 comments on commit 99fd86a

Please sign in to comment.