-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* revert: cosmos submodule only (#362) * revert: cosmos submodule only * fix: rem * fix: rem * fix: update * feat: add msg client * fix: paths * fix: try chaosnet ibc * fix: path again * fix: try hm * fix: fixes to pass
- Loading branch information
Showing
24 changed files
with
428 additions
and
606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nibiru
updated
31 files
+4 −1 | CHANGELOG.md | |
+12 −9 | CHAOSNET.md | |
+4 −2 | app/evmante_sigverify_test.go | |
+0 −1 | app/evmante_validate_basic_test.go | |
+6 −1 | app/keepers.go | |
+42 −25 | contrib/docker-compose/README.md | |
+11 −32 | contrib/docker-compose/docker-compose-chaosnet.yml | |
+0 −64 | contrib/docker-compose/docker-compose-multi-node.yml | |
+21 −9 | contrib/make/chaosnet.mk | |
+1 −0 | contrib/scripts/chaosnet.sh | |
+3 −4 | e2e/evm/test/contract_send_nibi.test.ts | |
+128 −0 | eth/hex.go | |
+272 −0 | eth/hex_test.go | |
+6 −6 | eth/state_encoder.go | |
+1 −1 | go.mod | |
+2 −2 | go.sum | |
+9 −36 | gosdk/keys.go | |
+7 −4 | gosdk/keys_test.go | |
+20 −0 | proto/eth/evm/v1/evm.proto | |
+4 −0 | proto/eth/evm/v1/genesis.proto | |
+1 −0 | x/evm/access_list_test.go | |
+7 −0 | x/evm/const.go | |
+7 −11 | x/evm/events.go | |
+57 −0 | x/evm/evm.go | |
+347 −74 | x/evm/evm.pb.go | |
+112 −0 | x/evm/evm_test.go | |
+85 −20 | x/evm/genesis.pb.go | |
+1 −1 | x/evm/keeper/evm_state.go | |
+89 −0 | x/evm/keeper/funtoken_state.go | |
+7 −0 | x/evm/keeper/keeper.go | |
+0 −58 | x/evm/query_test.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,49 @@ | ||
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing" | ||
import { createProtobufRpcClient, QueryClient } from "@cosmjs/stargate" | ||
import { | ||
MsgCancelFeeShare, | ||
MsgCancelFeeShareResponse, | ||
MsgClientImpl, | ||
MsgRegisterFeeShare, | ||
MsgRegisterFeeShareResponse, | ||
MsgUpdateFeeShare, | ||
MsgUpdateFeeShareResponse, | ||
MsgUpdateParams, | ||
MsgUpdateParamsResponse, | ||
} from "../../protojs/nibiru/devgas/v1/tx" | ||
import { TxMessage } from ".." | ||
|
||
const protobufPackage = "nibiru.devgas.v1" | ||
|
||
export const DEVGAS_MSG_TYPE_URLS = { | ||
MsgCancelFeeShare: `/${protobufPackage}.MsgCancelFeeShare`, | ||
MsgRegisterFeeShare: `/${protobufPackage}.MsgRegisterFeeShare`, | ||
MsgUpdateFeeShare: `/${protobufPackage}.MsgUpdateFeeShare`, | ||
MsgUpdateParams: `/${protobufPackage}.MsgUpdateParams`, | ||
export interface DevgasMsgExtension { | ||
readonly devgasMsg: Readonly<{ | ||
registerFeeShare: ( | ||
body: MsgRegisterFeeShare | ||
) => Promise<MsgRegisterFeeShareResponse> | ||
updateFeeShare: ( | ||
body: MsgUpdateFeeShare | ||
) => Promise<MsgUpdateFeeShareResponse> | ||
cancelFeeShare: ( | ||
body: MsgCancelFeeShare | ||
) => Promise<MsgCancelFeeShareResponse> | ||
updateParams: (body: MsgUpdateParams) => Promise<MsgUpdateParamsResponse> | ||
}> | ||
} | ||
|
||
export const devgasTypes: ReadonlyArray<[string, GeneratedType]> = [ | ||
[DEVGAS_MSG_TYPE_URLS.MsgCancelFeeShare, MsgCancelFeeShare], | ||
[DEVGAS_MSG_TYPE_URLS.MsgRegisterFeeShare, MsgRegisterFeeShare], | ||
[DEVGAS_MSG_TYPE_URLS.MsgUpdateFeeShare, MsgUpdateFeeShare], | ||
[DEVGAS_MSG_TYPE_URLS.MsgUpdateParams, MsgUpdateParams], | ||
] | ||
|
||
export interface MsgCancelFeeShareEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgCancelFeeShare> | ||
} | ||
export const setupDevgasMsgExtension = ( | ||
base: QueryClient | ||
): DevgasMsgExtension => { | ||
const queryService = new MsgClientImpl(createProtobufRpcClient(base)) | ||
|
||
export const isMsgCancelFeeShareEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgCancelFeeShare | ||
|
||
export interface MsgRegisterFeeShareEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgRegisterFeeShare> | ||
} | ||
return { | ||
devgasMsg: { | ||
registerFeeShare: async (body: MsgRegisterFeeShare) => | ||
queryService.RegisterFeeShare(MsgRegisterFeeShare.fromPartial(body)), | ||
|
||
export const isMsgRegisterFeeShareEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgRegisterFeeShare | ||
updateFeeShare: async (body: MsgUpdateFeeShare) => | ||
queryService.UpdateFeeShare(MsgUpdateFeeShare.fromPartial(body)), | ||
|
||
export interface MsgUpdateFeeShareEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgUpdateFeeShare> | ||
} | ||
|
||
export const isMsgUpdateFeeShareEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgUpdateFeeShare | ||
|
||
export interface MsgUpdateParamsEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgUpdateParams> | ||
} | ||
|
||
export const isMsgUpdateParamsEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgUpdateParams | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
export class DevgasMsgFactory { | ||
static cancelFeeShare(msg: MsgCancelFeeShare): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgCancelFeeShare`, | ||
value: MsgCancelFeeShare.fromPartial(msg), | ||
} | ||
} | ||
|
||
static registerFeeShare(msg: MsgRegisterFeeShare): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgRegisterFeeShare`, | ||
value: MsgRegisterFeeShare.fromPartial(msg), | ||
} | ||
} | ||
|
||
static MsgUpdateFeeShare(msg: MsgUpdateFeeShare): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgUpdateFeeShare`, | ||
value: MsgUpdateFeeShare.fromPartial(msg), | ||
} | ||
} | ||
cancelFeeShare: async (body: MsgCancelFeeShare) => | ||
queryService.CancelFeeShare(MsgCancelFeeShare.fromPartial(body)), | ||
|
||
static updateParams(msg: MsgUpdateParams): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgUpdateParams`, | ||
value: MsgUpdateParams.fromPartial(msg), | ||
} | ||
updateParams: async (body: MsgUpdateParams) => | ||
queryService.UpdateParams(MsgUpdateParams.fromPartial(body)), | ||
}, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,37 @@ | ||
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing" | ||
import { createProtobufRpcClient, QueryClient } from "@cosmjs/stargate" | ||
import { | ||
MsgClientImpl, | ||
MsgEditInflationParams, | ||
MsgEditInflationParamsResponse, | ||
MsgToggleInflation, | ||
MsgToggleInflationResponse, | ||
} from "../../protojs/nibiru/inflation/v1/tx" | ||
import { TxMessage } from ".." | ||
|
||
const protobufPackage = "nibiru.inflation.v1" | ||
|
||
export const INFLATION_MSG_TYPE_URLS = { | ||
MsgEditInflationParams: `/${protobufPackage}.MsgEditInflationParams`, | ||
MsgToggleInflation: `/${protobufPackage}.MsgToggleInflation`, | ||
} | ||
|
||
export const inflationTypes: ReadonlyArray<[string, GeneratedType]> = [ | ||
[INFLATION_MSG_TYPE_URLS.MsgEditInflationParams, MsgEditInflationParams], | ||
[INFLATION_MSG_TYPE_URLS.MsgToggleInflation, MsgToggleInflation], | ||
] | ||
|
||
export interface MsgEditInflationParamsEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgEditInflationParams> | ||
export interface InflationMsgExtension { | ||
readonly inflationMsg: Readonly<{ | ||
toggleInflation: ( | ||
body: MsgToggleInflation | ||
) => Promise<MsgToggleInflationResponse> | ||
editInflationParams: ( | ||
body: MsgEditInflationParams | ||
) => Promise<MsgEditInflationParamsResponse> | ||
}> | ||
} | ||
|
||
export const isMsgEditInflationParamsEncodeObject = ( | ||
encodeObject: EncodeObject | ||
) => encodeObject.typeUrl === INFLATION_MSG_TYPE_URLS.MsgEditInflationParams | ||
|
||
export interface MsgToggleInflationEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgToggleInflation> | ||
} | ||
|
||
export const isMsgToggleInflationEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === INFLATION_MSG_TYPE_URLS.MsgToggleInflation | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
export class InflationMsgFactory { | ||
static editInflationParams(msg: MsgEditInflationParams): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgEditInflationParams`, | ||
value: MsgEditInflationParams.fromPartial(msg), | ||
} | ||
} | ||
|
||
static toggleInflation(msg: MsgToggleInflation): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgToggleInflation`, | ||
value: MsgToggleInflation.fromPartial(msg), | ||
} | ||
export const setupInflationMsgExtension = ( | ||
base: QueryClient | ||
): InflationMsgExtension => { | ||
const queryService = new MsgClientImpl(createProtobufRpcClient(base)) | ||
|
||
return { | ||
inflationMsg: { | ||
toggleInflation: async (body: MsgToggleInflation) => | ||
queryService.ToggleInflation(MsgToggleInflation.fromPartial(body)), | ||
|
||
editInflationParams: async (body: MsgEditInflationParams) => | ||
queryService.EditInflationParams( | ||
MsgEditInflationParams.fromPartial(body) | ||
), | ||
}, | ||
} | ||
} |
Oops, something went wrong.
7e513c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.