Add transaction unittest