Skip to content

Commit

Permalink
Merge pull request #148 from artela-network/fix/golangci
Browse files Browse the repository at this point in the history
Fix/golangci
  • Loading branch information
gene-zhan authored Oct 24, 2023
2 parents 201f7c8 + 8fb2ff6 commit 688c50d
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 21 deletions.
6 changes: 4 additions & 2 deletions aspect/cosmos/aspect_provider.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package cosmos

import (
"github.com/artela-network/artelasdk/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"math/big"

"github.com/artela-network/aspect-core/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)

type AspectCosmosProvider interface {
Expand Down
11 changes: 6 additions & 5 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"crypto/sha256"
"errors"
"fmt"
"github.com/artela-network/artelasdk/chaincoreext/scheduler"
"os"
"sort"
"strings"
"syscall"
"time"

"github.com/artela-network/aspect-core/chaincoreext/scheduler"

abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/gogoproto/proto"
Expand Down Expand Up @@ -231,7 +232,7 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc
panic(fmt.Errorf("EndBlock listening hook failed, height: %d, err: %w", req.Height, err))
}
}
//schedule
// schedule
if scheduler.TaskInstance() != nil {
confirm, checkErr := scheduler.TaskInstance().Check()
if checkErr != nil {
Expand Down Expand Up @@ -364,9 +365,9 @@ func (app *BaseApp) ProcessProposal(req abci.RequestProcessProposal) (resp abci.
}
}()

//chainID := app.chainID
//nonce := uint64(req.Height) // use height as nonce
//scheduler.NewTaskManager(req.Height, nonce, chainID)
// chainID := app.chainID
// nonce := uint64(req.Height) // use height as nonce
// scheduler.NewTaskManager(req.Height, nonce, chainID)

resp = app.processProposal(app.processProposalState.ctx, req)
return resp
Expand Down
16 changes: 9 additions & 7 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package baseapp
import (
"errors"
"fmt"
"github.com/artela-network/artelasdk/djpm"
"github.com/artela-network/artelasdk/types"
"github.com/cosmos/cosmos-sdk/aspect/cosmos"
"math/big"
"sort"
"strings"

"github.com/artela-network/aspect-core/djpm"
"github.com/artela-network/aspect-core/types"

"github.com/cosmos/cosmos-sdk/aspect/cosmos"

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/crypto/tmhash"
Expand Down Expand Up @@ -50,7 +52,7 @@ const (
var _ abci.Application = (*BaseApp)(nil)

// BaseApp reflects the ABCI application implementation.
type BaseApp struct { //nolint: maligned
type BaseApp struct { // nolint: maligned
// initialized on creation
logger log.Logger
name string // application name from abci.Info
Expand Down Expand Up @@ -685,7 +687,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
if err := validateBasicTxMsgs(msgs); err != nil {
return sdk.GasInfo{}, nil, nil, 0, err
}
//--------aspect FilterTx start --- //
// --------aspect FilterTx start --- //
if mode == runTxModeCheck {
for _, msg := range msgs {
if !app.GetAspectCosmosProvider().FilterAspectTx(msg) {
Expand Down Expand Up @@ -715,14 +717,14 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
continue
}
if !txResult.Data {
//todo add aspect gas
// todo add aspect gas
return sdk.GasInfo{}, nil, nil, 0, errors.New("Filter by Aspect Id " + aspectId)
}
}
}

}
//--------aspect FilterTx end --- //
// --------aspect FilterTx end --- //

if app.anteHandler != nil {
var (
Expand Down
29 changes: 27 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
cosmossdk.io/tools/rosetta v0.2.1
github.com/99designs/keyring v1.2.1
github.com/armon/go-metrics v0.4.1
github.com/artela-network/artelasdk v0.4.0-beta
github.com/artela-network/aspect-core v0.4.1-beta
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/chzyer/readline v1.5.1
Expand Down Expand Up @@ -75,31 +75,46 @@ require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/artela-network/aspect-runtime v0.4.1-beta // indirect
github.com/aws/aws-sdk-go v1.44.203 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bufbuild/protocompile v0.4.0 // indirect
github.com/bytecodealliance/wasmtime-go/v9 v9.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/ethereum/go-ethereum v1.12.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
Expand All @@ -121,13 +136,18 @@ require (
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.2 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
Expand All @@ -136,21 +156,25 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/gomega v1.20.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.0 // indirect
Expand All @@ -167,6 +191,7 @@ require (
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
Expand Down
Loading

0 comments on commit 688c50d

Please sign in to comment.