Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: no log converted from native event #1159

Merged
merged 27 commits into from
Sep 13, 2023

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Sep 11, 2023

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

x/cronos/keeper/precompiles/factory.go Fixed Show fixed Hide fixed
x/cronos/keeper/precompiles/relayer.go Fixed Show fixed Hide fixed
x/cronos/keeper/precompiles/relayer.go Fixed Show fixed Hide fixed
x/cronos/keeper/precompiles/relayer.go Fixed Show fixed Hide fixed
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #1159 (42e3d62) into main (fe009bd) will decrease coverage by 12.63%.
The diff coverage is 11.23%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1159       +/-   ##
===========================================
- Coverage   46.20%   33.57%   -12.63%     
===========================================
  Files         108      113        +5     
  Lines        7975    11064     +3089     
===========================================
+ Hits         3685     3715       +30     
- Misses       3923     6980     +3057     
- Partials      367      369        +2     
Files Changed Coverage Δ
.../events/bindings/cosmos/lib/cosmos_types.abigen.go 0.00% <0.00%> (ø)
...smos/precompile/relayer/i_relayer_module.abigen.go 0.00% <ø> (ø)
x/cronos/events/decoders.go 0.00% <0.00%> (ø)
x/cronos/keeper/precompiles/relayer.go 9.37% <0.00%> (-0.15%) ⬇️
x/cronos/keeper/precompiles/utils.go 0.00% <0.00%> (ø)
x/cronos/rpc/api.go 0.35% <0.00%> (ø)
x/cronos/events/events.go 21.42% <21.42%> (ø)
x/cronos/events/event.go 35.52% <35.52%> (ø)

@mmsqe mmsqe marked this pull request as ready for review September 12, 2023 01:11
@mmsqe mmsqe requested a review from a team as a code owner September 12, 2023 01:11
@mmsqe mmsqe requested review from leejw51crypto and thomas-nguy and removed request for a team September 12, 2023 01:11
x/cronos/events/descriptor.go Fixed Show fixed Hide fixed
case strings.HasPrefix(addrString, cfg.GetBech32ValidatorAddrPrefix()):
addr, _ = sdk.ValAddressFromBech32(addrString)
case strings.HasPrefix(addrString, cfg.GetBech32AccountAddrPrefix()):
addr, _ = sdk.AccAddressFromBech32(addrString)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack. Warning

Returned error is not propagated up the stack.
case common.IsHexAddress(addrString):
addr = common.HexToAddress(addrString).Bytes()
case strings.HasPrefix(addrString, cfg.GetBech32ValidatorAddrPrefix()):
addr, _ = sdk.ValAddressFromBech32(addrString)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack. Warning

Returned error is not propagated up the stack.
Comment on lines +25 to +33
for _, event := range a.Events {
event_type := toUnderScore(event.Name)
descriptors[event_type] = &EventDescriptor{
id: event.ID,
indexed: getArguments(event.Inputs, true),
nonIndexed: getArguments(event.Inputs, false),
packValues: event.Inputs.NonIndexed().PackValues,
}
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
Comment on lines +25 to +33
for _, event := range a.Events {
event_type := toUnderScore(event.Name)
descriptors[event_type] = &EventDescriptor{
id: event.ID,
indexed: getArguments(event.Inputs, true),
nonIndexed: getArguments(event.Inputs, false),
packValues: event.Inputs.NonIndexed().PackValues,
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
x/cronos/events/event.go Outdated Show resolved Hide resolved
x/cronos/events/event.go Outdated Show resolved Hide resolved
nix/gen-binding-shell.nix Outdated Show resolved Hide resolved
nix/gen-binding-shell.nix Outdated Show resolved Hide resolved
@@ -180,7 +180,7 @@
return nil, err
}

logs, err := backend.TxLogsFromEvents(txResult.Events, parsedTx.MsgIndex)
logs, err := evmtypes.DecodeMsgLogsFromEvents(txResult.Data, parsedTx.MsgIndex, uint64(blockRes.Height))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
@mmsqe mmsqe added this pull request to the merge queue Sep 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 13, 2023
@mmsqe mmsqe added this pull request to the merge queue Sep 13, 2023
Merged via the queue into crypto-org-chain:main with commit 4f11310 Sep 13, 2023
29 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants