Skip to content

Commit

Permalink
Merge pull request #351 from abdulla-ashurov/abdulla-ashurov/issue347
Browse files Browse the repository at this point in the history
Abdulla ashurov/issue347
  • Loading branch information
Ulfat authored May 13, 2022
2 parents 6de15f9 + eb0c52c commit 6a6a7fe
Show file tree
Hide file tree
Showing 19 changed files with 1,001 additions and 163 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: ^1.16
go-version: ^1.17
- uses: actions/checkout@v3
- uses: actions/cache@v3
if: ${{ !env.ACT }}
Expand All @@ -113,7 +113,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: ^1.16
go-version: ^1.17
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
Expand All @@ -136,10 +136,11 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.16
go-version: 1.17
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 5m0s
check:
if: always()
Expand Down
5 changes: 4 additions & 1 deletion docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,12 @@ The account is not active until sufficient number of Trustees approve it.
- Who can send:
- Trustee
- Number of required approvals:
- 2/3 of Trustees
- 2/3 of Trustees for account roles: `TestHouse`, `CertificationCenter`, `Trustee`, `NodeAdmin`
- 1/3 of Trustees for account role: `Vendor`
- CLI command:
- `dcld tx auth approve-add-account --address=<bench32 encoded string> --from=<account>`
> **_Note:_** If we are approving an account with role `Vendor`, then we need 1/3 of Trustees approvals.

#### REJECT_ADD_ACCOUNT

Expand Down
36 changes: 10 additions & 26 deletions integration_tests/cli/auth-demo-hex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,51 +42,35 @@ pid_in_hex_format=0xA11
vid=2579
pid=2577


echo "Jack proposes account for $user"
result=$(echo $passphrase | dcld tx auth propose-add-account --info="Jack is proposing this account" --address="$user_address" --pubkey="$user_pubkey" --roles="Vendor" --vid="$vid_in_hex_format" --from jack --yes)
check_response "$result" "\"code\": 0"

test_divider

echo "Get an account for $user is not found"
result=$(dcld query auth account --address=$user_address)
check_response "$result" "Not Found"

echo "Get a proposed account for $user and confirm that the approval contains Jack's address"
result=$(dcld query auth proposed-account --address=$user_address)
echo "Get all active accounts. $user account in the list because has enough approvals"
result=$(dcld query auth all-accounts)
check_response "$result" "\"address\": \"$user_address\""
check_response_and_report "$result" $jack_address "json"
check_response_and_report "$result" '"info": "Jack is proposing this account"' "json"
response_does_not_contain "$result" $alice_address "json"

test_divider

echo "Alice approves account for \"$user\""
result=$(echo $passphrase | dcld tx auth approve-add-account --address="$user_address" --info="Alice is approving this account" --from alice --yes)
check_response "$result" "\"code\": 0"

test_divider

echo "Get $user account and confirm that alice and jack are set as approvers"
echo "Get an account for $user"
result=$(dcld query auth account --address=$user_address)
check_response_and_report "$result" $user_address "json"
check_response "$result" "\"address\": \"$user_address\""
check_response_and_report "$result" $jack_address "json"
check_response_and_report "$result" $alice_address "json"
check_response_and_report "$result" '"info": "Alice is approving this account"' "json"
check_response_and_report "$result" '"info": "Jack is proposing this account"' "json"

test_divider

echo "Get $user account"
result=$(dcld query auth account --address=$user_address)
check_response_and_report "$result" "\"address\": \"$user_address\""
echo "Get an proposed account for $user is not found"
result=$(dcld query auth proposed-account --address=$user_address)
check_response "$result" "Not Found"

test_divider

echo "Get a proposed account for $user is not found"
result=$(dcld query auth proposed-account --address=$user_address)
check_response "$result" "Not Found"
echo "Get all proposed accounts. $user account is not in the list"
result=$(dcld query auth all-proposed-accounts)
check_response "$result" "\[\]"

test_divider

Expand Down
Loading

0 comments on commit 6a6a7fe

Please sign in to comment.