Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testnet to 2.230.0 #1265

Merged
merged 14 commits into from
Aug 24, 2023
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
6 changes: 4 additions & 2 deletions .github/workflows/runtime-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ jobs:
path: "last-block*"
if-no-files-found: error


build-sut:
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -131,7 +130,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --release --features try-runtime
args: --release --features "fast-runtime try-runtime"

- name: Upload creditcoin-node binary
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -731,13 +730,16 @@ jobs:
--chain ${{ needs.setup.outputs.target_chain }} \
--validator --mining-key 5DkPYq8hFiCeGxFBkz6DAwnTrvKevAJfTYrzFtr9hpDsEAU1 \
--bootnodes "${{ needs.setup.outputs.boot_node }}" \
--rpc-max-request-size 100000 \
--rpc-max-response-size 100000 \
--prometheus-external \
--telemetry-url "wss://telemetry.creditcoin.network/submit/ 0" \
--public-addr "/dns4/$IP_ADDRESS/tcp/30333" >creditcoin-node-used-for-try-runtime.log 2>&1 &

- name: Wait for creditcoin-node to initialize
run: |
./integration-tests/wait-for-creditcoin.sh
./scripts/wait-for-sync.sh ${{ needs.setup.outputs.last_block_number }}

- name: Try-runtime migrations
run: |
Expand Down
26 changes: 13 additions & 13 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ members = [
resolver = "2"

[workspace.package]
version = '2.226.0'
version = '2.230.0'
authors = ['Gluwa Inc.', 'Nathan Whitaker <nathan.whitaker@gluwa.com>']
edition = '2021'
license = 'Unlicense'
Expand Down
8 changes: 7 additions & 1 deletion chainspecs/mainnetSpec.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
"tokenSymbol": "CTC"
},
"consensusEngine": null,
"grandpaInitialAuthorities": [],
"grandpaInitialAuthorities": [
"5FtSgXjm4RaWqjoGRoQjXxsmzPvnVJh9rYXU6pu8YRLXqHca",
"5FSmf1rrwb6jHzZBbHnVNk5zYFjn367Yn1ruMf8AVs3PX2kN",
"5D4yMa9ZDCiNxHDDQfs1jWWKvn7RC75ELHUXz92cEhWFhnx7",
"5D8Xv4ghgYSkTjUD11jZvpdiAPXZDDTbGfdrhGBpwEY8NmaD",
"5HDnRvFZ1VTMrgWEuCNa6EUpJeJZuVQqWTEnJtPCWywGJ2K5"
],
"codeSubstitutes": {},
"badBlocks": null,
"genesis": {
Expand Down
2 changes: 1 addition & 1 deletion ci/env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

export RUSTC_VERSION=nightly-2023-04-16
export RUSTC_VERSION=nightly-2023-06-06
2 changes: 1 addition & 1 deletion creditcoin-js/creditcoin.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion creditcoin-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"generate:meta": "ts-node --skip-project node_modules/.bin/polkadot-types-from-chain --package creditcoin-js/interfaces --endpoint ./creditcoin.json --output ./src/interfaces",
"format": "prettier --write \"src/**/*.ts\"",
"check-format": "prettier --check \"src/**/*.ts\"",
"lint": "eslint -c .eslintrc.js --ext .ts ./src",
"lint": "eslint -c .eslintrc.js --max-warnings 0 --ext .ts ./src",
"typecheck": "tsc --noEmit",
"prepare": "yarn build",
"test": "$npm_execpath example"
Expand Down
6 changes: 1 addition & 5 deletions creditcoin-js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
TransferId,
TransferKind,
TransferProcessed,
SignatureType,
OwnershipProof,
} from './model';
import { AddressRegistered } from './extrinsics/register-address';
Expand All @@ -32,10 +31,7 @@ import { TransferEvent } from './extrinsics/register-transfers';
import { LoanExempted } from './extrinsics/exempt';
import { Wallet } from 'ethers';
import { CollectCoinsEvent } from './extrinsics/request-collect-coins';
import {
PalletCreditcoinOcwErrorsVerificationFailureCause,
PalletCreditcoinOwnershipProof,
} from '@polkadot/types/lookup';
import { PalletCreditcoinOcwErrorsVerificationFailureCause } from '@polkadot/types/lookup';

export type TxCallback = (result: SubmittableResult) => void;
export type TxFailureCallback = (error?: Error) => void;
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test:comments": "--runInBand avoids race conditions with global setup",
"test": "jest --silent --runInBand",
"lint": "eslint -c .eslintrc.js --ext .ts ./src",
"lint": "eslint -c .eslintrc.js --max-warnings 0 --ext .ts ./src",
"format": "prettier --write \"src/**/*.ts\"",
"check-format": "prettier --check \"src/**/*.ts\"",
"typecheck": "tsc --noEmit"
Expand Down
17 changes: 17 additions & 0 deletions pallets/creditcoin/src/ocw/tasks/collect_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,23 @@ pub(crate) mod tests {
});
}

#[test]
fn request_collect_coins_should_fail_when_not_signed() {
let ext = ExtBuilder::default();
ext.build_offchain_and_execute_with_state(|_, _pool| {
let (_, addr, _, _) = generate_address_with_proof("collector");

assert_noop!(
Creditcoin::<Test>::request_collect_coins(
RuntimeOrigin::none(),
addr,
TX_HASH.hex_to_address(),
),
BadOrigin
);
});
}

