Skip to content

Commit

Permalink
[pick #18710][Disassembler] Fix string contraction logic (#18713)
Browse files Browse the repository at this point in the history
## Description

Always pick whole UTF8 characters.

## Test plan

Tested against a package containing a UTF8 constant.

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [x] Nodes (Validators and Full nodes): Bugfix for fetching package
information over JSONRPC from fullnodes, where a package containing UTF8
string constants could fail to disassemble.
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
amnn authored and ebmifa committed Jul 18, 2024
1 parent 1a04d5e commit fc06239
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ impl<'a> Disassembler<'a> {
if s.len() <= PREVIEW_LEN + 2 {
s.to_string()
} else {
format!("{}..", &s[..PREVIEW_LEN])
let mut preview: String = s.chars().take(PREVIEW_LEN).collect();
preview.push_str("..");
preview
}
}

Expand Down

0 comments on commit fc06239

Please sign in to comment.