Last active
October 3, 2016 17:00
-
-
Save madvas/91b860de0aa03b04ebcb921965b1865e to your computer and use it in GitHub Desktop.
:contract/compiled-code-loaded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reg-event-fx | |
:contract/abi-loaded | |
interceptors | |
(fn [{:keys [db]} [abi]] | |
(let [web3 (:web3 db) | |
contract-instance (web3-eth/contract-at web3 abi (:address (:contract db)))] | |
{:db (assoc-in db [:contract :instance] contract-instance) | |
:web3-fx.contract/events | |
{:instance contract-instance | |
:db db | |
:db-path [:contract :events] | |
:events [[:on-tweet-added {} {:from-block 0} :contract/on-tweet-loaded :log-error]]} | |
:web3-fx.contract/constant-fns | |
{:instance contract-instance | |
:fns [[:get-settings :contract/settings-loaded :log-error]]}}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment