Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Feb 24, 2023
1 parent 2ff1b0b commit 37c320c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/pink-drivers/system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ mod system {
fn upgrade_system_contract(&self) -> Result<()> {
let owner = self.ensure_owner()?;
let todo = "redesign";
pink::upgrade_system_contract(owner);
// pink::upgrade_system_contract(owner);
Ok(())
}
}
Expand Down
16 changes: 16 additions & 0 deletions crates/pink/pink-extension/src/chain_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@ pub trait PinkExt {
/// Check whether the code exists in the cluster storage.
#[ink(extension = 19, handle_status = false)]
fn code_exists(code_hash: Hash, sidevm: bool) -> bool;

/// Check whether there is a new version of the system contract.
///
/// Returns the new code hash if there is a new version.
#[ink(extension = 20, handle_status = false)]
fn check_updates() -> Option<Hash>;

/// Get the version of the current contract runtime in this cluster.
#[ink(extension = 21, handle_status = false)]
fn runtime_version() -> (u32, u32);

/// Request to upgrade to latest compatible runtime version registered on-chain.
///
/// The worker would panic if the runtime version is not supported.
#[ink(extension = 22, handle_status = false)]
fn upgrade_runtime();
}

pub fn pink_extension_instance() -> <PinkExt as ChainExtensionInstance>::Instance {
Expand Down
8 changes: 4 additions & 4 deletions e2e/src/fullstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('A full stack', function () {
});
});

describe('Gatekeeper2', () => {
describe.skip('Gatekeeper2', () => {
it('can be registered', async function () {
// Register worker1 as Gatekeeper
const info = await pruntime[1].getInfo();
Expand Down Expand Up @@ -258,7 +258,7 @@ describe('A full stack', function () {
});
});

describe('Master Key Rotation', () => {
describe.skip('Master Key Rotation', () => {
it('can register and un-reg gatekeeper4', async function () {
// Register worker4 as Gatekeeper
const info = await pruntime[3].getInfo();
Expand Down Expand Up @@ -392,7 +392,7 @@ describe('A full stack', function () {
});
});

describe('Gatekeeper3 after rotation', () => {
describe.skip('Gatekeeper3 after rotation', () => {
it('can be registered after rotation', async function () {
// Register worker3 as Gatekeeper
const info = await pruntime[2].getInfo();
Expand Down Expand Up @@ -841,7 +841,7 @@ describe('A full stack', function () {
});

function testPruntimeManagement(workDir) {
describe("PRuntime management", function () {
describe.skip("PRuntime management", function () {
this.timeout(120000);

let cluster;
Expand Down

0 comments on commit 37c320c

Please sign in to comment.