osbc 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env +1 -0
- data/app/controllers/api/v1/block_confirmations_controller.rb +12 -12
- data/app/controllers/contracts_controller.rb +0 -5
- data/app/controllers/pools_controller.rb +0 -52
- data/app/controllers/signatures_controller.rb +0 -5
- data/app/controllers/tickets_controller.rb +0 -27
- data/app/views/transactions/_transaction.html.slim +1 -2
- data/app/views/users/registrations/new.html.erb +1 -1
- data/config/routes/api.rb +1 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +963 -1070
- data/coverage/index.html +4841 -5106
- data/lib/osbc/osbc.rb +1 -1
- data/lib/tasks/compose.rake +26 -15
- data/lib/tasks/compose_db.rake +27 -17
- data/lib/tasks/compose_logs.rake +25 -15
- data/lib/tasks/compose_test.rake +19 -9
- data/lib/tasks/task_helpers/compose_taskhelper.rb +22 -0
- data/lib/tasks/task_helpers/taskhelper.rb +23 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd1d73f028ec3088b5eaeb186edaeaa6cb1251e93c68810e1dffc520ab4a2d37
|
4
|
+
data.tar.gz: 11cd22644ea8bf53f2428b415550e61092214a7c1dd299a47526f5d3dbaaee72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2de4088d38539c8054ac620b7fbaa8655d8607af1555dec37a4c5b1ca2e8ab002d47fcd0078da39e41203078713d6d92ceedc1a30a01663d87b3aaf62ee0911b
|
7
|
+
data.tar.gz: '0688ddf35ac525fe9a584f12a1831ef35f5967dba4f5eec2686a9430edfe453d218c4c9b3ce9faa7d283d3a56a10b4a5611466a3a72025025a724247a6a7bafd'
|
data/.env
CHANGED
@@ -11,15 +11,15 @@ class Api::V1::BlockConfirmationsController < ActionController::API
|
|
11
11
|
assign_contract
|
12
12
|
end
|
13
13
|
|
14
|
-
def transactions_to_mine
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
14
|
+
# def transactions_to_mine
|
15
|
+
# return unauthorized_response unless find_user_by_header
|
16
|
+
# ticket = Ticket.find_by(user_id: @user.id)
|
17
|
+
# return ticket_not_found_response unless ticket.present?
|
18
|
+
# transactions_ids = ticket.transaction_id_list
|
19
|
+
# transactions = Transaction.where(id: transactions_ids)
|
20
|
+
# transactions_json = transactions.to_json
|
21
|
+
# render json: transactions_json, status: :ok
|
22
|
+
# end
|
23
23
|
|
24
24
|
def info_to_mine
|
25
25
|
return unauthorized_response unless find_user_by_header
|
@@ -31,11 +31,11 @@ class Api::V1::BlockConfirmationsController < ActionController::API
|
|
31
31
|
|
32
32
|
private
|
33
33
|
def find_user_by_header
|
34
|
-
return unless request.headers["X-
|
35
|
-
api_key = request.headers["X-
|
34
|
+
return unless request.headers["X-API-KEY"].present?
|
35
|
+
api_key = request.headers["X-API-KEY"]
|
36
36
|
@user = User.find_by(api_key: api_key)
|
37
37
|
return unless @user.present?
|
38
|
-
@user.api_secret == request.headers["X-
|
38
|
+
@user.api_secret == request.headers["X-API-SECRET"]
|
39
39
|
end
|
40
40
|
|
41
41
|
def unauthorized_response
|
@@ -17,9 +17,4 @@ class ContractsController < ApplicationController
|
|
17
17
|
def set_contract
|
18
18
|
@contract = Contract.find(params[:id])
|
19
19
|
end
|
20
|
-
|
21
|
-
# Only allow a list of trusted parameters through.
|
22
|
-
def contract_params
|
23
|
-
params.require(:contract).permit(:first_sig, :second_sig, :third_sig, :fourth_sig, :status, :transaction_id)
|
24
|
-
end
|
25
20
|
end
|
@@ -13,61 +13,9 @@ class PoolsController < ApplicationController
|
|
13
13
|
def show
|
14
14
|
end
|
15
15
|
|
16
|
-
# GET /pools/new
|
17
|
-
def new
|
18
|
-
@pool = Pool.new
|
19
|
-
end
|
20
|
-
|
21
|
-
# GET /pools/1/edit
|
22
|
-
def edit
|
23
|
-
end
|
24
|
-
|
25
|
-
# POST /pools or /pools.json
|
26
|
-
def create
|
27
|
-
@pool = Pool.new(pool_params)
|
28
|
-
|
29
|
-
respond_to do |format|
|
30
|
-
if @pool.save
|
31
|
-
format.html { redirect_to pool_url(@pool), notice: "Pool was successfully created." }
|
32
|
-
format.json { render :show, status: :created, location: @pool }
|
33
|
-
else
|
34
|
-
format.html { render :new, status: :unprocessable_entity }
|
35
|
-
format.json { render json: @pool.errors, status: :unprocessable_entity }
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# PATCH/PUT /pools/1 or /pools/1.json
|
41
|
-
def update
|
42
|
-
respond_to do |format|
|
43
|
-
if @pool.update(pool_params)
|
44
|
-
format.html { redirect_to pool_url(@pool), notice: "Pool was successfully updated." }
|
45
|
-
format.json { render :show, status: :ok, location: @pool }
|
46
|
-
else
|
47
|
-
format.html { render :edit, status: :unprocessable_entity }
|
48
|
-
format.json { render json: @pool.errors, status: :unprocessable_entity }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# DELETE /pools/1 or /pools/1.json
|
54
|
-
def destroy
|
55
|
-
@pool.destroy
|
56
|
-
|
57
|
-
respond_to do |format|
|
58
|
-
format.html { redirect_to pools_url, notice: "Pool was successfully destroyed." }
|
59
|
-
format.json { head :no_content }
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
16
|
private
|
64
17
|
# Use callbacks to share common setup or constraints between actions.
|
65
18
|
def set_pool
|
66
19
|
@pool = Pool.find(params[:id])
|
67
20
|
end
|
68
|
-
|
69
|
-
# Only allow a list of trusted parameters through.
|
70
|
-
def pool_params
|
71
|
-
params.require(:pool).permit(:block_id, :users_count, :signatures_count, :amount, :stage)
|
72
|
-
end
|
73
21
|
end
|
@@ -17,9 +17,4 @@ class SignaturesController < ApplicationController
|
|
17
17
|
def set_signature
|
18
18
|
@signature = Signature.find(params[:id])
|
19
19
|
end
|
20
|
-
|
21
|
-
# Only allow a list of trusted parameters through.
|
22
|
-
def signature_params
|
23
|
-
params.require(:signature).permit(:signature, :time_ref, :contract_id, :common_word, :symbol_sequence, :number_sequence, :verify_sig, :block_hash, :signature_hash)
|
24
|
-
end
|
25
20
|
end
|
@@ -18,10 +18,6 @@ class TicketsController < ApplicationController
|
|
18
18
|
@ticket = Ticket.new
|
19
19
|
end
|
20
20
|
|
21
|
-
# GET /tickets/1/edit
|
22
|
-
def edit
|
23
|
-
end
|
24
|
-
|
25
21
|
# POST /tickets or /tickets.json
|
26
22
|
def create
|
27
23
|
return no_transactions_response if block_transactions.empty?
|
@@ -29,29 +25,6 @@ class TicketsController < ApplicationController
|
|
29
25
|
redirect_to tickets_path, notice: "Processing ticket, please wait, wait a minute and refresh the page"
|
30
26
|
end
|
31
27
|
|
32
|
-
# PATCH/PUT /tickets/1 or /tickets/1.json
|
33
|
-
def update
|
34
|
-
respond_to do |format|
|
35
|
-
if @ticket.update(ticket_params)
|
36
|
-
format.html { redirect_to ticket_url(@ticket), notice: "Ticket was successfully updated." }
|
37
|
-
format.json { render :show, status: :ok, location: @ticket }
|
38
|
-
else
|
39
|
-
format.html { render :edit, status: :unprocessable_entity }
|
40
|
-
format.json { render json: @ticket.errors, status: :unprocessable_entity }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# DELETE /tickets/1 or /tickets/1.json
|
46
|
-
def destroy
|
47
|
-
@ticket.destroy
|
48
|
-
|
49
|
-
respond_to do |format|
|
50
|
-
format.html { redirect_to tickets_url, notice: "Ticket was successfully destroyed." }
|
51
|
-
format.json { head :no_content }
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
28
|
private
|
56
29
|
def create_ticket
|
57
30
|
CreateTicketWorker.perform_async(current_user.id, current_pool.id, time_ref)
|
@@ -3,9 +3,8 @@ div id="#{dom_id transaction}"
|
|
3
3
|
strong Sended by:
|
4
4
|
=< transaction.sender
|
5
5
|
p
|
6
|
-
strong Receiver By:
|
6
|
+
strong Receiver By:
|
7
7
|
=< transaction.receiver
|
8
|
-
/ only show the information below if the Show page is being rendered
|
9
8
|
- if action_name == "show"
|
10
9
|
p
|
11
10
|
strong Amount:
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<%= render "users/shared/error_messages", resource: resource %>
|
6
6
|
<div class="field text-black">
|
7
7
|
<%= f.label :username, class: "text-white" %><br />
|
8
|
-
<em class="text-white">(10 characters minimum)</em
|
8
|
+
<em class="text-white">(10 characters minimum)</em><br />
|
9
9
|
<%= f.text_field :username, autofocus: true, autocomplete: "username",class: "px-4 py-2 rounded text-black border-2 border-purple-300 focus_border-purple-900" %>
|
10
10
|
</div>
|
11
11
|
|
data/config/routes/api.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
namespace :api do
|
4
4
|
namespace :v1 do
|
5
5
|
post "confirm_block", to: "block_confirmations#confirm_block"
|
6
|
-
get "tr_to_mine", to: "block_confirmations#transactions_to_mine"
|
6
|
+
# get "tr_to_mine", to: "block_confirmations#transactions_to_mine"
|
7
7
|
get "info_to_mine", to: "block_confirmations#info_to_mine"
|
8
8
|
end
|
9
9
|
end
|
data/coverage/.last_run.json
CHANGED