From 902129d63957316b1da3ac5db4e2b36e1c9a1a17 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Thu, 17 Aug 2017 14:52:38 +0300 Subject: [PATCH] Utility function for computing topic-id * added utility function for computing topic ID hex-string from event signature --- src/clj/commiteth/eth/core.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index 254e2fd..e376a08 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -142,6 +142,10 @@ (let [s (apply str (take 8 (sha3 signature)))] (str "0x" s))) +(defn event-sig->topic-id [signature] + (let [s (sha3 signature)] + (str "0x" s))) + (defn valid-address? "Validate given ethereum address. Checksum validation is performed and input is case-sensitive"