Skip to content

fix(issue-competitions): SCALE-encode str args in _encode_args (#1375)#1544

Closed
rascalchow wants to merge 1 commit into
entrius:testfrom
rascalchow:fix/1375-register-issue-str-encoding
Closed

fix(issue-competitions): SCALE-encode str args in _encode_args (#1375)#1544
rascalchow wants to merge 1 commit into
entrius:testfrom
rascalchow:fix/1375-register-issue-str-encoding

Conversation

@rascalchow

Copy link
Copy Markdown

Summary

_encode_args had no str branch, so every register_issue call raised
ValueError: Unsupported type: str while encoding github_url — before
compose_call was reached. This adds SCALE str encoding (Vec: compact
length prefix + UTF-8) via a new _encode_compact_len helper.

Testing

  • Added regression tests for register_issue encoding + compact-length boundaries
  • pytest tests/validator/test_contract_client_transactions.py → 38 passed
  • ruff check / ruff format --check clean
  • Verified the issue's exact reproduction now encodes correctly

Fixes #1375

`register_issue` declares `github_url` and `repository_full_name` as `str`
in metadata.json, but `_encode_args` only handled u32/u64/u128/AccountId/
array32 and fell through to `raise ValueError('Unsupported type: str ...')`.
Every `register_issue` call failed during local argument encoding, before
`compose_call` was ever reached.

Add a `str` branch that SCALE-encodes strings as Vec<u8> (compact length
prefix + UTF-8 bytes), via a new `_encode_compact_len` helper covering the
single/two/four-byte compact modes. Adds regression tests for the
register_issue encoding and the compact-length boundaries.

Fixes entrius#1375
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 25, 2026
@rascalchow rascalchow closed this Jun 25, 2026
@rascalchow rascalchow reopened this Jun 25, 2026
@anderdc

anderdc commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Clear PR duplication detected. @rascalchow has been added to the watchlist — further duplicate or low-effort PRs will lean toward close-on-sight until sustained legitimate activity. Closing.

@anderdc anderdc closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] gitt issues register cannot encode register_issue string arguments after #1335

2 participants