Skip to content

Commit d55c55a

Browse files
committed
(feat) Updated proto definitions to injective-core v1.17.0-beta.3 and indexer v1.17.0-beta
1 parent 56d001c commit d55c55a

File tree

98 files changed

+15689
-4995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+15689
-4995
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
all:
22

33
clone-injective-indexer:
4-
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.16.91 --depth 1 --single-branch
4+
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.17.0-beta --depth 1 --single-branch
55

66
clone-injective-core:
7-
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.16.4 --depth 1 --single-branch
7+
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.17.0-beta.3 --depth 1 --single-branch
88

99
copy-exchange-client: clone-injective-indexer
1010
rm -rf exchange/*
@@ -166,9 +166,9 @@ copy-chain-types: clone-injective-core
166166
make extract-message-names
167167

168168
extract-message-names:
169-
@echo "Extracting message names from tx.pb.go files..."
169+
@echo "Extracting message names from tx.pb.go and msgs.pb.go files..."
170170
@mkdir -p injective_data
171-
@find ./chain -name "tx.pb.go" -exec grep -h "proto\.RegisterType" {} \; | \
171+
@find ./chain \( -name "tx.pb.go" -o -name "msgs.pb.go" \) -exec grep -h "proto\.RegisterType" {} \; | \
172172
sed -n 's/.*proto\.RegisterType([^"]*"\([^"]*\)".*/\1/p' | \
173173
grep -v 'Response$$' | \
174174
sort -u | \

chain/evm/precompiles/bank/fixed_supply_bank_erc20.abigen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/evm/precompiles/bank/i_bank_module.abigen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/evm/precompiles/bank/mint_burn_bank_erc20.abigen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/evm/precompiles/staking/i_staking_module.abigen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/evm/types/errors.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
errorsmod "cosmossdk.io/errors"
99
"github.com/ethereum/go-ethereum/common"
10+
"github.com/ethereum/go-ethereum/crypto"
1011

1112
"github.com/ethereum/go-ethereum/accounts/abi"
1213
"github.com/ethereum/go-ethereum/common/hexutil"
@@ -111,6 +112,11 @@ var (
111112
ErrConfigOverrides = errorsmod.Register(ModuleName, codeErrConfigOverrides, "failed to apply state override")
112113
)
113114

115+
var (
116+
// RevertSelector is selector of ErrExecutionReverted
117+
RevertSelector = crypto.Keccak256([]byte("Error(string)"))[:4]
118+
)
119+
114120
// VMError is an interface that represents a reverted or failed EVM execution.
115121
// The Ret() method returns the revert reason bytes associated with the error, if any.
116122
// The Cause() method returns the unwrapped error. For ABCIInfo integration.
@@ -289,3 +295,19 @@ func (e *RevertError) ErrorCode() int {
289295
func (e *RevertError) ErrorData() interface{} {
290296
return e.reason
291297
}
298+
299+
// RevertReasonBytes converts a message to ABI-encoded revert bytes.
300+
func RevertReasonBytes(reason string) ([]byte, error) {
301+
typ, err := abi.NewType("string", "", nil)
302+
if err != nil {
303+
return nil, err
304+
}
305+
packed, err := (abi.Arguments{{Type: typ}}).Pack(reason)
306+
if err != nil {
307+
return nil, err
308+
}
309+
bz := make([]byte, 0, len(RevertSelector)+len(packed))
310+
bz = append(bz, RevertSelector...)
311+
bz = append(bz, packed...)
312+
return bz, nil
313+
}

chain/exchange/types/codec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
1818
cdc.RegisterConcrete(&MsgDeposit{}, "exchange/MsgDeposit", nil)
1919
cdc.RegisterConcrete(&MsgWithdraw{}, "exchange/MsgWithdraw", nil)
2020
cdc.RegisterConcrete(&MsgInstantSpotMarketLaunch{}, "exchange/MsgInstantSpotMarketLaunch", nil)
21+
cdc.RegisterConcrete(&MsgInstantPerpetualMarketLaunch{}, "exchange/MsgInstantPerpetualMarketLaunch", nil)
22+
cdc.RegisterConcrete(&MsgInstantExpiryFuturesMarketLaunch{}, "exchange/MsgInstantExpiryFuturesMarketLaunch", nil)
2123
cdc.RegisterConcrete(&MsgCreateSpotLimitOrder{}, "exchange/MsgCreateSpotLimitOrder", nil)
2224
cdc.RegisterConcrete(&MsgBatchCreateSpotLimitOrders{}, "exchange/MsgBatchCreateSpotLimitOrders", nil)
2325
cdc.RegisterConcrete(&MsgCreateSpotMarketOrder{}, "exchange/MsgCreateSpotMarketOrder", nil)
@@ -85,6 +87,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
8587
&MsgDeposit{},
8688
&MsgWithdraw{},
8789
&MsgInstantSpotMarketLaunch{},
90+
&MsgInstantPerpetualMarketLaunch{},
91+
&MsgInstantExpiryFuturesMarketLaunch{},
8892
&MsgCreateSpotLimitOrder{},
8993
&MsgBatchCreateSpotLimitOrders{},
9094
&MsgCreateSpotMarketOrder{},

0 commit comments

Comments
 (0)