Skip to content

Commit

Permalink
Merge branch 'master' into gn/env-in-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
German authored Apr 6, 2023
2 parents 40bd228 + d5c1f4a commit a1b505d
Show file tree
Hide file tree
Showing 48 changed files with 159 additions and 52 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/issue-notifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Find stale issues

on:
workflow_dispatch:
schedule:
# UTC Time
- cron: "0 7 * * 4"

jobs:
fetch-issues:
runs-on: ubuntu-latest
strategy:
matrix:
# List of repositories to fetch the issues
repo:
- ink
- cargo-contract
- substrate-contracts-node
- contracts-ui
- ink-docs
- smart-bench
- ink-waterfall
- ink-playground
- nft-marketplace-demo
- pallet-contracts-xcm
- link
- ink-examples
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.ISSUE_TRACKER_APP_ID }}
private_key: ${{ secrets.ISSUE_TRACKER_APP_KEY }}
- name: Fetch issues from ${{ matrix.repo }}
id: issue
uses: paritytech/stale-issues-finder@main
with:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
repo: ${{ matrix.repo }}
# Users to ignore if they are authors. They are separated by commas
ignoreAuthors: ascjones,HCastano,Robbepop,athei,agryaznov,SkymanOne,xermicus,statictype,DoubleOTheven,cmichi,safina12,lean-apple,juangirini,pgherveou
# only fetch issues that don't have any replies
noComments: true
# from today onwards. Increase this number to set how much time without interaction must pass for the issue to be analyzed
days-stale: 0
- run: mkdir outputs
- name: Write repo data
run: echo "$DATA" > "$FILE"
env:
DATA: ${{ steps.issue.outputs.data }}
FILE: outputs/${{ matrix.repo }}.json
- uses: actions/upload-artifact@v3
with:
name: outputs
path: outputs/*.json

message:
runs-on: ubuntu-latest
needs: fetch-issues
steps:
- name: Load outputs
uses: actions/download-artifact@v3
with:
name: outputs
path: outputs
- name: Combine outputs
id: issues
run: |
COMBINED=$(jq -s 'reduce .[] as $x ([]; . + $x)' outputs/*.json | tr '\n' ' ')
COUNT=$(echo $COMBINED | jq length)
echo "# There are $COUNT stale issues" >> $GITHUB_STEP_SUMMARY
echo "ISSUES=$COMBINED" >> $GITHUB_OUTPUT
echo "COUNT=$COUNT" >> $GITHUB_OUTPUT
- name: Filter to the oldest issues
id: message
# Modify the number in reverse[:8] to change how many issues should be shown
run: |
if [ $COUNT = "0" ]; then
echo "MESSAGE=$EMPTY_MESSAGE" >> $GITHUB_OUTPUT
else
MESSAGE=$(echo $COMBINED | jq -r '. | sort_by(.daysStale) | reverse[:8]| .[] | "- [\(.title)](\(.url)) | \(.daysStale) days with no reply"')
delimiter="$(openssl rand -hex 8)"
echo "MESSAGE<<${delimiter}" >> "${GITHUB_OUTPUT}"
echo "$MESSAGE" >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
fi
env:
COMBINED: ${{ steps.issues.outputs.ISSUES }}
COUNT: ${{ steps.issues.outputs.COUNT }}
# This is the message that will be shown when there are no
EMPTY_MESSAGE: "No stale issues! Good job!"
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: "!EBuECvRavzBxijipBi:parity.io"
access_token: ${{ secrets.STALE_MATRIX_ACCESS_TOKEN }}
# Remember to keep at least one empty line between paragraphs
message: |
## Good morning, team 🥞!
This weekly digest lists GitHub issues without any reply that were created by non-team members.
The list is an aggregation of repositories which the Smart Contracts ☂️ owns ([list](https://www.notion.so/paritytechnologies/What-belongs-to-our-umbrella-b9a80b72fedc47d6b35224a15bdec64c)).
${{ steps.message.outputs.MESSAGE }}
Find all the stale issues [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
server: "m.parity.io"
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ compatible with the ink! `4.0.0` release.
For full compatibility requirements see the [migration guide](https://use.ink/faq/migrating-from-ink-3-to-4/#compatibility).

- Add `Mapping::contains(key)` and `Mapping::insert_return_size(key, val)`[#1224](https://github.com/paritytech/ink/pull/1224)
- Add [`payment-channel`](https://github.com/paritytech/ink/tree/master/examples/payment-channel) example ‒ [#1248](https://github.com/paritytech/ink/pull/1248) (thanks [@kanishkatn](https://github.com/kanishkatn)!)
- Add [`payment-channel`](https://github.com/paritytech/ink-examples/tree/main/payment-channel) example ‒ [#1248](https://github.com/paritytech/ink/pull/1248) (thanks [@kanishkatn](https://github.com/kanishkatn)!)
- Add `version` field to ink! metadata ‒ [#1313](https://github.com/paritytech/ink/pull/1313)
- The `rand-extension` example has been adapted to an updated version of the `ChainExtension` API ‒ [#1356](https://github.com/paritytech/ink/pull/1356)
- Add `ink_env::pay_with_call!` helper macro for off-chain emulation of sending payments with contract message calls ‒ [#1379](https://github.com/paritytech/ink/pull/1379)
Expand Down Expand Up @@ -366,7 +366,7 @@ return an `Option<u32>` instead of `()`.

### Added
- :x: Add `Mapping::contains(key)` and `Mapping::insert_return_size(key, val)`[#1224](https://github.com/paritytech/ink/pull/1224)
- Add [`payment-channel`](https://github.com/paritytech/ink/tree/master/examples/payment-channel) example ‒ [#1248](https://github.com/paritytech/ink/pull/1248)
- Add [`payment-channel`](https://github.com/paritytech/ink-examples/tree/main/payment-channel) example ‒ [#1248](https://github.com/paritytech/ink/pull/1248)
- :x: Add `version` field to ink! metadata ‒ [#1313](https://github.com/paritytech/ink/pull/1313)
- The `rand-extension` example has been adapted to an updated version of the `ChainExtension` API ‒ [#1356](https://github.com/paritytech/ink/pull/1356)

Expand Down Expand Up @@ -480,7 +480,7 @@ Additionally there are a couple new `ink_env` functions now:

### New Upgradeable Contract Example

We've added a new example: [`upgradeable-contracts/set-code-hash`](https://github.com/paritytech/ink/tree/master/examples/upgradeable-contracts#set-code-hash).
We've added a new example: [`upgradeable-contracts/set-code-hash`](https://github.com/paritytech/ink-examples/tree/main/upgradeable-contracts#set-code-hash#set-code-hash).

It illustrates how the newly added [`ink_env::set_code_hash`](https://paritytech.github.io/ink/ink_env/fn.set_code_hash.html)
can be used to implement an upgradeable contract that replaces its own code.
Expand Down Expand Up @@ -537,7 +537,7 @@ for the API documentation.

We've also switched all our examples to this new environment, you
can find more "template use-cases" there (e.g. for
[chain extension testing](https://github.com/paritytech/ink/tree/master/examples/rand-extension))
[chain extension testing](https://github.com/paritytech/ink-examples/tree/main/rand-extension))

#### We removed the dynamic storage allocator
More details on the reasoning behind this can be found in [#1148](https://github.com/paritytech/ink/pull/1148).
Expand All @@ -550,7 +550,7 @@ The `CallBuilder` API changed to now support two types of calls:
* `DelegateCall`: a delegated call.<br/>
This enables writing upgradeable contracts using
the `delegate` pattern. An example has been added to demonstrate this:
[`delegate-calls`](https://github.com/paritytech/ink/tree/master/examples/upgradeable-contracts/delegate-calls).
[`delegate-calls`](https://github.com/paritytech/ink-examples/tree/main/upgradeable-contracts).

This is a breaking change, users must now specify the `call_type` to the builder manually.

Expand Down Expand Up @@ -721,7 +721,6 @@ Specifically you need to upgrade to at least the pallet version
### Added
- Added support for wildcard selectors ‒ [#1020](https://github.com/paritytech/ink/pull/1020).
- This enables writing upgradeable smart contracts using the proxy/forward pattern.
We added a new example to illustrate this ‒ the [proxy](https://github.com/paritytech/ink/tree/master/examples/proxy) example.
- Annotating a wildcard selector in traits is not supported.
- The ink! codegen now heavily relies on static type information based on traits defined in `ink_lang`[#665](https://github.com/paritytech/ink/pull/665).
- Some of those traits and their carried information can be used for static reflection of ink!
Expand Down
2 changes: 1 addition & 1 deletion crates/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sp-weights = "14.0.0"

[dev-dependencies]
# Required for the doctest of `MessageBuilder::call`
scale-info = { version = "2.3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"] }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion crates/env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ secp256k1 = { version = "0.27.0", features = ["recovery", "global-context"], opt
#
# Sadly couldn't be marked as dev-dependency.
# Never use this crate outside the off-chain environment!
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink = { path = "../ink" }
Expand Down
2 changes: 1 addition & 1 deletion crates/ink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ink_metadata = { path = "../metadata", default-features = false }

trybuild = { version = "1.0.60", features = ["diff"] }
# Required for the doctest of `env_access::EnvAccess::instantiate_contract`
scale-info = { version = "2.3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"] }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion crates/ink/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ink = { path = ".." }
ink_metadata = { path = "../../metadata" }
ink_prelude = { path = "../../prelude" }
ink_storage = { path = "../../storage" }
scale-info = { version = "2.3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"] }

[lib]
name = "ink_macro"
Expand Down
2 changes: 1 addition & 1 deletion crates/ink/tests/return_type_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ mod tests {

let unit_ty = TypeDef::Tuple(TypeDefTuple::new_portable(vec![]));
assert_eq!(
&unit_ty, &inner_ok_ty.type_def,
unit_ty, inner_ok_ty.type_def,
"Ok variant should be a unit `()` type"
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ink_primitives = { version = "4.1.0", path = "../primitives/", default-features
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
impl-serde = "0.4.0"
derive_more = { version = "0.99", default-features = false, features = ["from"] }
scale-info = { version = "2.3", default-features = false, features = ["derive", "serde", "decode"] }
scale-info = { version = "2.5", default-features = false, features = ["derive", "serde", "decode"] }

[dev-dependencies]
pretty_assertions = "1"
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
ink_prelude = { version = "4.1.0", path = "../prelude/", default-features = false }
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
xxhash-rust = { version = "0.8", features = ["const_xxh32"] }

[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ink_prelude = { version = "4.1.0", path = "../prelude/", default-features = fals

scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
cfg-if = "1.0"
array-init = { version = "2.0", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion crates/storage/src/lazy/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use scale::{
/// # }
/// ```
///
/// More usage examples can be found [in the ink! examples](https://github.com/paritytech/ink/tree/master/examples).
/// More usage examples can be found [in the ink! examples](https://github.com/paritytech/ink-examples).
#[cfg_attr(feature = "std", derive(scale_info::TypeInfo))]
pub struct Mapping<K, V: Packed, KeyType: StorageKey = AutoKey> {
#[allow(clippy::type_complexity)]
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ink_metadata = { version = "4.1.0", path = "../../metadata", default-features =
ink_primitives = { version = "4.1.0", path = "../../primitives", default-features = false }
ink_prelude = { version = "4.1.0", path = "../../prelude", default-features = false }
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
paste = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/basic_contract_caller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

# Note: We **need** to specify the `ink-as-dependency` feature.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false, features = ["call-runtime"] }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

# Substrate
#
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/conditional-compilation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/contract-terminate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/contract-transfer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/custom-environment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/custom_allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ink = { path = "../../crates/ink", default-features = false, features = ["no-all
dlmalloc = {version = "0.2", default-features = false, features = ["global"] }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[lib]
path = "lib.rs"
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/erc1155/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[lib]
path = "lib.rs"
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/erc20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/erc721/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[lib]
path = "lib.rs"
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/flipper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/incrementer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
ink = { path = "../../crates/ink", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }

[lib]
path = "lib.rs"
Expand Down
Loading

0 comments on commit a1b505d

Please sign in to comment.