Skip to content

Commit

Permalink
make lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer-zq committed Jul 1, 2024
1 parent 66e5651 commit 8385cae
Show file tree
Hide file tree
Showing 28 changed files with 493 additions and 30 deletions.
9 changes: 9 additions & 0 deletions e2e/farm/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func CreateFarmPoolExec(t *testing.T, network simapp.Network, clientCtx client.C
creator string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
fmt.Sprintf("--%s=%s", flags.FlagFrom, creator),
}
Expand All @@ -32,6 +33,7 @@ func QueryFarmPoolsExec(
clientCtx client.Context,
extraArgs ...string,
) *farmtypes.QueryFarmPoolsResponse {
t.Helper()
args := []string{
fmt.Sprintf("--%s=json", cli.OutputFlag),
}
Expand All @@ -50,6 +52,7 @@ func QueryFarmPoolExec(
poolID string,
extraArgs ...string,
) *farmtypes.QueryFarmPoolResponse {
t.Helper()
args := []string{
poolID,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand All @@ -66,6 +69,7 @@ func AppendRewardExec(t *testing.T, network simapp.Network, clientCtx client.Con
poolID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
poolID,
fmt.Sprintf("--%s=%s", flags.FlagFrom, creator),
Expand All @@ -81,6 +85,7 @@ func StakeExec(t *testing.T, network simapp.Network, clientCtx client.Context,
lpToken string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
poolID,
lpToken,
Expand All @@ -97,6 +102,7 @@ func UnstakeExec(t *testing.T, network simapp.Network, clientCtx client.Context,
lpToken string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
poolID,
lpToken,
Expand All @@ -112,6 +118,7 @@ func HarvestExec(t *testing.T, network simapp.Network, clientCtx client.Context,
poolID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
poolID,
fmt.Sprintf("--%s=%s", flags.FlagFrom, creator),
Expand All @@ -126,6 +133,7 @@ func DestroyExec(t *testing.T, network simapp.Network, clientCtx client.Context,
poolID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
poolID,
fmt.Sprintf("--%s=%s", flags.FlagFrom, creator),
Expand All @@ -139,6 +147,7 @@ func QueryFarmerExec(t *testing.T, network simapp.Network, clientCtx client.Cont
creator string,
extraArgs ...string,
) *farmtypes.QueryFarmerResponse {
t.Helper()
args := []string{
creator,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand Down
3 changes: 3 additions & 0 deletions e2e/htlc/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func CreateHTLCExec(t *testing.T,
from string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
}
Expand Down Expand Up @@ -56,6 +57,7 @@ func ClaimHTLCExec(t *testing.T,
secret string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
id,
secret,
Expand All @@ -81,6 +83,7 @@ func QueryHTLCExec(t *testing.T,
id string,
extraArgs ...string,
) *htlctypes.HTLC {
t.Helper()
args := []string{
id,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand Down
12 changes: 12 additions & 0 deletions e2e/mt/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ func IssueDenomExec(
from string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
}
args = append(args, extraArgs...)

return network.ExecTxCmdWithResult(t, clientCtx, mtcli.GetCmdIssueDenom(), args)
}

// BurnMTExec executes a burn token transaction.
//
// Parameters:
Expand All @@ -62,6 +64,7 @@ func BurnMTExec(t *testing.T,
amount string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denomID,
mtID,
Expand Down Expand Up @@ -92,6 +95,7 @@ func MintMTExec(t *testing.T,
denomID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denomID,
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
Expand Down Expand Up @@ -122,6 +126,7 @@ func EditMTExec(t *testing.T,
mtID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denomID,
mtID,
Expand Down Expand Up @@ -157,6 +162,7 @@ func TransferMTExec(t *testing.T,
amount string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
from,
recipient,
Expand Down Expand Up @@ -186,6 +192,7 @@ func QueryDenomExec(t *testing.T,
denomID string,
extraArgs ...string,
) *mttypes.Denom {
t.Helper()
args := []string{
denomID,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand All @@ -212,6 +219,7 @@ func QueryDenomsExec(t *testing.T,
clientCtx client.Context,
extraArgs ...string,
) *mttypes.QueryDenomsResponse {
t.Helper()
args := []string{
fmt.Sprintf("--%s=json", cli.OutputFlag),
}
Expand Down Expand Up @@ -240,6 +248,7 @@ func QueryMTsExec(t *testing.T,
resp proto.Message,
extraArgs ...string,
) {
t.Helper()
args := []string{
denomID,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand Down Expand Up @@ -268,6 +277,7 @@ func QueryMTExec(t *testing.T,
mtID string,
extraArgs ...string,
) *mttypes.MT {
t.Helper()
args := []string{
denomID,
mtID,
Expand Down Expand Up @@ -298,6 +308,7 @@ func QueryBlancesExec(t *testing.T,
denomID string,
extraArgs ...string,
) *mttypes.QueryBalancesResponse {
t.Helper()
args := []string{
from,
denomID,
Expand Down Expand Up @@ -331,6 +342,7 @@ func TransferDenomExec(t *testing.T,
denomID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
from,
recipient,
Expand Down
23 changes: 23 additions & 0 deletions e2e/nft/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func IssueDenomExec(t *testing.T,
denom string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denom,
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
Expand All @@ -30,6 +31,7 @@ func IssueDenomExec(t *testing.T,
return network.ExecTxCmdWithResult(t, clientCtx, nftcli.GetCmdIssueDenom(), args)
}

// BurnNFTExec creates a nft burnt message.
func BurnNFTExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
Expand All @@ -38,6 +40,7 @@ func BurnNFTExec(t *testing.T,
tokenID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denomID,
tokenID,
Expand All @@ -48,6 +51,7 @@ func BurnNFTExec(t *testing.T,
return network.ExecTxCmdWithResult(t, clientCtx, nftcli.GetCmdBurnNFT(), args)
}

// MintNFTExec creates a nft minted message.
func MintNFTExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
Expand All @@ -56,6 +60,7 @@ func MintNFTExec(t *testing.T,
tokenID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denomID,
tokenID,
Expand All @@ -66,6 +71,7 @@ func MintNFTExec(t *testing.T,
return network.ExecTxCmdWithResult(t, clientCtx, nftcli.GetCmdMintNFT(), args)
}

// EditNFTExec creates a nft edited message.
func EditNFTExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
Expand All @@ -74,6 +80,7 @@ func EditNFTExec(t *testing.T,
tokenID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
denomID,
tokenID,
Expand All @@ -84,6 +91,7 @@ func EditNFTExec(t *testing.T,
return network.ExecTxCmdWithResult(t, clientCtx, nftcli.GetCmdEditNFT(), args)
}

// TransferNFTExec creates a nft transferred message.
func TransferNFTExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
Expand All @@ -93,6 +101,7 @@ func TransferNFTExec(t *testing.T,
tokenID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
recipient,
denomID,
Expand All @@ -104,6 +113,7 @@ func TransferNFTExec(t *testing.T,
return network.ExecTxCmdWithResult(t, clientCtx, nftcli.GetCmdTransferNFT(), args)
}

// TransferDenomExec creates a nft transferred message.
func TransferDenomExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
Expand All @@ -112,6 +122,7 @@ func TransferDenomExec(t *testing.T,
denomID string,
extraArgs ...string,
) *simapp.ResponseTx {
t.Helper()
args := []string{
recipient,
denomID,
Expand All @@ -122,12 +133,14 @@ func TransferDenomExec(t *testing.T,
return network.ExecTxCmdWithResult(t, clientCtx, nftcli.GetCmdTransferDenom(), args)
}

// QueryDenomExec query denom.
func QueryDenomExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
denomID string,
extraArgs ...string,
) *nfttypes.Denom {
t.Helper()
args := []string{
denomID,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand All @@ -139,12 +152,14 @@ func QueryDenomExec(t *testing.T,
return response
}

// QueryCollectionExec query collection.
func QueryCollectionExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
denomID string,
extraArgs ...string,
) *nfttypes.QueryCollectionResponse {
t.Helper()
args := []string{
denomID,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand All @@ -156,11 +171,13 @@ func QueryCollectionExec(t *testing.T,
return response
}

// QueryDenomsExec query denoms.
func QueryDenomsExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
extraArgs ...string,
) *nfttypes.QueryDenomsResponse {
t.Helper()
args := []string{
fmt.Sprintf("--%s=json", cli.OutputFlag),
}
Expand All @@ -171,12 +188,14 @@ func QueryDenomsExec(t *testing.T,
return response
}

// QuerySupplyExec query supply.
func QuerySupplyExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
denom string,
extraArgs ...string,
) *nfttypes.QuerySupplyResponse {
t.Helper()
args := []string{
denom,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand All @@ -188,12 +207,14 @@ func QuerySupplyExec(t *testing.T,
return response
}

// QueryOwnerExec query owner.
func QueryOwnerExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
address string,
extraArgs ...string,
) *nfttypes.QueryNFTsOfOwnerResponse {
t.Helper()
args := []string{
address,
fmt.Sprintf("--%s=json", cli.OutputFlag),
Expand All @@ -205,13 +226,15 @@ func QueryOwnerExec(t *testing.T,
return response
}

// QueryNFTExec query nft.
func QueryNFTExec(t *testing.T,
network simapp.Network,
clientCtx client.Context,
denomID string,
tokenID string,
extraArgs ...string,
) *nfttypes.BaseNFT {
t.Helper()
args := []string{
denomID,
tokenID,
Expand Down
Loading

0 comments on commit 8385cae

Please sign in to comment.