Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add P-Chain ConstructionHash support #1

Open
wants to merge 7 commits into
base: ytu/addr
Choose a base branch
from

Conversation

simonzxw777-cb
Copy link

@simonzxw777-cb simonzxw777-cb commented Jun 6, 2022

What is PR about?

  1. Add P-Chain support for Hash function (ConstructionHash) in service_construction.go .
  2. Add unit test for P-chain Hash support.
  3. Add CChainNetWorkIdentifier to distinguished sub chain.

How did it test?

  1. Firstly, using platform.getTx api to get a random transaction that exists in the testnet. Here is example:

$ curl -X POST --data '{ 0s
"jsonrpc": "2.0",
"method": "platform.getTx",
"params": {
"txID":"etWqwTN1YwhakxLnMDp7q6yaf4m7VJu4uB4vC4fEtNrFe9sDy",
"encoding": "hex"
},
"id": 1
}' -H 'content-type:application/json;' XXXXXXXX/ext/bc/P

Return:

{"jsonrpc":"2.0","result":{"tx":"0x00000000000e000000050000000000000000000000000000000000000000000000000000000000000000000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000007000000003b8724b400000000000000000000000100000001790b9fc4f62b8eb2d2cf0177bda1ecc882a2d19e000000018be2098b614618321c855b6c7ca1cce33006902727d2a05f3ae7d5b18c14e24f000000003d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000005000000007721eeb4000000010000000000000000d325c150d0fec89b706ab5fd75ae7506a9912a9e00000000629a465500000000629b97d5000000003b9aca00000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000007000000003b9aca0000000000000000000000000100000001790b9fc4f62b8eb2d2cf0177bda1ecc882a2d19e0000000b00000000000000000000000100000001e35e8550c1f09e1d3f6b97292eed8a1a76dcdd8a000000010000000900000001ebd189ad5e808ac24b69d8548980759067ce3b8b8caf9ece3ce3d032c5ec433d59e3767ffbbb2f9940894dd2eb96e6f93942b5535137a46097d124571b8dcf5700f323bc66","encoding":"hex"},"id":1}

  1. We want to transfer tx in the return result to txID in the call command. Writing unit test to verify it.
  2. Note that we still need to make sure the format of input transaction.

@xiaoxiaff xiaoxiaff force-pushed the ytu/addr branch 3 times, most recently from c76c081 to 48b596a Compare June 10, 2022 18:52
xiaoxiaff pushed a commit that referenced this pull request Aug 1, 2022
Add P-Chain Support for Combine TX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants