-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix starcoin-framework 1. add DerivedAuid schema to AuthenticationKey 2. add error::invalid_state * comments out some MoveStructLayout * add DeriveObjectAddressFromObject schema to AuthenticationKey * fix starcoin-framework 1. add DISALLOW_USER_NATIVES to FeatureFlag 2. add SafeNativeError::LoadModule * remove consensus_config from natives * add FunctionGraph to SafeNativeError * enable starcoin-sdk-builder * udpate starcoin-crypto and move deps * comments out ContractEvent::V2 * fix some clap3 errors * fix conflicted definitions with same names * silence warnings
- Loading branch information
Showing
21 changed files
with
271 additions
and
169 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) The Starcoin Core Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use starcoin_crypto::HashValue; | ||
use starcoin_vm_types::vm_status::DiscardedVMStatus; | ||
use std::error::Error; | ||
use thiserror::Error; | ||
|
||
pub type ExecutorResult<T> = anyhow::Result<T, BlockExecutorError>; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum BlockExecutorError { | ||
#[error("block transaction execute discard, status:{0:?}, transaction_id: {1}")] | ||
BlockTransactionDiscard(DiscardedVMStatus, HashValue), | ||
#[error("block transaction accumulator append error")] | ||
BlockAccumulatorAppendErr, | ||
#[error("block accumulator get proof error")] | ||
BlockAccumulatorGetProofErr, | ||
#[error("block accumulator proof verify error")] | ||
BlockAccumulatorVerifyErr(HashValue, u64), | ||
#[error("block chain state read or write error:{0:?}")] | ||
BlockChainStateErr(anyhow::Error), | ||
#[error("block accumulator flush error")] | ||
BlockAccumulatorFlushErr, | ||
#[error("block transaction execute error, {0:?}")] | ||
BlockTransactionExecuteErr(anyhow::Error), | ||
// service error | ||
#[error("account error, {0:?}")] | ||
AccountError(anyhow::Error), | ||
#[error("other error: {0:?}")] | ||
OtherError(Box<dyn Error + Send + Sync + 'static>), | ||
#[error("block transaction execute Retry error")] | ||
BlockExecuteRetryErr, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,18 @@ | ||
// Copyright (c) The Starcoin Core Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use starcoin_crypto::HashValue; | ||
use starcoin_vm_types::vm_status::DiscardedVMStatus; | ||
use std::error::Error; | ||
use thiserror::Error; | ||
mod block_executor; | ||
|
||
pub type ExecutorResult<T> = anyhow::Result<T, BlockExecutorError>; | ||
pub use block_executor::*; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum BlockExecutorError { | ||
#[error("block transaction execute discard, status:{0:?}, transaction_id: {1}")] | ||
BlockTransactionDiscard(DiscardedVMStatus, HashValue), | ||
#[error("block transaction accumulator append error")] | ||
BlockAccumulatorAppendErr, | ||
#[error("block accumulator get proof error")] | ||
BlockAccumulatorGetProofErr, | ||
#[error("block accumulator proof verify error")] | ||
BlockAccumulatorVerifyErr(HashValue, u64), | ||
#[error("block chain state read or write error:{0:?}")] | ||
BlockChainStateErr(anyhow::Error), | ||
#[error("block accumulator flush error")] | ||
BlockAccumulatorFlushErr, | ||
#[error("block transaction execute error, {0:?}")] | ||
BlockTransactionExecuteErr(anyhow::Error), | ||
// service error | ||
#[error("account error, {0:?}")] | ||
AccountError(anyhow::Error), | ||
#[error("other error: {0:?}")] | ||
OtherError(Box<dyn Error + Send + Sync + 'static>), | ||
#[error("block transaction execute Retry error")] | ||
BlockExecuteRetryErr, | ||
/// The system is not in a state where the operation can be performed (http: 400) | ||
pub const INVALID_STATE: u64 = 0x3; | ||
|
||
/// Construct a canonical error code from a category and a reason. | ||
pub fn canonical(category: u64, reason: u64) -> u64 { | ||
(category << 16) + reason | ||
} | ||
|
||
pub fn invalid_state(r: u64) -> u64 { | ||
canonical(INVALID_STATE, r) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.