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

feat: extend NodeInfo and ProcessInfo #628

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

niklr
Copy link
Contributor

@niklr niklr commented Sep 21, 2022

What kind of change does this PR introduce? (check at least one)

  • Improvement
  • Bugfix
  • Feature
  • Refactor
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

Other information:
Solves #627

@niklr
Copy link
Contributor Author

niklr commented Sep 21, 2022

The address signature can be verified as follows:

func TestVerifyAddress(t *testing.T) {
	pub := "d7e63ddca1e41d311db9668bb0f6ff549cab9c24de03ecaa1643940a8fdc3937"
	address := "1.1.1.1"
	addressSignature := "0xa200e73f5f5a34ddefbf23349fea3fcee6c39f42404a37360339f69d18b71b59e08c34277b9638a5642683c5896d22ac0c6cc89d4734f712422eb5edcff6270c"
	P, _ := hex.DecodeString(pub)
	M := []byte(address)
	S, _ := hexutil.Decode(addressSignature)
	if !Verify(P, M, S) {
		t.Fatal("verify failed")
	}
	if err := VerifySig(P, M, S); err != nil {
		t.Fatal("verify sig failed")
	}
}

@niklr niklr requested a review from viteshan September 21, 2022 07:22
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.

1 participant