Skip to content

Commit

Permalink
plug governance flow with incoming transactions (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenmoves committed Feb 24, 2023
1 parent 39a8efd commit dba09ee
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/archethic/governance/code/CICD.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Archethic.Governance.Code.CICD do
where
* Code - a source code of archethic-node
* Propsal - a code proposal transaction
* Proposal - a code proposal transaction
* Release - a release of archethic-node
* Upgrade - an upgrade to a release of archethic-node
* CiLog - unit tests and type checker logs
Expand Down
2 changes: 1 addition & 1 deletion lib/archethic/governance/code/cicd/docker/cicd.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Archethic.Governance.Code.CICD.Docker do
@moduledoc """
CICD service baked by docker.
CICD service backed by docker.
The service relies on the `Dockerfile` with two targets: `archethic-ci` and
`archethic-cd`.
Expand Down
2 changes: 1 addition & 1 deletion lib/archethic/governance/pools/mem_table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Archethic.Governance.Pools.MemTable do
alias Archethic.Governance.Pools

@doc """
Initialize an memory table for the governance pool member distribution
Initialize a memory table for the governance pool member distribution
## Examples
Expand Down
13 changes: 12 additions & 1 deletion lib/archethic/mining/pending_transaction_validation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,17 @@ defmodule Archethic.Mining.PendingTransactionValidation do
end
end

defp do_accept_transaction(
%Transaction{
type: :code_approval,
data: %TransactionData{
recipients: []
}
},
_
),
do: {:error, "No recipient specified in code approval"}

defp do_accept_transaction(
%Transaction{
type: :keychain,
Expand Down Expand Up @@ -707,7 +718,7 @@ defmodule Archethic.Mining.PendingTransactionValidation do
) :: boolean
defp validate_network_chain?(type, tx = %Transaction{})
when type in [:oracle, :oracle_summary] do
# mulitpe txn chain based on summary date
# multipe txn chain based on summary date

case OracleChain.genesis_address() do
nil ->
Expand Down
3 changes: 3 additions & 0 deletions lib/archethic/replication.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ defmodule Archethic.Replication do

alias Archethic.Reward

alias Archethic.Governance

alias __MODULE__.TransactionContext
alias __MODULE__.TransactionPool
alias __MODULE__.TransactionValidator
Expand Down Expand Up @@ -575,6 +577,7 @@ defmodule Archethic.Replication do
Contracts.load_transaction(tx, from_self_repair: self_repair?)
OracleChain.load_transaction(tx)
Reward.load_transaction(tx)
Governance.load_transaction(tx)
:ok
end
end
2 changes: 1 addition & 1 deletion lib/archethic/transaction_chain/mem_tables_loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule Archethic.TransactionChain.MemTablesLoader do
:address,
:type,
:previous_public_key,
data: [:code],
data: [:code, :recipients],
validation_stamp: [:timestamp]
]

Expand Down

0 comments on commit dba09ee

Please sign in to comment.