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

Bugfix: Transactions signing #14

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Bugfix: Transactions signing #14

merged 1 commit into from
Oct 17, 2024

Conversation

dpajak99
Copy link
Collaborator

The previous transaction signing system used SIGN_MODE_AMINO_JSON, which is deprecated and no longer supported on the SEKAI side. This branch introduces a new way to sign transactions that use SIGN_MODE_DIRECT mode.

List of changes:

  • imported "cryptography_utils" package which contains crypto-algorithms required to build and sign Cosmos transactions
  • removed classes from "infra/dto/api_kira/broadcast/request/transaction/components" as they are included in the “cryptography_utils” package and are no longer needed on the miro side
  • modified classes from "infra/dto/shared/messages" to extend "ProtobufAny" class from "cryptography_utils" package and define protobuf serialization for Cosmos messages
  • replaced Uint8List private key in wallet.dart with ECPrivateKey from "cryptography_utils" package to simplify accessing private key for transaction signing
  • removed signature_utils.dart and sign() method from tx_utils.dart, as now signing functionality is handled by the external package
  • created new sign() method in unsigned_tx_model.dart, which calls proper signing method from "cryptography_utils" package
  • removed Wallet.fromKeyfileData() constructor from wallet.dart as it wasn't used anywhere but needed improvement after changes
  • adjusted tests and classes where updated classes were used

The previous transaction signing system used SIGN_MODE_AMINO_JSON, which is deprecated and no longer supported on the SEKAI side. This branch introduces a new way to sign transactions that use SIGN_MODE_DIRECT mode.

List of changes:
- imported "cryptography_utils" package which contains crypto-algorithms required to build and sign Cosmos transactions
- removed classes from "infra/dto/api_kira/broadcast/request/transaction/components" as they are included in the “cryptography_utils” package and are no longer needed on the miro side
- modified classes from "infra/dto/shared/messages" to extend "ProtobufAny" class from "cryptography_utils" package and define protobuf serialization for Cosmos messages
- replaced Uint8List private key in wallet.dart with ECPrivateKey from "cryptography_utils" package to simplify accessing private key for transaction signing
- removed signature_utils.dart and sign() method from tx_utils.dart, as now signing functionality is handled by the external package
- created new sign() method in unsigned_tx_model.dart, which calls proper signing method from "cryptography_utils" package
- removed Wallet.fromKeyfileData() constructor from wallet.dart as it wasn't used anywhere but needed improvement after changes
- adjusted tests and classes where updated classes were used
@kronikarz kronikarz merged commit 52ae6b9 into dev Oct 17, 2024
3 checks passed
@kronikarz kronikarz deleted the dp-bugfix/tx-signing branch October 17, 2024 08:30
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