Skip to content

Commit 15ccdf4

Browse files
authored
chore: add DataHasher alias of LightHasher (#1801)
* chore: add DataHasher alias of LightHasher * chore: replace groth16 solana github dep with release 0.2.0
1 parent 4dae0f2 commit 15ccdf4

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Cargo.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ light-poseidon = { version = "0.3.0" }
194194
light-test-utils = { path = "program-tests/utils", version = "1.2.1" }
195195
light-indexed-array = { path = "program-libs/indexed-array", version = "0.1.0" }
196196
create-address-program-test = { path = "program-tests/create-address-test-program", version = "1.0.0" }
197-
groth16-solana = { version = "0.1.0", git = "https://github.com/lightprotocol/groth16-solana.git", rev = "a18e0f4d3be6c24214fd293e2e7a998b160cda9b" }
197+
groth16-solana = { version = "0.2.0" }
198198
bytemuck = { version = "1.19.0" }
199199
arrayvec = "0.7"
200200

sdk-libs/macros/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ pub fn light_hasher(input: TokenStream) -> TokenStream {
256256
.into()
257257
}
258258

259+
/// Alias of `LightHasher`.
260+
#[proc_macro_derive(DataHasher, attributes(skip, hash))]
261+
pub fn data_hasher(input: TokenStream) -> TokenStream {
262+
let input = parse_macro_input!(input as ItemStruct);
263+
derive_light_hasher(input)
264+
.unwrap_or_else(|err| err.to_compile_error())
265+
.into()
266+
}
267+
259268
#[proc_macro_attribute]
260269
pub fn light_account(_: TokenStream, input: TokenStream) -> TokenStream {
261270
let input = parse_macro_input!(input as ItemStruct);

0 commit comments

Comments
 (0)