Skip to content

Commit

Permalink
go format import
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang committed Sep 11, 2024
1 parent 38614a9 commit 4bae9c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
18 changes: 2 additions & 16 deletions examples/account_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,19 @@ package tests
import (
"encoding/json"
"fmt"
"github.com/dapplink-labs/chain-explorer-api/explorer/etherscan"
"github.com/dapplink-labs/chain-explorer-api/explorer/oklink"
"os"
"testing"

"github.com/dapplink-labs/chain-explorer-api/common/account"
"github.com/dapplink-labs/chain-explorer-api/common/chain"
"github.com/dapplink-labs/chain-explorer-api/explorer/etherscan"
"github.com/dapplink-labs/chain-explorer-api/explorer/oklink"
)

func setEnv() {
os.Setenv("HTTP_PROXY", "http://127.0.0.1:7890")
os.Setenv("HTTPS_PROXY", "http://127.0.0.1:7890")
}

func Test_etherscan_GetTxByAddress_txList(t *testing.T) {
setEnv()

_, etherscanClient, err := NewMockClient()
if err != nil {
fmt.Println("new mock client fail", "err", err)
}

request := &account.AccountTxRequest{
ChainShortName: "ETH",
ExplorerName: etherscan.ChainExplorerName,
Expand Down Expand Up @@ -71,8 +62,6 @@ func Test_etherscan_GetTxByAddress_txList(t *testing.T) {
}

func Test_etherscan_GetTxByAddress_txlistinternal(t *testing.T) {
setEnv()

_, etherscanClient, err := NewMockClient()
if err != nil {
fmt.Println("new mock client fail", "err", err)
Expand Down Expand Up @@ -123,7 +112,6 @@ func Test_etherscan_GetTxByAddress_txlistinternal(t *testing.T) {
}

func Test_etherscan_GetTxByAddress_tokentx(t *testing.T) {
setEnv()

_, etherscanClient, err := NewMockClient()
if err != nil {
Expand Down Expand Up @@ -177,7 +165,6 @@ func Test_etherscan_GetTxByAddress_tokentx(t *testing.T) {
}

func Test_etherscan_GetTxByAddress_tokennfttx(t *testing.T) {
setEnv()

_, etherscanClient, err := NewMockClient()
if err != nil {
Expand Down Expand Up @@ -231,7 +218,6 @@ func Test_etherscan_GetTxByAddress_tokennfttx(t *testing.T) {
}

func Test_etherscan_GetTxByAddress_token1155tx(t *testing.T) {
setEnv()

_, etherscanClient, err := NewMockClient()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions explorer/oklink/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package oklink

import (
"fmt"
"github.com/dapplink-labs/chain-explorer-api/common/chain"
"github.com/dapplink-labs/chain-explorer-api/explorer/etherscan"
"math/big"
"strconv"
"strings"

"github.com/dapplink-labs/chain-explorer-api/common"
"github.com/dapplink-labs/chain-explorer-api/common/account"
"github.com/dapplink-labs/chain-explorer-api/common/chain"
"github.com/dapplink-labs/chain-explorer-api/explorer/etherscan"
)

// GET /api/v5/explorer/address/address-summary?chainShortName=eth&address=0x85c6627c4ed773cb7c32644b041f58a058b00d30
Expand Down

0 comments on commit 4bae9c4

Please sign in to comment.