Skip to content

Instantly share code, notes, and snippets.

View ripzery's full-sized avatar
🎯
Focusing

PS ripzery

🎯
Focusing
  • Thailand
View GitHub Profile
@ripzery
ripzery / counter_service.ex
Last active April 29, 2020 16:34
Counter Example to demonstrate GenServer from Programming Phoenix 1.4
defmodule CounterService do
use GenServer
def inc(pid), do: GenServer.cast(pid, :inc)
def dec(pid), do: GenServer.cast(pid, :dec)
def val(pid) do
GenServer.call(pid, :val)
end
def start_link(initial_val) do

UTXOs

Given that:

  • ETH is a token user wants to send
  • OMG is a fee token
ETH OMG
5 5
10 10