-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: receipt indexing to include contract address if that is creation (…
…#38) * fix receipt indexing to include contract address if that is creation * add base fee to block header
- Loading branch information
Showing
12 changed files
with
353 additions
and
119 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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package indexer | ||
|
||
import ( | ||
"testing" | ||
|
||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/gogoproto/proto" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/initia-labs/minievm/x/evm/types" | ||
) | ||
|
||
func Test_UnpackData(t *testing.T) { | ||
resp := types.MsgCreateResponse{ | ||
Result: "ret", | ||
ContractAddr: types.StdAddress.Hex(), | ||
Logs: []types.Log{ | ||
{ | ||
Address: types.StdAddress.Hex(), | ||
Topics: []string{"topic"}, | ||
Data: "data", | ||
}, | ||
}, | ||
} | ||
|
||
anyResp, err := codectypes.NewAnyWithValue(&resp) | ||
require.NoError(t, err) | ||
|
||
data, err := proto.Marshal(&sdk.TxMsgData{MsgResponses: []*codectypes.Any{anyResp}}) | ||
require.NoError(t, err) | ||
|
||
var respOut types.MsgCreateResponse | ||
err = unpackData(data, &respOut) | ||
require.NoError(t, err) | ||
require.Equal(t, resp, respOut) | ||
} |
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
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
Oops, something went wrong.