Skip to content

Commit

Permalink
fix changed crowdloans extrinsic index (#1857)
Browse files Browse the repository at this point in the history
Signed-off-by: Cheng JIANG <[email protected]>

Signed-off-by: Cheng JIANG <[email protected]>
  • Loading branch information
GopherJ authored Aug 20, 2022
1 parent 5918d1a commit 0d2a299
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 41 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -101,22 +101,22 @@ 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
with:
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:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}"}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -182,19 +182,19 @@ 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
with:
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:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}"}
Expand Down Expand Up @@ -153,23 +153,22 @@ 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
with:
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:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/try-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}"}
Expand Down Expand Up @@ -75,18 +75,18 @@ 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
with:
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:
Expand Down
34 changes: 17 additions & 17 deletions pallets/crowdloans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,23 +659,6 @@ pub mod pallet {
Ok(())
}

/// Update crowdloans proxy address in relaychain
#[pallet::weight(<T as Config>::WeightInfo::update_proxy())]
#[transactional]
pub fn update_proxy(origin: OriginFor<T>, proxy_address: AccountIdOf<T>) -> DispatchResult {
T::RefundOrigin::ensure_origin(origin)?;
log::trace!(
target: "crowdloans::update_proxy",
"pre-toggle. proxy_address: {:?}",
proxy_address
);
ProxyAddress::<T>::put(proxy_address.clone());

Self::deposit_event(Event::<T>::ProxyUpdated(proxy_address));

Ok(())
}

/// Mark the associated vault as `Closed` and stop accepting contributions
#[pallet::weight(<T as Config>::WeightInfo::close())]
#[transactional]
Expand Down Expand Up @@ -1138,6 +1121,23 @@ pub mod pallet {

Ok(())
}

/// Update crowdloans proxy address in relaychain
#[pallet::weight(<T as Config>::WeightInfo::update_proxy())]
#[transactional]
pub fn update_proxy(origin: OriginFor<T>, proxy_address: AccountIdOf<T>) -> DispatchResult {
T::RefundOrigin::ensure_origin(origin)?;
log::trace!(
target: "crowdloans::update_proxy",
"pre-toggle. proxy_address: {:?}",
proxy_address
);
ProxyAddress::<T>::put(proxy_address.clone());

Self::deposit_event(Event::<T>::ProxyUpdated(proxy_address));

Ok(())
}
}

impl<T: Config> Pallet<T> {
Expand Down

0 comments on commit 0d2a299

Please sign in to comment.