From 0d2a2995b2ab2b9f1e75fd98c39d8d3e47410155 Mon Sep 17 00:00:00 2001 From: Cheng JIANG Date: Sat, 20 Aug 2022 16:39:52 +0800 Subject: [PATCH] fix changed crowdloans extrinsic index (#1857) Signed-off-by: Cheng JIANG Signed-off-by: Cheng JIANG --- .github/workflows/coverage.yml | 14 ++++++------- .github/workflows/dockerimage.yml | 12 +++++------ .github/workflows/srtool.yml | 11 +++++----- .github/workflows/try-runtime.yml | 10 ++++----- pallets/crowdloans/src/lib.rs | 34 +++++++++++++++---------------- 5 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 552535c4e..c2651638a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -30,7 +30,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Start EC2 runner id: start-ec2-runner uses: machulav/ec2-github-runner@v2 @@ -41,12 +41,12 @@ jobs: ec2-instance-type: ${{ secrets.EC2_INSTANCE_TYPE }} subnet-id: ${{ secrets.SUBNET_ID }} security-group-id: ${{ secrets.SECURITY_GROUP_ID }} - aws-resource-tags: > + aws-resource-tags: > [ {"Key": "Name", "Value": "${{ github.workflow }}"}, {"Key": "GitHubRepository", "Value": "${{ github.repository }}"} ] - + test: name: Coverage Report needs: start-runner @@ -101,14 +101,14 @@ jobs: status: ${{ job.status }} fields: repo,message,commit,author,eventName,ref,workflow if: always() - + stop-runner: name: stop self-hosted EC2 runner needs: - - start-runner + - start-runner - test runs-on: ubuntu-latest - if: ${{ always() }} + if: ${{ always() }} steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -116,7 +116,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Stop EC2 runner uses: machulav/ec2-github-runner@v2 with: diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index dd2985cdd..2486cae18 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -22,7 +22,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Start EC2 runner id: start-ec2-runner uses: machulav/ec2-github-runner@v2 @@ -33,7 +33,7 @@ jobs: ec2-instance-type: ${{ secrets.EC2_INSTANCE_TYPE }} subnet-id: ${{ secrets.SUBNET_ID }} security-group-id: ${{ secrets.SECURITY_GROUP_ID }} - aws-resource-tags: > + aws-resource-tags: > [ {"Key": "Name", "Value": "${{ github.workflow }}"}, {"Key": "GitHubRepository", "Value": "${{ github.repository }}"} @@ -118,7 +118,7 @@ jobs: parallel-helper: if: github.repository == 'parallel-finance/parallel' - needs: + needs: - start-runner - parallel runs-on: ${{ needs.start-runner.outputs.label }} @@ -182,11 +182,11 @@ jobs: stop-runner: name: stop self-hosted EC2 runner needs: - - start-runner + - start-runner - parallel - parallel-helper runs-on: ubuntu-latest - if: ${{ always() }} + if: ${{ always() }} steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -194,7 +194,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Stop EC2 runner uses: machulav/ec2-github-runner@v2 with: diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 57db2e350..48464ba71 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -21,7 +21,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Start EC2 runner id: start-ec2-runner uses: machulav/ec2-github-runner@v2 @@ -32,7 +32,7 @@ jobs: ec2-instance-type: ${{ secrets.EC2_INSTANCE_TYPE }} subnet-id: ${{ secrets.SUBNET_ID }} security-group-id: ${{ secrets.SECURITY_GROUP_ID }} - aws-resource-tags: > + aws-resource-tags: > [ {"Key": "Name", "Value": "${{ github.workflow }}"}, {"Key": "GitHubRepository", "Value": "${{ github.repository }}"} @@ -153,15 +153,14 @@ jobs: with: args: "Parallel ${{ steps.git_tag.outputs.tag }} has just been released! Go check it out: https://github.com/${{ github.repository }}/releases/tag/${{ steps.git_tag.outputs.tag }}" - stop-runner: name: stop self-hosted EC2 runner needs: - - start-runner + - start-runner - srtool - postrelease runs-on: ubuntu-latest - if: ${{ always() }} + if: ${{ always() }} steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -169,7 +168,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Stop EC2 runner uses: machulav/ec2-github-runner@v2 with: diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 07636c32b..a780f8541 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -18,7 +18,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Start EC2 runner id: start-ec2-runner uses: machulav/ec2-github-runner@v2 @@ -29,7 +29,7 @@ jobs: ec2-instance-type: ${{ secrets.EC2_INSTANCE_TYPE }} subnet-id: ${{ secrets.SUBNET_ID }} security-group-id: ${{ secrets.SECURITY_GROUP_ID }} - aws-resource-tags: > + aws-resource-tags: > [ {"Key": "Name", "Value": "${{ github.workflow }}"}, {"Key": "GitHubRepository", "Value": "${{ github.repository }}"} @@ -75,10 +75,10 @@ jobs: stop-runner: name: stop self-hosted EC2 runner needs: - - start-runner + - start-runner - try-runtime runs-on: ubuntu-latest - if: ${{ always() }} + if: ${{ always() }} steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -86,7 +86,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - + - name: Stop EC2 runner uses: machulav/ec2-github-runner@v2 with: diff --git a/pallets/crowdloans/src/lib.rs b/pallets/crowdloans/src/lib.rs index 61ab09064..00b950739 100644 --- a/pallets/crowdloans/src/lib.rs +++ b/pallets/crowdloans/src/lib.rs @@ -659,23 +659,6 @@ pub mod pallet { Ok(()) } - /// Update crowdloans proxy address in relaychain - #[pallet::weight(::WeightInfo::update_proxy())] - #[transactional] - pub fn update_proxy(origin: OriginFor, proxy_address: AccountIdOf) -> DispatchResult { - T::RefundOrigin::ensure_origin(origin)?; - log::trace!( - target: "crowdloans::update_proxy", - "pre-toggle. proxy_address: {:?}", - proxy_address - ); - ProxyAddress::::put(proxy_address.clone()); - - Self::deposit_event(Event::::ProxyUpdated(proxy_address)); - - Ok(()) - } - /// Mark the associated vault as `Closed` and stop accepting contributions #[pallet::weight(::WeightInfo::close())] #[transactional] @@ -1138,6 +1121,23 @@ pub mod pallet { Ok(()) } + + /// Update crowdloans proxy address in relaychain + #[pallet::weight(::WeightInfo::update_proxy())] + #[transactional] + pub fn update_proxy(origin: OriginFor, proxy_address: AccountIdOf) -> DispatchResult { + T::RefundOrigin::ensure_origin(origin)?; + log::trace!( + target: "crowdloans::update_proxy", + "pre-toggle. proxy_address: {:?}", + proxy_address + ); + ProxyAddress::::put(proxy_address.clone()); + + Self::deposit_event(Event::::ProxyUpdated(proxy_address)); + + Ok(()) + } } impl Pallet {