Skip to content

Commit

Permalink
golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
duktig666 committed Jul 19, 2023
1 parent 60e7020 commit 6fc1bb1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@ linters:
- nonamedreturns
- depguard
- tagalign
- godox # todo
6 changes: 3 additions & 3 deletions nft/nftscan/nft_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func NewNFTScan(ctx context.Context, elRpc string) (*NFTScan, error) {
}

chainID, err := ethClient.Client.ChainID(ctx)
if err != nil {
return nil, errors.Wrap(err, "ChainID err.")
}
return &NFTScan{
ethClient: ethClient,
chainID: chainID,
Expand Down Expand Up @@ -133,9 +136,6 @@ func (v *NFTScan) analyzeContractDeployTx(ctx context.Context, tx *types.Transac
if err != nil {
return errors.Wrapf(err, "recordErc721 err. contractAddress:%s txHash:%s", receipt.ContractAddress.Hex(), tx.Hash().String())
}
break
case Unknown:
break
}
}

Expand Down
44 changes: 22 additions & 22 deletions nft/nftscan/typings.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,54 @@ package nftscan

type NFTContract struct {
ID int64 `gorm:"primary key ; auto increment" json:"id"`
NftContractHash string `json:"nftContractHash"`
NftContractHash string `json:"nft_contract_hash"`
CollectionName string `json:"collection_name"`
CollectionSymbol string `json:"collection_symbol"`
TransactionHash string `json:"transaction_hash"`
Blockchain string `json:"blockchain"`
BlockHeight uint64 `json:"block_height"` // 发现块高
CreateTime int64 `json:"create_time"`
ErcType string `json:"erc_type"`
LowestPrice24h float64 `json:"lowestPrice24H"`
HighestPrice24h float64 `json:"highestPrice24H"`
AveragePrice24h float64 `json:"averagePrice24H"`
Volume24h float64 `json:"volume24H"`
VolumeTotal float64 `json:"volumeTotal"`
LowestPrice24h float64 `json:"lowest_price_24h"`
HighestPrice24h float64 `json:"highest_price_24h"`
AveragePrice24h float64 `json:"average_price_24h"`
Volume24h float64 `json:"volume_24h"`
VolumeTotal float64 `json:"volume_total"`
}

type NFTAsset struct {
ID int64 `gorm:"primary key ; auto increment" json:"id"`
NftAssetId string `json:"nftAssetId"`
NftContractHash string `json:"nftContractHash"`
MintTransactionHash string `json:"mintTransactionHash"`
MintBlockHeight uint64 `json:"mintBlockHeight"`
MintTimeStamp uint64 `json:"mintTimeStamp"`
NftAssetId string `json:"nft_asset_id"`
NftContractHash string `json:"nft_contract_hash"`
MintTransactionHash string `json:"mint_transaction_hash"`
MintBlockHeight uint64 `json:"mint_block_height"`
MintTimeStamp uint64 `json:"mint_time_stamp"`
Creator string `json:"creator"` // 发现块高
Holder string `json:"holder"`
ImageUrl string `json:"imageUrl"`
ImageUrl string `json:"image_url"`
Format string `json:"format"`
// todo burn
}

type NFTTransaction struct {
ID int64 `gorm:"primary key ; auto increment" json:"id"`
TransactionHash string `json:"transactionHash"`
BlockHeight uint64 `json:"blockHeight"`
TimeStamp uint64 `json:"timeStamp"`
TransactionHash string `json:"transaction_hash"`
BlockHeight uint64 `json:"block_height"`
TimeStamp uint64 `json:"timestamp"`
From string `json:"from"`
To string `json:"to"`
Value uint64 `json:"value"` // 发现块高
GasPrice uint64 `json:"gasPrice"`
GasLimit uint64 `json:"gasLimit"`
GasUsedByTransaction uint64 `json:"gasUsedByTransaction"`
TransactionFee float64 `json:"transactionFee"`
GasPrice uint64 `json:"gas_price"`
GasLimit uint64 `json:"gas_limit"`
GasUsedByTransaction uint64 `json:"gas_used_by_transaction"`
TransactionFee float64 `json:"transaction_fee"`
}

type NFTTransfer struct {
ID int64 `gorm:"primary key ; auto increment" json:"id"`
NFTContractHash string `json:"NFTContractHash"`
NFTAssetId string `json:"NFTAssetId"`
TransactionHash string `json:"transactionHash"`
NFTContractHash string `json:"nft_contract_hash"`
NFTAssetId string `json:"nft_asset_id"`
TransactionHash string `json:"transaction_hash"`
From string `json:"from"`
To string `json:"to"`
Type string `json:"type"`
Expand Down

0 comments on commit 6fc1bb1

Please sign in to comment.