Skip to content

Commit

Permalink
Chore: update to borsh version 0.10 (#732)
Browse files Browse the repository at this point in the history
* Chore: update to borsh version 0.10

* Clippy fixes

* Remove redundant double negation

* Multiple clippy checks with different feature sets (all-features will no longer work)
  • Loading branch information
birchmd committed Apr 5, 2023
1 parent 553de6f commit 2f54baf
Show file tree
Hide file tree
Showing 25 changed files with 309 additions and 50 deletions.
92 changes: 69 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 50 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,53 @@ command = "${CARGO}"
args = [
"clippy",
"--all-targets",
"--all-features",
"--",
"-D",
"warnings",
"-D",
"clippy::as_conversions",
]

[tasks.clippy-contract]
category = "Check"
command = "${CARGO}"
args = [
"clippy",
"--all-targets",
"--features",
"contract",
"--",
"-D",
"warnings",
"-D",
"clippy::as_conversions",
]

[tasks.clippy-contract-refund]
category = "Check"
command = "${CARGO}"
args = [
"clippy",
"--all-targets",
"--features",
"contract,error_refund",
"--",
"-D",
"warnings",
"-D",
"clippy::as_conversions",
]

[tasks.clippy-borsh-compat]
category = "Check"
command = "${CARGO}"
args = [
"clippy",
"-p",
"aurora-engine-types",
"--all-targets",
"--features",
"borsh-compat",
"--",
"-D",
"warnings",
Expand Down Expand Up @@ -113,6 +159,9 @@ dependencies = [
"check-contracts",
"check-fmt",
"clippy",
"clippy-contract",
"clippy-contract-refund",
"clippy-borsh-compat",
"udeps",
]

Expand Down
2 changes: 1 addition & 1 deletion engine-precompiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ autobenches = false
[dependencies]
aurora-engine-types = { path = "../engine-types", default-features = false }
aurora-engine-sdk = { path = "../engine-sdk", default-features = false }
borsh = { version = "0.9.3", default-features = false }
borsh = { version = "0.10", default-features = false }
bn = { version = "0.5.11", package = "zeropool-bn", default-features = false }
evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.4-aurora", default-features = false }
libsecp256k1 = { version = "0.7.0", default-features = false, features = ["static-context", "hmac"] }
Expand Down
2 changes: 1 addition & 1 deletion engine-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ autobenches = false
aurora-engine-types = { path = "../engine-types", default-features = false }

base64 = { version = "0.21", default-features = false, features = [ "alloc" ] }
borsh = { version = "0.9", default-features = false }
borsh = { version = "0.10", default-features = false }
sha2 = { version = "0.10", default-features = false }
sha3 = { version = "0.10", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion engine-standalone-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ aurora-engine-types = { path = "../engine-types", default-features = false, feat
aurora-engine-sdk = { path = "../engine-sdk", default-features = false, features = ["std"] }
aurora-engine-transactions = { path = "../engine-transactions", default-features = false, features = ["std"] }
aurora-engine-precompiles = { path = "../engine-precompiles", default-features = false, features = ["std"] }
borsh = "0.9"
borsh = "0.10"
evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.4-aurora", default-features = false }
hex = "0.4.3"
rocksdb = { version = "0.19.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion engine-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ aurora-engine-precompiles = { path = "../engine-precompiles", default-features =
aurora-engine-transactions = { path = "../engine-transactions", default-features = false, features = ["std", "impl-serde"] }
engine-standalone-storage = { path = "../engine-standalone-storage" }
engine-standalone-tracing = { path = "../engine-standalone-tracing", default-features = false, features = ["impl-serde"] }
borsh = { version = "0.9.3", default-features = false }
borsh = { version = "0.10", default-features = false }
sha3 = { version = "0.10.2", default-features = false }
evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.4-aurora", default-features = false, features = ["std", "tracing"] }
evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.37.4-aurora", default-features = false, features = ["std", "tracing"] }
Expand Down
14 changes: 12 additions & 2 deletions engine-tests/src/tests/erc20_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,12 @@ pub mod sim_tests {
// deploy contract with simple exit to near method
let constructor = TesterConstructor::load();
let deploy_data = constructor.deploy(0, Address::zero()).data;
let submit_result: SubmitResult = aurora.call("deploy_code", &deploy_data).unwrap_borsh();
let submit_result = match aurora.call("deploy_code", &deploy_data).status() {
near_primitives::transaction::ExecutionStatus::SuccessValue(bytes) => {
SubmitResult::try_from_slice(&bytes).unwrap()
}
other => panic!("Unexpected status {other:?}"),
};
let tester_address =
Address::try_from_slice(&test_utils::unwrap_success(submit_result)).unwrap();

Expand Down Expand Up @@ -852,7 +857,12 @@ pub mod sim_tests {
input: balance_tx.data,
});
let result = aurora.call("call", &call_args.try_to_vec().unwrap());
let submit_result: SubmitResult = result.unwrap_borsh();
let submit_result = match result.status() {
near_primitives::transaction::ExecutionStatus::SuccessValue(bytes) => {
SubmitResult::try_from_slice(&bytes).unwrap()
}
other => panic!("Unexpected status {other:?}"),
};
U256::from_big_endian(&test_utils::unwrap_success(submit_result))
}

Expand Down
Loading

0 comments on commit 2f54baf

Please sign in to comment.