Skip to content

Commit

Permalink
Merge branch 'develop' into feature/tipper-collective
Browse files Browse the repository at this point in the history
  • Loading branch information
Ad96el authored Feb 22, 2023
2 parents 4094b05 + 29e9c2b commit 531b834
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 8 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/polkadot-release-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: create-polkadot-release-ticket

on:
workflow_dispatch:
inputs:
current-version:
description: Current version of the Polkadot/Cumulus dependency
required: true
type: string
target-version:
description: Target version of the Polkadot/Cumulus dependency
required: true
type: string
asignee:
description: Person assigned for this upgrade
required: false
default: weichweich
type: choice
options:
- weichweich
- ntn-x2
- trusch
- Ad96el

jobs:
create-ticket:
runs-on: ubuntu-latest
steps:
- name: Install cargo
run: curl https://sh.rustup.rs -sSf | sh
- name: Install subalfred
env:
- SUBALFRED_VERSION: 0.9.1
run: cargo install --version $SUBALFRED_VERSION --git https://github.com/hack-ink/subalfred.git subalfred
- name: Run subalfred for Substrate
run: subalfred track-updates paritytech/substrate --from polkadot-v${{ inputs.current-version }} --to polkadot-v${{ inputs.target-version }} > substrate-out.md
- name: Run subalfred for Cumulus
run: subalfred track-updates paritytech/cumulus --from polkadot-v${{ inputs.current-version }} --to polkadot-v${{ inputs.target-version }} > cumulus-out.md
- name: Merge outputs into single file
run: |
echo "## Substrate changes" > out.md
cat substrate-out.md >> out.md
echo "## Cumulus changes" >> out.md
cat cumulus-out.md >> out.md
- name: Create issue from commands output
id: new-issue
uses: peter-evans/create-issue-from-file@v3
with:
title: "chore: update Polkadot dependencies from ${{ inputs.current-version }} to ${{ inputs.target-version }}"
repository: KILTProtocol/ticket
token: ${{ secrets.REPO_ACCESS_TOKEN }}
content-filepath: out.md
- name: Put issue into weekly board
uses: peter-evans/create-or-update-project-card@v2
with:
# Weekly board
project-number: 24
column-name: "📥 Inbox"
issue-number: ${{ steps.new-issue.outputs.issue-number }}

12 changes: 6 additions & 6 deletions crates/assets/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub mod v1 {
/// The minimum length of a valid asset ID reference.
pub const MINIMUM_REFERENCE_LENGTH: usize = 1;
/// The maximum length of a valid asset ID reference.
pub const MAXIMUM_REFERENCE_LENGTH: usize = 64;
pub const MAXIMUM_REFERENCE_LENGTH: usize = 128;
const MAXIMUM_REFERENCE_LENGTH_U32: u32 = MAXIMUM_REFERENCE_LENGTH as u32;
/// The minimum length of a valid asset ID identifier.
pub const MINIMUM_IDENTIFIER_LENGTH: usize = 1;
Expand Down Expand Up @@ -604,7 +604,7 @@ pub mod v1 {
check_reference_length_bounds(input)?;

input.iter().try_for_each(|c| {
if !matches!(c, b'-' | b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9') {
if !matches!(c, b'-' | b'.' | b'%' | b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9') {
log::trace!("Provided input has some invalid values as expected by a generic asset reference.");
Err(ReferenceError::InvalidFormat)
} else {
Expand Down Expand Up @@ -653,7 +653,7 @@ pub mod v1 {
check_identifier_length_bounds(input)?;

input.iter().try_for_each(|c| {
if !matches!(c, b'-' | b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9') {
if !matches!(c, b'-' | b'.' | b'%' | b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9') {
log::trace!("Provided input has some invalid values as expected by a generic asset identifier.");
Err(IdentifierError::InvalidFormat)
} else {
Expand Down Expand Up @@ -727,7 +727,7 @@ pub mod v1 {
"slip44:›",
"slip44:😁",
// Max chars + 1
"slip44:99999999999999999999999999999999999999999999999999999999999999999",
"slip44:999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999",
];
for asset in invalid_assets {
assert!(
Expand Down Expand Up @@ -899,7 +899,7 @@ pub mod v1 {
let valid_assets = [
"123:a",
"12345678:-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-",
"12345678:-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-:-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678901234567890123-",
"12345678:-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%-:-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789012%",
"para:411f057b9107718c9624d6aa4a3f23c1",
"para:kilt-spiritnet",
"w3n:john-doe",
Expand Down Expand Up @@ -928,7 +928,7 @@ pub mod v1 {
"valid:valid:",
// Too long
"too-loong:valid",
"valid:too-loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong",
"valid:too-loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong",
"valid:valid:too-loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong",
// Wrong characters
"no-val!d:valid",
Expand Down
3 changes: 2 additions & 1 deletion crates/assets/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ mod v1 {
check_reference_length_bounds(input)?;

input.iter().try_for_each(|c| {
if !matches!(c, b'-' | b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9') {
if !matches!(c, b'-' | b'_' | b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9') {
log::trace!("Provided input has some invalid values as expected by a generic chain reference.");
Err(ReferenceError::InvalidFormat)
} else {
Expand Down Expand Up @@ -806,6 +806,7 @@ mod v1 {
let valid_chains = [
// Edge cases
"abc:-",
"abc:_",
"-as01-aa:A",
"12345678:abcdefghjklmnopqrstuvwxyzABCD012",
// Filecoin examples -> https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-23.md
Expand Down
2 changes: 1 addition & 1 deletion runtimes/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ pub mod public_credentials {
use super::*;

/// The size is checked in the runtime by a test.
pub const MAX_PUBLIC_CREDENTIAL_STORAGE_LENGTH: u32 = 355;
pub const MAX_PUBLIC_CREDENTIAL_STORAGE_LENGTH: u32 = 419;
// Each credential would have a different deposit, so no multiplier here
pub const PUBLIC_CREDENTIAL_DEPOSIT: Balance = deposit(1, MAX_PUBLIC_CREDENTIAL_STORAGE_LENGTH);

Expand Down

0 comments on commit 531b834

Please sign in to comment.