Skip to content

Commit

Permalink
Merge pull request #231 from InjectiveLabs/release/v1_51_chain_upgrad…
Browse files Browse the repository at this point in the history
…e_1_13_master

release/v1.51 chain upgrade 1.13 to master
  • Loading branch information
aarmoa committed Jul 30, 2024
2 parents 7294750 + 4c652ed commit 907ab57
Show file tree
Hide file tree
Showing 392 changed files with 93,817 additions and 20,753 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/checkout@master
with:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version-file: "go.mod"
check-latest: true
- run: go install golang.org/x/tools/cmd/goimports@latest
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s - -b $(go env GOPATH)/bin v1.49.0
- run: echo "PATH=$PATH:/home/runner/go/bin" >> $GITHUB_ENV
- uses: actions/checkout@v3
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.0
- uses: pre-commit/[email protected]
5 changes: 3 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@master
with:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version-file: "go.mod"
check-latest: true
- name: Run test and calculate coverage
run: make coverage
- name: Upload coverage to Codecov
Expand Down
53 changes: 53 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"run": {
"tests": false,
},
"linters": {
"fast": false,
"enable": [
"errcheck",
"errorlint",
"gas",
"gocritic",
"gosimple",
"govet",
"ineffassign",
"megacheck",
"misspell",
"nakedret",
"prealloc",
"revive",
"staticcheck",
"unconvert",
"unparam",
],
"disable": [
"unused",
]
},
"linters-settings": {
"revive": {
"enableAllRules": true,
"rules": [
{
"name": "var-naming",
"arguments": [
["ID"]
]
}
]
},
"gocritic": {
"enabled-tags": [
"diagnostic",
"experimental",
"opinionated",
"performance",
"style",
],
"disabled-checks": [
"hugeParam",
]
}
},
}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.0
rev: master
hooks:
- id: go-fmt
- id: go-imports
Expand Down
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ all:

copy-exchange-client:
rm -rf exchange/*
mkdir -p exchange/health_rpc
mkdir -p exchange/accounts_rpc
mkdir -p exchange/auction_rpc
mkdir -p exchange/campaign_rpc
Expand All @@ -15,6 +16,8 @@ copy-exchange-client:
mkdir -p exchange/spot_exchange_rpc
mkdir -p exchange/trading_rpc

cp -r ../injective-indexer/api/gen/grpc/health/pb exchange/health_rpc/pb
cp -r ../injective-indexer/api/gen/grpc/injective_accounts_rpc/pb exchange/accounts_rpc/pb
cp -r ../injective-indexer/api/gen/grpc/injective_accounts_rpc/pb exchange/accounts_rpc/pb
cp -r ../injective-indexer/api/gen/grpc/injective_auction_rpc/pb exchange/auction_rpc/pb
cp -r ../injective-indexer/api/gen/grpc/injective_campaign_rpc/pb exchange/campaign_rpc/pb
Expand All @@ -31,10 +34,10 @@ copy-exchange-client:
.PHONY: copy-exchange-client tests coverage

copy-chain-types:
cp ../injective-core/injective-chain/types/*.go chain/types
rm -rf chain/types/*test.go rm -rf chain/types/*gw.go
cp ../injective-core/injective-chain/crypto/ethsecp256k1/*.go chain/crypto/ethsecp256k1
rm -rf chain/crypto/ethsecp256k1/*test.go rm -rf chain/crypto/ethsecp256k1/*gw.go
cp ../injective-core/injective-chain/codec/types/*.go chain/codec/types
rm -rf chain/codec/types/*test.go rm -rf chain/codec/types/*gw.go
cp ../injective-core/injective-chain/modules/auction/types/*.go chain/auction/types
rm -rf chain/auction/types/*test.go rm -rf chain/auction/types/*gw.go
cp ../injective-core/injective-chain/modules/exchange/types/*.go chain/exchange/types
Expand All @@ -48,15 +51,22 @@ copy-chain-types:
rm -rf chain/oracle/types/*test.go rm -rf chain/oracle/types/*gw.go
cp ../injective-core/injective-chain/modules/peggy/types/*.go chain/peggy/types
rm -rf chain/peggy/types/*test.go rm -rf chain/peggy/types/*gw.go
cp ../injective-core/injective-chain/modules/wasmx/types/*.go chain/wasmx/types
rm -rf chain/wasmx/types/*test.go rm -rf chain/wasmx/types/*gw.go
cp ../injective-core/injective-chain/modules/permissions/types/*.go chain/permissions/types
rm -rf chain/permissions/types/*test.go rm -rf chain/permissions/types/*gw.go
cp ../injective-core/injective-chain/modules/tokenfactory/types/*.go chain/tokenfactory/types
rm -rf chain/tokenfactory/types/*test.go rm -rf chain/tokenfactory/types/*gw.go
cp ../injective-core/injective-chain/modules/wasmx/types/*.go chain/wasmx/types
rm -rf chain/wasmx/types/*test.go rm -rf chain/wasmx/types/*gw.go
cp ../injective-core/injective-chain/stream/types/*.go chain/stream/types
rm -rf chain/stream/types/*test.go rm -rf chain/stream/types/*gw.go
cp ../injective-core/injective-chain/types/*.go chain/types
rm -rf chain/types/*test.go rm -rf chain/types/*gw.go

echo "👉 Replace injective-core/injective-chain/modules with sdk-go/chain"
echo "👉 Replace injective-core/injective-chain/types with sdk-go/chain/types"
echo "👉 Replace injective-core/injective-chain/crypto with sdk-go/chain/crypto"
@echo "👉 Replace injective-core/injective-chain/modules with sdk-go/chain"
@echo "👉 Replace injective-core/injective-chain/codec with sdk-go/chain/codec"
@echo "👉 Replace injective-core/injective-chain/codec/types with sdk-go/chain/codec/types"
@echo "👉 Replace injective-core/injective-chain/types with sdk-go/chain/types"
@echo "👉 Replace injective-core/injective-chain/crypto with sdk-go/chain/crypto"

tests:
go test -race ./client/... ./ethereum/...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ go mod download
injectived keys unsafe-import-eth-key inj-user 5d386fbdbf11f1141010f81a46b40f94887367562bd33b452bbaa6ce1cd1381e

# run chain example
go run examples/chain/1_MsgSend/example.go
go run examples/chain/bank/1_MsgSend/example.go

# run exchange example
go run examples/exchange/derivatives/4_Orderbook/example.go
Expand Down
4 changes: 2 additions & 2 deletions auth_vote/authz_vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {
validators := []string{"inj156t3yxd4udv0h9gwagfcmwnmm3quy0npqc7pks", "inj16nd8yqxe9p6ggnrz58qr7dxn5y2834yendward"}
grantee := senderAddress.String()
proposalId := uint64(375)
var msgs []sdk.Msg
var msgs = make([]sdk.Msg, 0)

for _, validator := range validators {
msgVote := v1beta1.MsgVote{
Expand All @@ -92,7 +92,7 @@ func main() {
msgs = append(msgs, sdkMsg)
}

//AsyncBroadcastMsg, SyncBroadcastMsg, QueueBroadcastMsg
// AsyncBroadcastMsg, SyncBroadcastMsg, QueueBroadcastMsg
response, err := chainClient.AsyncBroadcastMsg(msgs...)

if err != nil {
Expand Down
Loading

0 comments on commit 907ab57

Please sign in to comment.