fix(syscoin): restore explorer UX after upstream merge#24
Conversation
Preserve Syscoin explorer surfaces on the upstream-latest base and keep shared templates guarded so non-Syscoin explorers continue to render correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fd730561e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </tr> | ||
| {{/* SYSCOIN: expose SPT transaction metadata on the full transaction page. */}} | ||
| {{if isSyscoinShortcut $data.CoinShortcut}} | ||
| {{if $tx.TokenType}} |
There was a problem hiding this comment.
Add backing Tx fields before rendering Syscoin tx pages
For SYS/TSYS this branch is evaluated on every Bitcoin-type transaction page, but api.Tx does not define TokenType or Memo (and the later rows also use non-existent AssetGuid fields on api.TokenTransfer). Go templates return an execution error for missing struct fields, so Syscoin transaction pages render only partially instead of showing the transaction.
Useful? React with 👍 / 👎.
| </tr> | ||
| {{/* SYSCOIN: show unconfirmed SPT balances on normal address pages. */}} | ||
| {{if isSyscoinShortcut .CoinShortcut}} | ||
| {{if $addr.TokensAsset}} |
There was a problem hiding this comment.
Add backing address asset fields before rendering them
On SYS/TSYS address pages this if tries to read TokensAsset from api.Address, but that struct has no such field (nor the related UsedAssetTokens used in xpub.html). The first Syscoin address render that reaches this block will hit a template execution error for the missing field and truncate the page instead of displaying address details.
Useful? React with 👍 / 👎.
| <div class="row mt-3"> | ||
| <div class="form-group col-md-6"> | ||
| <label for="maxfeerate">Max fee rate</label> | ||
| <input id="maxfeerate" class="form-control" name="maxfeerate" value="{{.SendTxMaxFeeRate}}" placeholder="Optional"> |
There was a problem hiding this comment.
Add sendtx fields before referencing them
For SYS/TSYS /sendtx, this input evaluates .SendTxMaxFeeRate, but TemplateData only contains SendTxHex and Status for this form and no SendTxMaxFeeRate/SendTxMaxBurnAmount fields. That makes the Syscoin send-transaction page fail during template execution before users can submit the form.
Useful? React with 👍 / 👎.
| </tr> | ||
| {{range $t := $addr.TokensAsset}} | ||
| <tr> | ||
| <td><a href="/asset/{{$t.AssetGuid}}" class="copyable">{{$t.AssetGuid}}</a></td> |
There was a problem hiding this comment.
Wire asset routes before linking to them
These new Syscoin asset links point at /asset/<guid>, but I searched server/ for assetTpl, explorerAsset, asset.html, and HandleFunc(...asset...) and found no route or template registration for the newly added asset.html/assets.html. Once the asset rows render, clicking any GUID falls through to the catch-all explorer handler instead of an asset detail page.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aa8a665b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| // SYSCOIN | ||
| func (s *PublicServer) formatContractExplorerURL(contract string) string { |
There was a problem hiding this comment.
Remove duplicated public template helpers
This method is already declared later in server/public.go, and this added block also repeats several existing helper declarations below it, so any build of the server package fails with duplicate-declaration errors before the explorer can start. Keep a single implementation instead of re-declaring these helpers here.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Test plan
make test BIN_IMAGE=blockbook-build-syscoin ARGS=\"-run Test_PublicServer_BitcoinType -count=1\"git diff --check && git diff --cached --checkMade with Cursor