Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
Changes permission reference to owner to active on the dacauthority p…
Browse files Browse the repository at this point in the history
…ermissions.
  • Loading branch information
dallasjohnson committed Apr 5, 2019
1 parent 3ba4843 commit bd7de24
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 30 deletions.
18 changes: 0 additions & 18 deletions daccustodian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,6 @@ struct [[eosio::table("config"), eosio::contract("daccustodian")]] contr_config
uint32_t lockup_release_time_delay;

asset requested_pay_max;

EOSLIB_SERIALIZE(contr_config,
(lockupasset)
(maxvotes)
(numelected)
(periodlength)
(authaccount)
(tokenholder)
(serviceprovider)
(should_pay_via_service_provider)
(initial_vote_quorum_percent)
(vote_quorum_percent)
(auth_threshold_high)
(auth_threshold_mid)
(auth_threshold_low)
(lockup_release_time_delay)
(requested_pay_max)
)
};

typedef singleton<"config"_n, contr_config> configscontainer;
Expand Down
10 changes: 5 additions & 5 deletions newperiod_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ void daccustodian::setCustodianAuths() {
.accounts = accounts
};

action(permission_level{accountToChange, "owner"_n},
action(permission_level{accountToChange, "active"_n},
"eosio"_n, "updateauth"_n,
std::make_tuple(
accountToChange,
HIGH_PERMISSION,
"owner"_n,
"active"_n,
high_contract_authority))
.send();

Expand All @@ -155,7 +155,7 @@ void daccustodian::setCustodianAuths() {
.accounts = accounts
};

action(permission_level{accountToChange, "owner"_n},
action(permission_level{accountToChange, "active"_n},
"eosio"_n, "updateauth"_n,
std::make_tuple(
accountToChange,
Expand All @@ -170,7 +170,7 @@ void daccustodian::setCustodianAuths() {
.accounts = accounts
};

action(permission_level{accountToChange, "owner"_n},
action(permission_level{accountToChange, "active"_n},
"eosio"_n, "updateauth"_n,
std::make_tuple(
accountToChange,
Expand All @@ -185,7 +185,7 @@ void daccustodian::setCustodianAuths() {
.accounts = accounts
};

action(permission_level{accountToChange, "owner"_n},
action(permission_level{accountToChange, "active"_n},
"eosio"_n, "updateauth"_n,
std::make_tuple(
accountToChange,
Expand Down
2 changes: 1 addition & 1 deletion output/jungle/daccustodian/daccustodian.abi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Mar 7 11:58:06 2019",
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Apr 4 20:49:32 2019",
"version": "eosio::abi/1.1",
"structs": [
{
Expand Down
Binary file modified output/jungle/daccustodian/daccustodian.wasm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Mar 7 11:58:12 2019",
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Apr 4 20:49:37 2019",
"version": "eosio::abi/1.1",
"structs": [
{
Expand Down
Binary file modified output/mainnet_votingdisabled/daccustodian/daccustodian.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion output/mainnet_votingenabled/daccustodian/daccustodian.abi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Mar 7 11:58:18 2019",
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Apr 4 20:49:43 2019",
"version": "eosio::abi/1.1",
"structs": [
{
Expand Down
Binary file modified output/mainnet_votingenabled/daccustodian/daccustodian.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion output/unit_tests/daccustodian/daccustodian.abi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Mon Mar 11 23:08:49 2019",
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Apr 4 21:55:06 2019",
"version": "eosio::abi/1.1",
"structs": [
{
Expand Down
Binary file modified output/unit_tests/daccustodian/daccustodian.wasm
Binary file not shown.
8 changes: 5 additions & 3 deletions tests/contract_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ def install_contracts
cleos system newaccount --stake-cpu \"10.0000 EOS\" --stake-net \"10.0000 EOS\" --transfer --buy-ram-kbytes 1024 eosio dacocoiogmbh #{CONTRACT_OWNER_PUBLIC_KEY} #{CONTRACT_ACTIVE_PUBLIC_KEY}
# Setup the inital permissions.
cleos set account permission dacauthority owner '{"threshold": 1,"keys": [{"key": "#{CONTRACT_ACTIVE_PUBLIC_KEY}","weight": 1}],"accounts": [{"permission":{"actor":"daccustodian","permission":"eosio.code"},"weight":1}]}' '' -p dacauthority@owner
# cleos set account permission eosdacthedac active '{"threshold": 1,"keys": [{"key": "#{CONTRACT_ACTIVE_PUBLIC_KEY}","weight": 1}],"accounts": [{"permission":{"actor":"daccustodian","permission":"eosio.code"},"weight":1}]}' owner -p eosdacthedac@owner
cleos set account permission dacauthority active '{"threshold": 1,"keys": [{"key": "#{CONTRACT_ACTIVE_PUBLIC_KEY}","weight": 1}],"accounts": [{"permission":{"actor":"daccustodian","permission":"eosio.code"},"weight":1}]}' owner -p dacauthority@owner
# cleos set account permission eosdacthedac active '{"threshold": 1,"keys": [{"key": "#{CONTRACT_ACTIVE_PUBLIC_KEY}","weight": 1}],"accounts": [{"permission":{"actor":"daccustodian","permission":"eosio.code"},"weight":1}]}' active -p eosdacthedac@active
cleos set account permission eosdacthedac xfer '{"threshold": 1,"keys": [{"key": "#{CONTRACT_ACTIVE_PUBLIC_KEY}","weight": 1}],"accounts": [{"permission":{"actor":"daccustodian","permission":"eosio.code"},"weight":1}]}' active -p eosdacthedac@active
cleos set account permission daccustodian xfer '{"threshold": 1,"keys": [{"key": "#{CONTRACT_ACTIVE_PUBLIC_KEY}","weight": 1}],"accounts": [{"permission":{"actor":"daccustodian","permission":"eosio.code"},"weight":1}]}' active -p daccustodian@active
cleos push action eosio.token issue '["eosdacthedac", "100000.0000 EOS", "Initial EOS amount."]' -p eosio
Expand All @@ -138,7 +140,7 @@ def install_contracts
cleos set action permission eosdacthedac eosio.token transfer xfer
cleos set action permission daccustodian eosdactokens transfer xfer
cleos set account permission dacauthority high #{CONTRACT_OWNER_PUBLIC_KEY} owner -p dacauthority@owner
cleos set account permission dacauthority high #{CONTRACT_OWNER_PUBLIC_KEY} active -p dacauthority@owner
cleos set account permission dacauthority med #{CONTRACT_OWNER_PUBLIC_KEY} high -p dacauthority@owner
cleos set account permission dacauthority low #{CONTRACT_OWNER_PUBLIC_KEY} med -p dacauthority@owner
cleos set account permission dacauthority one #{CONTRACT_OWNER_PUBLIC_KEY} low -p dacauthority@owner
Expand Down

0 comments on commit bd7de24

Please sign in to comment.