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

deps: bump some dependencies and rust version #72

Merged
merged 3 commits into from
Aug 23, 2024
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
1,433 changes: 358 additions & 1,075 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ simple = ["toml"]
advanced = ["near-chain-configs"]

[dependencies]
aurora-engine-precompiles = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.3", features = ["std"] }
aurora-engine-sdk = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.3", features = ["std"] }
aurora-engine-transactions = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.3", features = ["std"] }
aurora-engine-types = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.3", features = ["std", "impl-serde"] }
aurora-engine-precompiles = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.4", features = ["std"] }
aurora-engine-sdk = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.4", features = ["std"] }
aurora-engine-transactions = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.4", features = ["std"] }
aurora-engine-types = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.4", features = ["std", "impl-serde"] }

anyhow = "1"
borsh = "1"
Expand All @@ -32,20 +32,20 @@ ethabi = "18"
hex = "0.4"
lazy_static = "1"
libsecp256k1 = { version = "0.7", features = ["std"] }
near-chain-configs = { version = "0.23", optional = true }
near-crypto = "0.23"
near-jsonrpc-client = "0.10"
near-jsonrpc-primitives = "0.23"
near-primitives = "0.23"
near-chain-configs = { version = "0.25", optional = true }
near-crypto = "0.25"
near-jsonrpc-client = "0.12"
near-jsonrpc-primitives = "0.25"
near-primitives = "0.25"
reqwest = { version = "0.12", features = ["json"] }
rand = "0.8"
rlp = "0.5"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = { version = "0.8", optional = true }
shadow-rs = "0.29"
shadow-rs = "0.33"
thiserror = "1"
tokio = { version = "1", features = ["full"] }

[build-dependencies]
shadow-rs = "0.29"
shadow-rs = "0.33"
Binary file modified docs/res/aurora-mainnet-silo.wasm
100755 → 100644
Binary file not shown.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.75.0"
channel = "1.80.0"
components = [ "clippy", "rustfmt" ]
16 changes: 16 additions & 0 deletions scripts/simple-silo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ aurora-cli --engine $ENGINE_ACCOUNT init \
--ft-metadata-path docs/res/ft_metadata.json || error_exit
sleep 2

# Prerequisites for the start-hashchain command: Change the key manager of ENGINE_ACCOUNT to ENGINE_ACCOUNT
aurora-cli --engine $ENGINE_ACCOUNT set-key-manager $ENGINE_ACCOUNT || error_exit
wait_for_block

# Prerequisites for the start-hashchain command: The contract must be paused
aurora-cli --engine $ENGINE_ACCOUNT pause-contract
wait_for_block

# Start Hashchain. The aurora-engine will resume the contract automatically
aurora-cli --engine $ENGINE_ACCOUNT start-hashchain --block-height 0 --block-hashchain 0000000000000000000000000000000000000000000000000000000000000000
wait_for_block

# Set eth connector params
aurora-cli --engine $ENGINE_ACCOUNT set-eth-connector-contract-account --account-id 0f2bb8ad44996a7762256477fe3b42b27e63a00d.factory.bridge.near --withdraw-ser borsh
wait_for_block

