Skip to content

Commit

Permalink
emit res
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 18, 2023
1 parent 4a2783e commit fb417b4
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 45 deletions.
1 change: 1 addition & 0 deletions nix/gen-binding-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ in
pkgs.mkShell {
buildInputs = [
pkgs.go-ethereum
(renameExe pkgs.solc-static-versions.solc_0_6_8 "solc-0.6.8" "solc06")
(renameExe pkgs.solc-static-versions.solc_0_8_21 "solc-0.8.21" "solc08")
];
}
2 changes: 1 addition & 1 deletion scripts/gen-bindings-contracts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

solc08 --abi --bin x/cronos/events/bindings/src/CosmosTypes.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/Relayer.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/ICA.sol -o build --overwrite
solc06 --abi --bin x/cronos/events/bindings/src/ICA.sol -o build --overwrite


abigen --pkg lib --abi build/CosmosTypes.abi --bin build/CosmosTypes.bin --out x/cronos/events/bindings/cosmos/lib/cosmos_types.abigen.go --type CosmosTypes
Expand Down
195 changes: 160 additions & 35 deletions x/cronos/events/bindings/cosmos/precompile/ica/i_ica_module.abigen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions x/cronos/events/bindings/src/ICA.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma solidity ^0.6.6;

interface IICAModule {
// ICS27 Interchain Accounts events
event Ics27Packet(string indexed controllerChannelId);
event RegisterAccountResult(string channelId, string portId);
event SubmitMsgsResult(string seq);
}
9 changes: 8 additions & 1 deletion x/cronos/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
ibctypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
ica "github.com/crypto-org-chain/cronos/v2/x/cronos/events/bindings/cosmos/precompile/ica"
relayer "github.com/crypto-org-chain/cronos/v2/x/cronos/events/bindings/cosmos/precompile/relayer"
cronoseventstypes "github.com/crypto-org-chain/cronos/v2/x/cronos/events/types"
"github.com/ethereum/go-ethereum/accounts/abi"
ethtypes "github.com/ethereum/go-ethereum/core/types"
)
Expand All @@ -24,6 +26,11 @@ var (
banktypes.AttributeKeyMinter: ConvertAccAddressFromBech32,
banktypes.AttributeKeyBurner: ConvertAccAddressFromBech32,
}
IcaValueDecoders = ValueDecoders{
channeltypes.AttributeKeyChannelID: ReturnStringAsIs,
channeltypes.AttributeKeyPortID: ReturnStringAsIs,
cronoseventstypes.AttributeKeySeq: ReturnStringAsIs,
}
)

func init() {
Expand Down Expand Up @@ -59,5 +66,5 @@ func IcaConvertEvent(event sdk.Event) (*ethtypes.Log, error) {
if !ok {
return nil, nil
}
return desc.ConvertEvent(event.Attributes, ValueDecoders{})
return desc.ConvertEvent(event.Attributes, IcaValueDecoders)
}
7 changes: 7 additions & 0 deletions x/cronos/events/types/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package types

const (
EventTypeRegisterAccountResult = "register_account_result"
EventTypeSubmitMsgsResult = "submit_msgs_result"
AttributeKeySeq = "seq"
)
Loading

0 comments on commit fb417b4

Please sign in to comment.