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

refactor: public key aggregate #576

Merged
merged 3 commits into from
Jul 5, 2023
Merged

Conversation

RiXelanya
Copy link
Contributor

@RiXelanya RiXelanya commented Jul 5, 2023

Description

Extract Public Key aggregate function from the VerifyAggregated function. Write some tests. There is still a problem

func TestPublicKeyAggregate(t *testing.T) {
	pub1, _ := bls.PublicKeyFromString(
		public key string 1)
	pub2, _ := bls.PublicKeyFromString(
		public key string 2)
	agg, _ := bls.PublicKeyFromString(
		aggregated public key)
	assert.True(t, bls.PublicKeyAggregate([]*bls.PublicKey{pub1, pub2}).EqualsTo(agg))
	assert.False(t, pub1.EqualsTo(pub2))
}

I dont know how to generate the public key and aggregated public key string value to be used as examples in this test

@RiXelanya RiXelanya changed the title refactor:public key aggregate refactor: public key aggregate Jul 5, 2023
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #576 (3efcabd) into main (a967da4) will increase coverage by 0.03%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #576      +/-   ##
==========================================
+ Coverage   83.50%   83.53%   +0.03%     
==========================================
  Files         154      154              
  Lines        7250     7252       +2     
==========================================
+ Hits         6054     6058       +4     
+ Misses        916      915       -1     
+ Partials      280      279       -1     

@b00f b00f merged commit 81ab46e into pactus-project:main Jul 5, 2023
@b00f
Copy link
Collaborator

b00f commented Jul 5, 2023

@RiXelanya Thanks. I just changed "refactor" to "fix" for a more accurate change log.

@RiXelanya
Copy link
Contributor Author

RiXelanya commented Jul 5, 2023

Do you have any recommendation for tools to generate BLS Key string? I still have a problem in writing test as I have described in the initial post. I still dont know tools to generate BLS public key string and the G2 addition @b00f

@b00f
Copy link
Collaborator

b00f commented Jul 5, 2023

Do you have any recommendation for tools to generate BLS Key string?

You can simply use fmt.Println(pub.String()).

I have plans to revise these tests again because they are very important. Specifically, we need to write test for the infinity public key.

--
Update:

I always test this part manually and with logs. I've never tried to check if there are any tools. I searched on Github, but unfortunately, I couldn't find any tools there that could help us. Let me know if you find something.

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.

2 participants