Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
birchmd committed Jul 27, 2022
1 parent b8a1283 commit 9bb550e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions engine-precompiles/src/xcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

use crate::{Context, EvmPrecompileResult, Precompile, PrecompileOutput};
use aurora_engine_sdk::io::IO;
use aurora_engine_types::types::EthGas;
use aurora_engine_types::{types::EthGas, vec, Cow};
use evm_core::ExitError;
use std::borrow::Cow;

mod costs {
use crate::prelude::types::{EthGas, NearGas};
use crate::prelude::types::EthGas;

// TODO(#483): Determine the correct amount of gas
pub(super) const CROSS_CONTRACT_CALL: EthGas = EthGas::new(0);
Expand Down Expand Up @@ -38,7 +37,7 @@ pub mod cross_contract_call {
}

impl<I: IO> Precompile for CrossContractCall<I> {
fn required_gas(input: &[u8]) -> Result<EthGas, ExitError> {
fn required_gas(_input: &[u8]) -> Result<EthGas, ExitError> {
Ok(costs::CROSS_CONTRACT_CALL)
}

Expand All @@ -55,9 +54,11 @@ impl<I: IO> Precompile for CrossContractCall<I> {
}
}

// It's not allowed to call cross contract call precompile in static mode
// It's not allowed to call cross contract call precompile in static or delegate mode
if is_static {
return Err(ExitError::Other(Cow::from("ERR_INVALID_IN_STATIC")));
} else if context.address != cross_contract_call::ADDRESS.raw() {
return Err(ExitError::Other(Cow::from("ERR_INVALID_IN_DELEGATE")));
}

Ok(PrecompileOutput {
Expand Down
4 changes: 2 additions & 2 deletions engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,11 @@ impl<'env, I: IO + Copy, E: Env> Engine<'env, I, E> {
status.into_result(result)
}

pub fn factory_propose(&mut self, code: Vec<u8>) -> H256 {
pub fn factory_propose(&mut self, _code: Vec<u8>) -> H256 {
todo!(); // Store proposal in state. Return hash of the proposal.
}

pub fn factory_accept(&mut self, hash: H256) -> bool {
pub fn factory_accept(&mut self, _hash: H256) -> bool {
todo!(); // Find proposal, check it can only be called by admin. Update default contract and bump version.
}

Expand Down
3 changes: 2 additions & 1 deletion engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ mod contract {
use aurora_engine_sdk::io::{StorageIntermediate, IO};
use aurora_engine_sdk::near_runtime::{Runtime, ViewEnv};
use aurora_engine_sdk::promise::PromiseHandler;
use aurora_engine_types::Vec;

#[cfg(feature = "integration-test")]
use crate::prelude::NearGas;
Expand Down Expand Up @@ -350,7 +351,7 @@ mod contract {
let io = Runtime;
let proxy_bytecode_hash = io.read_input_arr32().sdk_unwrap();

let mut state = engine::get_state(&io).sdk_unwrap();
let state = engine::get_state(&io).sdk_unwrap();
let predecessor_account_id = io.predecessor_account_id();
require_owner_only(&state, &predecessor_account_id);

Expand Down

0 comments on commit 9bb550e

Please sign in to comment.