Skip to content

Conversation

@jkilpatr
Copy link
Member

@jkilpatr jkilpatr commented Jan 20, 2026

Two things worth noting here

  1. for whatever reason all v0.10 of althea proto are yanked so I had to downgrade
  2. adding an into eth address is questionably a good idea as people may assume it works when it does not, for our usecase it will be quite nice.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates dependencies, adds quality-of-life features, and improves error handling by including transaction IDs in error cases. The changes facilitate better transaction tracking and debugging capabilities.

Changes:

  • Updated core dependencies (rand 0.9, secp256k1 0.31, rust_decimal 1.40, bytes 1.11) with corresponding API migrations
  • Added get_txhash utility function and TimeoutErrorSigned error variant to preserve transaction IDs in timeout scenarios
  • Introduced re_prefix method and EthAddress conversion traits for improved address manipulation
  • Applied various clippy fixes and code quality improvements

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
Cargo.toml Dependency version updates (rand, secp256k1, rust_decimal, bytes, actix-rt); downgrade of althea_proto
src/utils.rs Added get_txhash function for computing transaction hashes; updated error handling
src/private_key.rs Migrated to secp256k1 0.31 API (from_byte_array, from_digest); updated rand API usage
src/mnemonic/mod.rs Used is_multiple_of method for cleaner modulo checks; updated rand API
src/error.rs Added TimeoutErrorSigned variant and get_txid method for transaction ID retrieval
src/coin.rs Minor whitespace formatting
src/client/send.rs Enhanced timeout handling to preserve txid; removed unnecessary type cast; fixed documentation
src/client/gov/mod.rs Applied clippy fixes for shorthand field initialization
src/address.rs Added re_prefix method and EthAddress conversion trait implementations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

src/utils.rs Outdated
/// has some known error
pub fn check_for_sdk_error(input: &TxResponse) -> Result<(), CosmosGrpcError> {
// check for gas errors
// check for gas errors, in this case no txid is retured because the tx never made it to the mempool
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "retured" should be "returned".

Suggested change
// check for gas errors, in this case no txid is retured because the tx never made it to the mempool
// check for gas errors, in this case no txid is returned because the tx never made it to the mempool

Copilot uses AI. Check for mistakes.
@jkilpatr
Copy link
Member Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link

Copilot AI commented Jan 20, 2026

@jkilpatr I've opened a new pull request, #33, to work on those changes. Once the pull request is ready, I'll request review from you.

}
}

#[cfg(feature = "ethermint")]
Copy link
Contributor

@ChristianBorst ChristianBorst Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we even have this implemented if it's just going to use the default prefix? It seems like a footgun to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should probably just be a function with a prefix argument. Remembering to re-prefix when using it will be a pain.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

These conversions are useful, but should maybe be explicit functions
rather than implicit conversions so that we can educate the user as to
how it's a bad idea in some situations.
This is easiser to use than the change prefix function in some contexts
By adding a txid to some error cases we can allow the caller to follow
the signed transaction even if the intial publishing call fails or times
out.
The one thing of note here is that althea_proto was rolled back because
everything in the 10 series is currently yanked.
@jkilpatr jkilpatr force-pushed the jkilpatr/txid-returns branch 2 times, most recently from 1e68149 to 3532f7f Compare January 20, 2026 23:19
These types map to each other, but the type checker doesn't know that
and it's too much trouble to tell it that in generated proto code.
@jkilpatr jkilpatr force-pushed the jkilpatr/txid-returns branch from 3532f7f to a9beb2e Compare January 20, 2026 23:24
@jkilpatr jkilpatr merged commit 5a520f6 into master Jan 20, 2026
5 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.

3 participants