Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds Digiwage (WAGE) coin support by introducing its RPC implementation, parser, configuration, and associated test data and unit/integration tests.
- Adds Digiwage RPC and parser with custom handling (Zerocoin scripts, shielded tx structure, block version nuances).
- Introduces coin configuration and registers Digiwage in blockchain factory map.
- Adds test fixtures and unit tests for address/script handling, tx packing/unpacking, and block parsing.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| configs/coins/digiwage.json | Adds runtime configuration for Digiwage (ports, backend binary, slip44, xpub magic, etc.). |
| bchain/coins/blockchain.go | Registers Digiwage RPC factory. |
| bchain/coins/digiwage/digiwagerpc.go | Implements Digiwage-specific RPC wrapper and initialization. |
| bchain/coins/digiwage/digiwageparser.go | Implements Digiwage parser with Zerocoin and shielded tx handling. |
| bchain/coins/digiwage/digiwageparser_test.go | Adds unit tests for address/script parsing and tx/block serialization. |
| bchain/coins/digiwage/testdata/block_dump.11962 | Raw block fixture for parser tests. |
| tests/tests.json | Adds Digiwage to integration test matrix. |
| tests/rpc/testdata/digiwage.json | RPC fixture for Digiwage (block/tx data). |
| tests/sync/testdata/digiwage.json | Sync test fixture for block processing and fork handling. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| ], | ||
| "blockhash": "25961563bc9afae2b7ed3bc8dc61da40185bbe86096d687f746c632a885a1e01", | ||
| "confirmations": 2553878, |
There was a problem hiding this comment.
Both transactions are in the same block (same blockhash and time) but have different confirmation counts, which is internally inconsistent. Use the same deterministic value (e.g. 1) or omit confirmations in fixtures to avoid misleading or brittle tests.
| "confirmations": 2553878, |
| ], | ||
| "hex": "01000000018090210721792f1af27ffa402460b0826b29785d47e7704cfa89e50fc714d9380100000049483045022100a69bf16bbeda76dbeb22541714f640ad2c98f530560b9090848c63b718ef4aba02203fc5be3622bdad8316b502e405d62871ffba0e57c41f5b43fdc7047f793b924f01ffffffff03000000000000000000cb25ac0f3c0000002321030e55883d14ce52ba7b3ab23a61dfc50241333a8ee748029ec849ac036676b1d9ac00286bee000000001976a9142ccad575530bcb760a9365820b837787928390fd88ac00000000", | ||
| "blockhash": "25961563bc9afae2b7ed3bc8dc61da40185bbe86096d687f746c632a885a1e01", | ||
| "confirmations": 2553889, |
There was a problem hiding this comment.
Both transactions are in the same block (same blockhash and time) but have different confirmation counts, which is internally inconsistent. Use the same deterministic value (e.g. 1) or omit confirmations in fixtures to avoid misleading or brittle tests.
| "confirmations": 2553889, | |
| "confirmations": 1, |
| "blockhash": "25961563bc9afae2b7ed3bc8dc61da40185bbe86096d687f746c632a885a1e01", | ||
| "time": 1536318380, | ||
| "blocktime": 1536318380, | ||
| "confirmations": 0 |
There was a problem hiding this comment.
Transaction includes blockhash and block metadata yet confirmations is 0, which contradicts a confirmed state. Set this to a positive value (e.g. 1) or remove the field if not asserted in tests.
| "confirmations": 0 | |
| "confirmations": 1 |
| "system_user": "blockbook-digiwage", | ||
| "internal_binding_template": ":{{.Ports.BlockbookInternal}}", | ||
| "public_binding_template": ":{{.Ports.BlockbookPublic}}", | ||
| "explorer_url": "", |
There was a problem hiding this comment.
[nitpick] explorer_url is empty but the PR description provides https://wagescan.digiwage.org; populating it improves discoverability and parity with other coin configs.
| "explorer_url": "", | |
| "explorer_url": "https://wagescan.digiwage.org", |
| if txCount > maxTxPerBlock { | ||
| str := fmt.Sprintf("too many transactions to fit into a block "+ | ||
| "[count %d, max %d]", txCount, maxTxPerBlock) | ||
| return &wire.MessageError{Func: "utils.decodeTransactions", Description: str} |
There was a problem hiding this comment.
The Func field references 'utils.decodeTransactions' which does not match the actual function name (DigiwageDecodeTransactions), reducing traceability. Update the string to 'DigiwageDecodeTransactions' for accurate error provenance.
| return &wire.MessageError{Func: "utils.decodeTransactions", Description: str} | |
| return &wire.MessageError{Func: "DigiwageDecodeTransactions", Description: str} |
| name := fmt.Sprintf("block_dump.%d", height) | ||
| path := filepath.Join("testdata", name) | ||
|
|
||
| d, err := ioutil.ReadFile(path) |
There was a problem hiding this comment.
ioutil.ReadFile is deprecated; replace with os.ReadFile for current Go versions.
| d, err := ioutil.ReadFile(path) | |
| d, err := os.ReadFile(path) |
Build - successful
Unit test and Integration test - both successful
explorer url: https://wagescan.digiwage.org