Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ To run the collator, execute:
--name <ASSIGN_A_NAME> \
--ws-port <P_WS_PORT> --port <P_PORT> --rpc-port <P_RPC_PORT> \
--chain <P_SPEC_RAW.json> \
--execution=Native \
-- \
--port <R_PORT>\
--chain <R_SPEC_RAW.json> \
--execution=wasm --sync fast --pruning archive
--sync fast --pruning archive
```

where:
Expand All @@ -97,11 +96,10 @@ An example for Amplitude will look like this:
--name amplitude-collator-1 \
--ws-port 9945 --port 30335 --rpc-port 9935 \
--chain res/amplitude-spec-raw.json \
--execution=Native \
-- \
--port 30334 \
--chain kusama.json \
--execution=wasm --sync fast --pruning archive
--sync fast --pruning archive
```

You can find the
Expand All @@ -122,7 +120,6 @@ the `--bootnode`. Here's an example:
--ws-port 8844 \
--enable-offchain-indexing TRUE \
-- \
--execution wasm \
--chain rococo-custom-2-raw.json \
--bootnodes /ip4/127.0.0.1/tcp/30333/p2p/<ALICE_NODE_ID> \
--port 30343 \
Expand Down Expand Up @@ -153,7 +150,6 @@ runtimes `lib.rs` file.
```shell
./target/production/pendulum-node benchmark pallet \
--chain pendulum \
--execution=wasm \
--wasm-execution=compiled \
--pallet "*" \
--extrinsic "*" \
Expand All @@ -168,7 +164,6 @@ runtimes `lib.rs` file.
```shell
./target/production/pendulum-node benchmark pallet \
--chain amplitude \
--execution=wasm \
--wasm-execution=compiled \
--pallet "*" \
--extrinsic "*" \
Expand All @@ -183,7 +178,6 @@ runtimes `lib.rs` file.
```shell
./target/production/pendulum-node benchmark pallet \
--chain foucoco \
--execution=wasm \
--wasm-execution=compiled \
--pallet "*" \
--extrinsic "*" \
Expand Down
12 changes: 7 additions & 5 deletions chain-extensions/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ impl From<DispatchError> for ChainExtensionOutcome {
DispatchError::ConsumerRemaining => ChainExtensionOutcome::ConsumerRemaining,
DispatchError::NoProviders => ChainExtensionOutcome::NoProviders,
DispatchError::TooManyConsumers => ChainExtensionOutcome::TooManyConsumers,
DispatchError::Token(token_err) =>
ChainExtensionOutcome::Token(ChainExtensionTokenError::from(token_err)),
DispatchError::Token(token_err) => {
ChainExtensionOutcome::Token(ChainExtensionTokenError::from(token_err))
},
DispatchError::Arithmetic(arithmetic_error) => ChainExtensionOutcome::Arithmetic(
ChainExtensionArithmeticError::from(arithmetic_error),
),
Expand Down Expand Up @@ -155,7 +156,7 @@ fn trim_trailing_zeros(slice: &[u8]) -> &[u8] {
if *el == 0 {
trim_amount += 1;
} else {
break
break;
}
}
&slice[..slice.len() - trim_amount]
Expand Down Expand Up @@ -234,8 +235,9 @@ impl TryFrom<u32> for ChainExtensionOutcome {
9 => Ok(ChainExtensionOutcome::WriteError),
10 => Ok(ChainExtensionOutcome::UnimplementedFuncId),
999 => Ok(ChainExtensionOutcome::Unknown),
1000..=1999 =>
Ok(ChainExtensionOutcome::Token(ChainExtensionTokenError::try_from(value - 1000)?)),
1000..=1999 => {
Ok(ChainExtensionOutcome::Token(ChainExtensionTokenError::try_from(value - 1000)?))
},
2000..=2999 => Ok(ChainExtensionOutcome::Arithmetic(
ChainExtensionArithmeticError::try_from(value - 2000)?,
)),
Expand Down
6 changes: 3 additions & 3 deletions chain-extensions/price/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl TryFrom<u16> for FuncId {
1200 => Self::GetCoinInfo,
_ => {
error!("Called an unregistered `func_id`: {:}", func_id);
return Err(DispatchError::Other("Unimplemented func_id"))
return Err(DispatchError::Other("Unimplemented func_id"));
},
};
Ok(id)
Expand Down Expand Up @@ -100,9 +100,9 @@ where
};

if let Err(_) = env.write(&result.encode(), false, None) {
return Ok(RetVal::Converging(ChainExtensionOutcome::WriteError.as_u32()))
return Ok(RetVal::Converging(ChainExtensionOutcome::WriteError.as_u32()));
};
return Ok(RetVal::Converging(ChainExtensionOutcome::Success.as_u32()))
return Ok(RetVal::Converging(ChainExtensionOutcome::Success.as_u32()));
}

/// CoinInfo is almost the same as Dia's CoinInfo, but with Encode, Decode, and TypeInfo which are necessary for contract to chain extension communication. Implements From<dia::CoinInfo> to make conversion.
Expand Down
Loading
Loading