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

Custom registration #457

Merged
merged 10 commits into from
Dec 12, 2023
Merged

Custom registration #457

merged 10 commits into from
Dec 12, 2023

Conversation

Kolezhniuk
Copy link
Contributor

No description provided.

@Kolezhniuk Kolezhniuk marked this pull request as draft November 28, 2023 09:42
@Kolezhniuk Kolezhniuk marked this pull request as ready for review November 30, 2023 21:35
did.go Outdated Show resolved Hide resolved
did.go Outdated Show resolved Hide resolved
did.go Outdated Show resolved Hide resolved
did_test.go Outdated Show resolved Hide resolved
did.go Show resolved Hide resolved
did.go Outdated
Blockchain Blockchain
Network NetworkID
NetworkFlag byte
chainID *int
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor

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
Copy link
Contributor

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 Show resolved Hide resolved
vmidyllic
vmidyllic previously approved these changes Dec 5, 2023
chain.go Outdated Show resolved Hide resolved
did.go Outdated Show resolved Hide resolved
@vmidyllic vmidyllic merged commit f4fd2e6 into master Dec 12, 2023
6 checks passed
@vmidyllic vmidyllic deleted the feature/custom-registration branch December 12, 2023 12:16
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