Genesis address format - change address type from byte slice to string#173
Conversation
|
Please check whether this also needs to change: api/proto/spacemesh/v1/tx_types.proto Lines 61 to 62 in 63f4615 |
cd8a4ad to
f896c52
Compare
|
These are also addresses: api/proto/spacemesh/v1/types.proto Lines 48 to 49 in f896c52 Please check for others |
| bytes principal = 2; | ||
| bytes template = 3; | ||
| AccountId principal = 2; | ||
| AccountId template = 3; |
There was a problem hiding this comment.
i don't know if template should have an hrp. this seems a bit weird. @lrettig what do you think?
There was a problem hiding this comment.
It should. It's a domain-specific thing -- the same address (i.e., bytestr) can exist on many networks, but a template may only be deployed on one, and the HRP specifies the domain.
There was a problem hiding this comment.
I think we can make it optional for both principal and template since HRP is already implied by GENESISID, which the tx is bound to (spacemeshos/pm#135)
## Motivation <!-- Please mention the issue fixed by this PR or detailed motivation --> Closes #3315 <!-- `Closes #XXXX, closes #XXXX, ...` links mentioned issues to this PR and automatically closes them when this it's merged --> ## Changes * address moved to separate pkg. probably in future will be as independent library * address still array of bytes ([24]byte), but implement `bech32` algorithm. Additional first byte reserved for contain HumanReadablePart of address (now contain info about networkID - test|main net), so result is [25]byte * all api endpoints will be changed to use string instead []byte (related pr spacemeshos/api#173) ## Test Plan unit tests ## TODO <!-- This section should be removed when all items are complete --> - [ ] Explain motivation or link existing issue(s) - [ ] Test changes and document test plan - [ ] Update documentation as needed ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [ ] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [ ] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
what changed
changed all address fields from []byte to bech32 string
smt1ru1241...See spacemeshos/go-spacemesh#3315
Closes #172