# Silo methods
# Get fixed gas
result=$(aurora-cli --engine $ENGINE_ACCOUNT get-fixed-gas || error_exit)
Expand Down
6 changes: 3 additions & 3 deletions src/cli/advanced/near.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub enum WriteCommand {
#[clap(short, long)]
wasm_path: String,
/// Unique identifier for the chain. The default value is 1313161556 (Aurora localnet).
/// See https://chainlist.org/ for a list of taken chain IDs.
/// See [chainlist](https://chainlist.org/) for a list of taken chain IDs.
#[clap(short, long)]
chain_id: Option<u64>,
/// Near account ID for the owner of the Engine contract.
Expand All @@ -167,8 +167,8 @@ pub enum WriteCommand {
eth_custodian_address: Option<String>,
/// The metadata for the ETH token the connector creates.
/// The value is expected to be a value JSON string
/// (see https://nomicon.io/Standards/Tokens/FungibleToken/Metadata for fields).
/// The default value is 18 decimals with name and symbol equal to "localETH".
/// (see [FT metadata](https://nomicon.io/Standards/Tokens/FungibleToken/Metadata)
/// for fields). The default value is 18 decimals with name and symbol equal to "localETH".
#[clap(short, long)]
ft_metadata: Option<String>,
},
Expand Down
14 changes: 7 additions & 7 deletions src/cli/simple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Cli {
pub enum Command {
/// Create new NEAR account
CreateAccount {
/// AccountId
/// `AccountId`
#[arg(long, short)]
account: String,
/// Initial account balance in NEAR
Expand All @@ -53,7 +53,7 @@ pub enum Command {
},
/// View NEAR account
ViewAccount {
/// AccountId
/// `AccountId`
account: String,
},
/// Deploy Aurora EVM smart contract
Expand Down Expand Up @@ -213,9 +213,9 @@ pub enum Command {
#[arg(long)]
seed: Option<u64>,
},
/// Return randomly generated NEAR key for AccountId
/// Return randomly generated NEAR key for `AccountId`
GenerateNearKey {
/// AccountId
/// `AccountId`
account_id: String,
/// Key type: ed25519 or secp256k1
key_type: KeyType,
Expand All @@ -224,12 +224,12 @@ pub enum Command {
GetFixedGas,
/// Set fixed gas
SetFixedGas {
/// Fixed gas in EthGas.
/// Fixed gas in `EthGas`.
cost: u64,
},
/// Set SILO params.
SetSiloParams {
/// Fixed gas in EthGas.
/// Fixed gas in `EthGas`.
#[arg(long, short)]
gas: u64,
/// Fallback EVM address.
Expand Down Expand Up @@ -275,7 +275,7 @@ pub enum Command {
},
/// Set relayer key manager
SetKeyManager {
/// AccountId of the key manager
/// `AccountId` of the key manager
#[arg(value_parser = parse_account_id)]
account_id: Option<AccountId>,
},
Expand Down
1 change: 1 addition & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl Client {

#[cfg(feature = "advanced")]
#[derive(Debug)]
#[allow(dead_code)]
pub enum TransactionOutcome {
Result(SubmitResult),
Failure(near_primitives::errors::TxExecutionError),
Expand Down
14 changes: 8 additions & 6 deletions src/client/near.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use aurora_engine_types::{
types::{Address, Wei},
U256,
};
use near_crypto::InMemorySigner;
use near_crypto::{InMemorySigner, Signer};
use near_jsonrpc_client::{
methods::broadcast_tx_commit::RpcBroadcastTxCommitRequest, AsUrl, JsonRpcClient,
};
Expand Down Expand Up @@ -265,10 +265,11 @@ impl NearClient {
signed_transaction: SignedTransaction::from_actions(
nonce,
signer.account_id.clone(),
self.engine_account_id.as_str().parse().unwrap(),
&signer,
self.engine_account_id.as_str().parse()?,
&Signer::InMemory(signer),
actions,
block_hash,
0,
),
};
let response = self.client.call(request).await?;
Expand All @@ -294,7 +295,7 @@ impl NearClient {
new_account_id,
initial_balance,
new_key_pair.public_key(),
&signer,
&Signer::InMemory(signer),
block_hash,
),
}
Expand All @@ -305,7 +306,7 @@ impl NearClient {
nonce,
signer.account_id.clone(),
contract_id,
&signer,
&Signer::InMemory(signer),
initial_balance,
"create_account".to_string(),
serde_json::json!({
Expand Down Expand Up @@ -357,11 +358,12 @@ impl NearClient {
nonce,
signer.account_id.clone(),
signer.account_id.clone(),
&signer,
&Signer::InMemory(signer),
vec![Action::DeployContract(
near_primitives::transaction::DeployContractAction { code },
)],
block_hash,
0,
),
};

Expand Down
2 changes: 1 addition & 1 deletion src/transaction_reader/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Aggregator for GroupByFlatStatus {
(FlatTxStatus::Reverted, 0),
(FlatTxStatus::GasLimit, 0),
(FlatTxStatus::IncorrectNonce, 0),
(FlatTxStatus::Other, 0),
(FlatTxStatus::Other(String::new()), 0),
];
init_data.into_iter().collect()
};
Expand Down
8 changes: 4 additions & 4 deletions src/transaction_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,25 @@ enum TxStatus {
Other(String),
}

#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub enum FlatTxStatus {
Succeeded,
Reverted,
GasLimit,
IncorrectNonce,
Other,
Other(String),
}

impl TxStatus {
const fn flatten(&self) -> FlatTxStatus {
fn flatten(&self) -> FlatTxStatus {
match self {
Self::Executed(result) => match result.status {
TransactionStatus::Succeed(_) => FlatTxStatus::Succeeded,
_ => FlatTxStatus::Reverted,
},
Self::GasLimit => FlatTxStatus::GasLimit,
Self::IncorrectNonce => FlatTxStatus::IncorrectNonce,
Self::Other(_) => FlatTxStatus::Other,
Self::Other(msg) => FlatTxStatus::Other(msg.clone()),
}
}
}
Loading