Skip to content

feat: extend NodeInfo and ProcessInfo#628

Open
niklr wants to merge 1 commit into
vitelabs:masterfrom
niklr:issues/627
Open

feat: extend NodeInfo and ProcessInfo#628
niklr wants to merge 1 commit into
vitelabs:masterfrom
niklr:issues/627

Conversation

@niklr

@niklr niklr commented Sep 21, 2022

Copy link
Copy Markdown
Contributor

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

niklr commented Sep 21, 2022

Copy link
Copy Markdown
Contributor Author

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