This file contains hidden or 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
<?php | |
class User { | |
const MIN_PASSWORD_LENGTH = 8; | |
private $firstName; | |
private $lastName; | |
private $hasChanged = false; | |
public function __construct() { | |
} |
This file contains hidden or 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
#seto_payload{ | |
type = market_quotes, | |
eto_payload = | |
#eto_payload{ | |
seq = 7,type = undefined,is_replay = false, | |
replay = undefined,login = undefined, | |
login_response = undefined,logout = undefined}, | |
login = undefined,order_create = undefined, | |
order_rejected = undefined,order_accepted = undefined, | |
order_executed = undefined,order_cancel = undefined, |
This file contains hidden or 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
4> smk_client:orders_for_market(smk_my_callbacks, #seto_uuid_128{low=230193}). | |
14:52:11.724 [info] sending: 7 {seto_payload,orders_for_market_request, | |
{eto_payload,7,undefined,undefined,undefined,undefined, | |
undefined,undefined}, | |
undefined,undefined,undefined,undefined,undefined,undefined, | |
undefined,undefined,undefined,undefined,undefined,undefined, | |
undefined,undefined,undefined,undefined,undefined,undefined, | |
undefined, | |
{seto_orders_for_market_request, | |
{seto_uuid_128,230193,undefined}}, |
This file contains hidden or 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
handle_call(which_children, _From, #state{children = [#child{restart_type = temporary, | |
child_type = CT0, | |
modules = Mods} = Child]} = | |
State) when ?is_simple(State) -> | |
CT = | |
case Mods of | |
[eto_tcp_socket_fsm] -> worker; | |
_ -> CT0 | |
end, | |
Reply = lists:map(fun(Pid) -> {undefined, Pid, CT, Mods} end, |
This file contains hidden or 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
import smarkets.eto.EtoPiqi; | |
import smarkets.seto.SetoPiqi; | |
import com.google.protobuf.CodedOutputStream; | |
public class Go | |
{ | |
public static void main(String[] args) | |
{ | |
SetoPiqi.Payload payload = SetoPiqi.Payload.newBuilder() | |
.setType(SetoPiqi.PayloadType.PAYLOAD_LOGIN) |
This file contains hidden or 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
1> 11:56:38.152 [info] Application lager started on node nonode@nohost | |
11:56:38.154 [info] Application smk started on node nonode@nohost | |
1> smk_my_callbacks:start(<<"[email protected]">>, <<"******">>). | |
11:57:09.777 [info] LastIn 0 LastOut 0 | |
11:57:09.778 [info] connection backoff 0, cache smk_memory_message_cache | |
{ok,<0.52.0>} | |
2> 11:57:09.805 [info] sending: 1 {seto_payload,login,{eto_payload,1,login,undefined,undefined,undefined,undefined,undefined},{seto_login,<<"[email protected]">>,<<"abc123">>,undefined},undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined} | |
11:57:09.902 [info] awaiting_session: Received {seto_payload,eto,{eto_payload,1,login_response,false,undefined,undefined,{eto_login_response,<<"5d18861f-4a65-4084-b7ef-95d6e680aa9b">>,2},undefined},undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined |
This file contains hidden or 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
order_executed_test_() -> | |
Qty = 100000, | |
Px = 2500, | |
{inparallel, [ | |
fun() -> | |
{ok, C} = login_with_user(1), | |
?assertLoginResponse(1), | |
Side = buy, | |
ok = smk_client:order(C, Qty, Px, Side, ?MARKET_ID, ?CONTRACT_ID), | |
?assertOrderAccepted(2, OrderId, 2), |
This file contains hidden or 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
def login(username, password): | |
msg = seto_pb2.seq_message() | |
msg.seq = 1 | |
msg.payload.login.username = username | |
msg.payload.login.password = password | |
return msg.SerializeToString() |
This file contains hidden or 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
-spec login(binary(), binary()) -> iolist(). | |
login(Username, Password) -> | |
Msg = #seto_message{ | |
seq = 1, | |
payload = | |
{login, #seto_login{ | |
username = Username, | |
password = Password | |
}} | |
}, |
This file contains hidden or 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
open_connection_link(Params) -> | |
process_flag(trap_exit, true), | |
{ok, Conn} = amqp_connection:start(network, Params), | |
link(Conn), | |
receive | |
{'EXIT', Conn, Reason} -> | |
exit(Reason); | |
{'EXIT', _Pid, Reason} -> | |
ok = amqp_connection:close(Conn), | |
exit(Reason) |