Skip to content
Snippets Groups Projects

Draft: Resolve "Error: Base 58 requirement is violated"

Open Nicolas80 requested to merge 48-error-base-58-requirement-is-violated into master
  1. Mar 26, 2025
    • Nicolas80's avatar
      * Added `debug!` log inside `impl From<DbAccountId> for Value` used to... · 5924a73e
      Nicolas80 authored
      * Added `debug!` log inside `impl From<DbAccountId> for Value` used to serialize DbAccountId into the String value for the db
      ** Can be seen when adding `RUST_LOG=debug ` before the `gcli` command
      * Small fix for clippy remark
      5924a73e
    • Nicolas80's avatar
      * Kind of ugly; but needed to adapt fn find_direct_children_accounts to also... · 2cd0a861
      Nicolas80 authored
      * Kind of ugly; but needed to adapt fn find_direct_children_accounts to also match lines that have extra double quotes inside the parent column
      ** For that; since it seems sea-orm does the `eq` part on string values; the only way I could find is to allow any of those checks
      *** original "parent" eq address as DbAccountId (sea-orm converts address' DbAccountId to a clean string that doesn't have the extra double quotes)
      *** extra "parent" eq `format!("\"{}\"",current_account.address.to_string())` for the cases where the DB got incorrect values
      2cd0a861
    • Nicolas80's avatar
      * Adapted `impl FromStr for DbAccountId` so that it is the only one that does... · 54e82c1b
      Nicolas80 authored
      * Adapted `impl FromStr for DbAccountId` so that it is the only one that does the conversion from &str to DbAccountId
      ** It provides error with the "raw" string that couldn't be parsed
      ** All other methods use that one now
      ** In order to be able to resolve the issue from !48; we now remove any surrounding double quotes from the string (if present) before parsing into a DbAccountId
      * Replaced `impl From<String> for DbAccountId` with `impl TryFrom<String> for DbAccountId` and adapted the code to use it.
      * Made sure `impl sea_orm::TryGetable for DbAccountId` also use the correct `DbAccountId::from_str` that will now provide the detailed error message
      54e82c1b
  2. Mar 11, 2025
Loading