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

Implement Serialize trait for Algorithm #7

Merged
merged 4 commits into from
Apr 18, 2024
Merged

Conversation

ChrisSchinnerl
Copy link
Member

@ChrisSchinnerl ChrisSchinnerl commented Apr 17, 2024

I thought about replacing the SiaEncodable with serde now that we have a serializer.

To avoid a huge PR I thought about doing it piece by piece and this is the first PR updating Algorithm and Address.

@ChrisSchinnerl ChrisSchinnerl marked this pull request as ready for review April 17, 2024 11:49
@n8maninger
Copy link
Member

n8maninger commented Apr 17, 2024

#[test]
fn test_json_serialize_algorithm() {
	assert_eq!(serde_json::to_string(&Algorithm::ED25519).unwrap(), "\"ed25519\"")
}

#[test]
fn test_json_serialize_address() {
	let address = Address::parse_string("addr:8fb49ccf17dfdcc9526dec6ee8a5cca20ff8247302053d3777410b9b0494ba8cdf32abee86f0").unwrap();
		
	assert_eq!(serde_json::to_string(&address).unwrap(), "\"addr:8fb49ccf17dfdcc9526dec6ee8a5cca20ff8247302053d3777410b9b0494ba8cdf32abee86f0\"")
}

@ChrisSchinnerl ChrisSchinnerl merged commit 29bc65e into master Apr 18, 2024
1 check passed
@ChrisSchinnerl ChrisSchinnerl deleted the chris/specifier branch April 18, 2024 13:36
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