-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
110 additions
and
107 deletions.
There are no files selected for viewing
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,84 +1,3 @@ | ||
// Copyright (c) The Starcoin Core Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pub mod account; | ||
pub mod hash; | ||
pub mod signature; | ||
pub mod token; | ||
pub mod u256; | ||
// for support evm compat and cross chain. | ||
pub mod ecrecover; | ||
pub mod from_bcs; | ||
pub mod secp256k1; | ||
|
||
mod helpers; | ||
pub mod util; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct GasParameters { | ||
pub account: account::GasParameters, | ||
pub hash: hash::GasParameters, | ||
pub signature: signature::GasParameters, | ||
pub token: token::GasParameters, | ||
pub u256: u256::GasParameters, | ||
pub secp256k1: secp256k1::GasParameters, | ||
pub from_bcs: from_bcs::GasParameters, | ||
} | ||
|
||
impl GasParameters { | ||
pub fn zeros() -> Self { | ||
Self { | ||
account: account::GasParameters { | ||
create_signer: account::CreateSignerGasParameters { base: 0.into() }, | ||
destroy_signer: account::DestroySignerGasParameters { base: 0.into() }, | ||
}, | ||
hash: hash::GasParameters { | ||
keccak256: hash::Keccak256HashGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
ripemd160: hash::Ripemd160HashGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
}, | ||
signature: signature::GasParameters { | ||
ed25519_validate_key: signature::Ed25519ValidateKeyGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
ed25519_verify: signature::Ed25519VerifyGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
ec_recover: ecrecover::EcrecoverGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
}, | ||
token: token::GasParameters { | ||
name_of: token::NameOfGasParameters { base: 0.into() }, | ||
}, | ||
u256: u256::GasParameters { | ||
add: u256::U256AddGasParameters { base: 0.into() }, | ||
sub: u256::U256SubGasParameters { base: 0.into() }, | ||
mul: u256::U256MulGasParameters { base: 0.into() }, | ||
div: u256::U256DivGasParameters { base: 0.into() }, | ||
rem: u256::U256RemGasParameters { base: 0.into() }, | ||
pow: u256::U256PowGasParameters { base: 0.into() }, | ||
from_bytes: u256::U256FromBytesGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
}, | ||
secp256k1: secp256k1::GasParameters { | ||
base: 0.into(), | ||
ecdsa_recover: 0.into(), | ||
}, | ||
from_bcs: from_bcs::GasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
} | ||
} | ||
} | ||
// ref aptos-core/aptos-move/framework/src/lib.rs | ||
pub mod natives; |
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
File renamed without changes.
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
File renamed without changes.
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,84 @@ | ||
// Copyright (c) The Starcoin Core Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pub mod account; | ||
pub mod hash; | ||
pub mod signature; | ||
pub mod token; | ||
pub mod u256; | ||
// for support evm compat and cross chain. | ||
pub mod ecrecover; | ||
pub mod from_bcs; | ||
pub mod secp256k1; | ||
|
||
mod helpers; | ||
pub mod util; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct GasParameters { | ||
pub account: account::GasParameters, | ||
pub hash: hash::GasParameters, | ||
pub signature: signature::GasParameters, | ||
pub token: token::GasParameters, | ||
pub u256: u256::GasParameters, | ||
pub secp256k1: secp256k1::GasParameters, | ||
pub from_bcs: from_bcs::GasParameters, | ||
} | ||
|
||
impl GasParameters { | ||
pub fn zeros() -> Self { | ||
Self { | ||
account: account::GasParameters { | ||
create_signer: account::CreateSignerGasParameters { base: 0.into() }, | ||
destroy_signer: account::DestroySignerGasParameters { base: 0.into() }, | ||
}, | ||
hash: hash::GasParameters { | ||
keccak256: hash::Keccak256HashGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
ripemd160: hash::Ripemd160HashGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
}, | ||
signature: signature::GasParameters { | ||
ed25519_validate_key: signature::Ed25519ValidateKeyGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
ed25519_verify: signature::Ed25519VerifyGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
ec_recover: ecrecover::EcrecoverGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
}, | ||
token: token::GasParameters { | ||
name_of: token::NameOfGasParameters { base: 0.into() }, | ||
}, | ||
u256: u256::GasParameters { | ||
add: u256::U256AddGasParameters { base: 0.into() }, | ||
sub: u256::U256SubGasParameters { base: 0.into() }, | ||
mul: u256::U256MulGasParameters { base: 0.into() }, | ||
div: u256::U256DivGasParameters { base: 0.into() }, | ||
rem: u256::U256RemGasParameters { base: 0.into() }, | ||
pow: u256::U256PowGasParameters { base: 0.into() }, | ||
from_bytes: u256::U256FromBytesGasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
}, | ||
secp256k1: secp256k1::GasParameters { | ||
base: 0.into(), | ||
ecdsa_recover: 0.into(), | ||
}, | ||
from_bcs: from_bcs::GasParameters { | ||
base: 0.into(), | ||
per_byte: 0.into(), | ||
}, | ||
} | ||
} | ||
} |
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
File renamed without changes.
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