+
Skip to content

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
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))

vmidyllic
vmidyllic previously approved these changes Dec 5, 2023
@vmidyllic vmidyllic merged commit f4fd2e6 into master Dec 12, 2023
@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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载