File tree Expand file tree Collapse file tree 11 files changed +40
-27
lines changed
Expand file tree Collapse file tree 11 files changed +40
-27
lines changed Original file line number Diff line number Diff line change 1+ title: '[pallet-revive] rm checked-in metadata'
2+ doc:
3+ - audience: Runtime Dev
4+ description: |-
5+ Removed eth-rpc generated metadata.
6+ The metadata file will now be generated from the build.rs using the AH-westend runtime
7+ crates:
8+ - name: pallet-revive-eth-rpc
9+ bump: patch
Original file line number Diff line number Diff line change 11[package ]
22name = " revive-dev-runtime"
33description = " A solochain dev runtime for revive."
4- version = " 0.0.0"
4+ version = " 0.1.0"
5+ license = " Apache-2.0"
56authors.workspace = true
67homepage.workspace = true
78repository.workspace = true
89edition.workspace = true
9- publish = false
1010
1111[dependencies ]
1212array-bytes = { workspace = true }
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ default-run = "eth-rpc"
1212[lints ]
1313workspace = true
1414
15+ [package .metadata .polkadot-sdk ]
16+ exclude-from-umbrella = true
17+
1518[[bin ]]
1619name = " eth-rpc"
1720path = " src/main.rs"
@@ -56,3 +59,6 @@ substrate-cli-test-utils = { workspace = true }
5659
5760[build-dependencies ]
5861git2 = { workspace = true }
62+ revive-dev-runtime = { workspace = true , default-features = true }
63+ sp-io = { workspace = true , default-features = true }
64+ sp-runtime = { workspace = true , default-features = true }
Original file line number Diff line number Diff line change 1414// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515// See the License for the specific language governing permissions and
1616// limitations under the License.
17- use std:: process:: Command ;
17+ use std:: { fs , process:: Command } ;
1818
19- /// Get the current branch and commit hash.
2019fn main ( ) {
20+ generate_git_revision ( ) ;
21+ generate_metadata_file ( ) ;
22+ }
23+
24+ fn generate_git_revision ( ) {
2125 let output = Command :: new ( "rustc" )
2226 . arg ( "--version" )
2327 . output ( )
@@ -47,3 +51,12 @@ fn main() {
4751 println ! ( "cargo:rustc-env=TARGET={target}" ) ;
4852 println ! ( "cargo:rustc-env=GIT_REVISION={branch}-{id}" ) ;
4953}
54+
55+ fn generate_metadata_file ( ) {
56+ let mut ext = sp_io:: TestExternalities :: new ( Default :: default ( ) ) ;
57+ ext. execute_with ( || {
58+ let metadata = revive_dev_runtime:: Runtime :: metadata_at_version ( 16 ) . unwrap ( ) ;
59+ let bytes: & [ u8 ] = & metadata;
60+ fs:: write ( "revive_chain.scale" , bytes) . unwrap ( ) ;
61+ } ) ;
62+ }
Original file line number Diff line number Diff line change 1- FROM rust AS builder
2-
3- RUN apt-get update && \
4- DEBIAN_FRONTEND=noninteractive apt-get install -y \
5- protobuf-compiler \
6- clang libclang-dev
1+ FROM docker.io/paritytech/ci-unified:latest AS builder
72
83WORKDIR /polkadot
94COPY . /polkadot
10- RUN rustup component add rust-src
11- RUN cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc
5+
6+ RUN cargo fetch
7+ RUN cargo build --workspace --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc
128
139FROM docker.io/parity/base-bin:latest
1410COPY --from=builder /polkadot/target/production/eth-rpc /usr/local/bin
1511
1612USER root
1713RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
18- # unclutter and minimize the attack surface
1914 rm -rf /usr/bin /usr/sbin && \
20- # check if executable works in this container
2115 /usr/local/bin/eth-rpc --help
2216
2317USER polkadot
Original file line number Diff line number Diff line change 2020pub use subxt:: config:: PolkadotConfig as SrcChainConfig ;
2121
2222#[ subxt:: subxt(
23- runtime_metadata_path = "revive_chain.metadata " ,
23+ runtime_metadata_path = "revive_chain.scale " ,
2424 // TODO remove once subxt use the same U256 type
2525 substitute_type(
2626 path = "primitive_types::U256" ,
Original file line number Diff line number Diff line change @@ -874,7 +874,6 @@ node = [
874874 " mmr-gadget" ,
875875 " mmr-rpc" ,
876876 " pallet-contracts-mock-network" ,
877- " pallet-revive-eth-rpc" ,
878877 " pallet-transaction-payment-rpc" ,
879878 " parachains-runtimes-test-utils" ,
880879 " polkadot-approval-distribution" ,
@@ -2313,11 +2312,6 @@ default-features = false
23132312optional = true
23142313path = " ../substrate/frame/contracts/mock-network"
23152314
2316- [dependencies .pallet-revive-eth-rpc ]
2317- default-features = false
2318- optional = true
2319- path = " ../substrate/frame/revive/rpc"
2320-
23212315[dependencies .pallet-transaction-payment-rpc ]
23222316default-features = false
23232317optional = true
You can’t perform that action at this time.
0 commit comments