#[test]
fn request_persisted_not_reentrant() {
let mut ext = ExtBuilder::default();
Expand Down
12 changes: 6 additions & 6 deletions pallets/creditcoin/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ fn fund_deal_order_should_error_when_transfer_sighash_doesnt_match_lender() {

// modify transfer in order to cause transfer mismatch
crate::Transfers::<Test>::mutate(&transfer_id, |transfer_storage| {
let mut ts = transfer_storage.as_mut().unwrap();
let ts = transfer_storage.as_mut().unwrap();
// b/c amount above is 0
ts.amount = deal_order.terms.amount;
ts.account_id = AccountId::new([4; 32]);
Expand All @@ -1327,7 +1327,7 @@ fn fund_deal_order_should_error_when_transfer_has_been_processed() {

// modify transfer in order to cause an error
crate::Transfers::<Test>::mutate(&transfer_id, |transfer_storage| {
let mut ts = transfer_storage.as_mut().unwrap();
let ts = transfer_storage.as_mut().unwrap();
// b/c amount above is 0
ts.amount = deal_order.terms.amount;
ts.is_processed = true;
Expand Down Expand Up @@ -2134,7 +2134,7 @@ fn close_deal_order_should_error_when_transfer_block_is_greater_than_current_blo

// modify transfer in order to cause transfer mismatch
crate::Transfers::<Test>::mutate(&transfer_id, |transfer_storage| {
let mut ts = transfer_storage.as_mut().unwrap();
let ts = transfer_storage.as_mut().unwrap();
// b/c amount above is 0
ts.amount = deal_order.terms.amount;
ts.block = Creditcoin::block_number() + 1;
Expand Down Expand Up @@ -2172,7 +2172,7 @@ fn close_deal_order_should_error_when_transfer_sighash_doesnt_match_borrower() {

// modify transfer in order to cause transfer mismatch
crate::Transfers::<Test>::mutate(&transfer_id, |transfer_storage| {
let mut ts = transfer_storage.as_mut().unwrap();
let ts = transfer_storage.as_mut().unwrap();
ts.account_id = AccountId::new([44; 32]);
});

Expand Down Expand Up @@ -2208,7 +2208,7 @@ fn close_deal_order_should_error_when_transfer_has_already_been_processed() {

// modify transfer in order to cause transfer mismatch
crate::Transfers::<Test>::mutate(&transfer_id, |transfer_storage| {
let mut ts = transfer_storage.as_mut().unwrap();
let ts = transfer_storage.as_mut().unwrap();
// b/c amount above is 0
ts.is_processed = true;
});
Expand Down Expand Up @@ -2261,7 +2261,7 @@ fn close_deal_order_should_succeed() {

// modify transfer to make sure we have transfered enough funds
crate::Transfers::<Test>::mutate(&transfer_id, |transfer_storage| {
let mut ts = transfer_storage.as_mut().unwrap();
let ts = transfer_storage.as_mut().unwrap();

ts.amount = deal_order.terms.amount + 1u64;
});
Expand Down
70 changes: 35 additions & 35 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,41 +734,6 @@ where
}
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system,
Timestamp: pallet_timestamp,
PosSwitch: pallet_pos_switch,
Babe: pallet_babe,
Balances: pallet_balances,
Authorship: pallet_authorship,
Staking: pallet_staking_substrate,
Offences: pallet_offences,
Historical: session_historical,
Session: pallet_session,
Grandpa: pallet_grandpa,
ImOnline: pallet_im_online,
VoterList: pallet_bags_list::<Instance1>,
TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo,
Creditcoin: pallet_creditcoin,
Difficulty: pallet_difficulty,
Rewards: pallet_rewards,
Scheduler: pallet_scheduler,
TaskScheduler: pallet_offchain_task_scheduler,
Identity: pallet_identity,
Utility: pallet_utility,
Proxy: pallet_proxy,
FastUnstake: pallet_fast_unstake,
NominationPools: pallet_nomination_pools,
}
);

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
/// Block header type as expected by this runtime.
Expand Down Expand Up @@ -1187,3 +1152,38 @@ impl pallet_nomination_pools::Config for Runtime {
type MaxMetadataLen = ();
type MaxUnbonding = MaxUnbonding;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system,
Timestamp: pallet_timestamp,
PosSwitch: pallet_pos_switch,
Babe: pallet_babe,
Balances: pallet_balances,
Authorship: pallet_authorship,
Staking: pallet_staking_substrate,
Offences: pallet_offences,
Historical: session_historical,
Session: pallet_session,
Grandpa: pallet_grandpa,
ImOnline: pallet_im_online,
VoterList: pallet_bags_list::<Instance1>,
TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo,
Creditcoin: pallet_creditcoin,
Difficulty: pallet_difficulty,
Rewards: pallet_rewards,
Scheduler: pallet_scheduler,
TaskScheduler: pallet_offchain_task_scheduler,
Identity: pallet_identity,
Utility: pallet_utility,
Proxy: pallet_proxy,
FastUnstake: pallet_fast_unstake,
NominationPools: pallet_nomination_pools,
}
);
2 changes: 1 addition & 1 deletion runtime/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 226,
spec_version: 230,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 11,
Expand Down
2 changes: 1 addition & 1 deletion scripts/cc-cli/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = {
format: ["strictCamelCase"],
filter: {
// you can expand this regex to add more allowed names
regex: "^(CC_SEED|CC_CONTROLLER_SEED|CC_STASH_SEED)$",
regex: "^(CC_SECRET|CC_CONTROLLER_SECRET|CC_STASH_SECRET)$",
match: false,
},
},
Expand Down
Loading
Loading