-
Notifications
You must be signed in to change notification settings - Fork 33
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
Custom registration #457
Custom registration #457
Conversation
did.go
Outdated
Blockchain Blockchain | ||
Network NetworkID | ||
NetworkFlag byte | ||
chainID *int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these fields private and pointers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case, it's ok to have chainID=0 when there's no chain linked. And methodByte must always be filled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's private field for params, because it is possible to set them in using Options. As we do in similar concept in other libraries. It could be another structure but I see no sense.
DID method is optional because it can be already be registered, no need to duplicate info in this case.
See example of using:
Method: core.DIDMethodIden3,
Blockchain: "linea",
Network: "testnet",
NetworkFlag: 0b0100_0000 | 0b0000001,
}
err = core.RegisterDIDMethodNetwork(params, core.WithChainID(59140))
did.go
Outdated
Blockchain Blockchain | ||
Network NetworkID | ||
NetworkFlag byte | ||
chainID *int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's private field for params, because it is possible to set them in using Options. As we do in similar concept in other libraries. It could be another structure but I see no sense.
DID method is optional because it can be already be registered, no need to duplicate info in this case.
See example of using:
Method: core.DIDMethodIden3,
Blockchain: "linea",
Network: "testnet",
NetworkFlag: 0b0100_0000 | 0b0000001,
}
err = core.RegisterDIDMethodNetwork(params, core.WithChainID(59140))
No description provided.