Skip to content

Commit

Permalink
more fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
kamirr committed Sep 2, 2023
1 parent 874945e commit 85a5c9d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion core/payment/src/api/allocations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async fn amend_allocation(
let validate_msg = ValidateAllocation {
platform: amended_allocation.payment_platform.clone(),
address: amended_allocation.address.clone(),
amount: if &amount_to_validate > &BigDecimal::from(0) {
amount: if amount_to_validate > BigDecimal::from(0) {
amount_to_validate
} else {
0.into()
Expand Down
35 changes: 28 additions & 7 deletions exe-unit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ path = "src/bin.rs"
[features]
default = ['compat-deployment']
compat-deployment = []
sgx = ['graphene-sgx', 'openssl/vendored', 'reqwest/trust-dns', 'secp256k1/rand', 'ya-client-model/sgx', 'ya-core-model/sgx']
sgx = [
'graphene-sgx',
'openssl/vendored',
'reqwest/trust-dns',
'secp256k1/rand',
'ya-client-model/sgx',
'ya-core-model/sgx',
]
packet-trace-enable = ["ya-packet-trace/enable"]

[target.'cfg(target_family = "unix")'.dependencies]
Expand All @@ -34,12 +41,17 @@ ya-manifest-utils = { version = "0.2" }
ya-client-model = "0.5"
ya-compile-time-utils = "0.2"
ya-core-model = { version = "^0.9", features = ["activity", "appkey"] }
ya-runtime-api = { version = "0.7", path = "runtime-api", features = ["server"] }
ya-runtime-api = { version = "0.7", path = "runtime-api", features = [
"server",
] }
ya-service-bus = "0.6.1"
ya-transfer = "0.3"
ya-utils-path = "0.1"
ya-std-utils = "0.1"
ya-utils-networking = { version = "0.2", default-features = false, features = ["dns", "vpn"]}
ya-utils-networking = { version = "0.2", default-features = false, features = [
"dns",
"vpn",
] }
ya-packet-trace = { git = "https://github.com/golemfactory/ya-packet-trace" }

actix = { version = "0.13", default-features = false }
Expand All @@ -59,10 +71,10 @@ ipnet = "2.3"
lazy_static = "1.4.0"
log = "0.4"
openssl = { version = "0.10", optional = true }
rand = "0.6"
rand = "0.8.5"
regex = "1.5"
reqwest = { version = "0.11", optional = true }
secp256k1 = { version = "0.19", optional = true }
secp256k1 = { version = "0.27.0", optional = true }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.8"
Expand All @@ -72,14 +84,23 @@ socket2 = "0.4"
structopt = "0.3"
thiserror = "1.0"
# keep the "rt-multi-thread" feature
tokio = { version = "1", features = ["process", "signal", "time", "net", "rt-multi-thread"] }
tokio = { version = "1", features = [
"process",
"signal",
"time",
"net",
"rt-multi-thread",
] }
tokio-util = { version = "0.7.2", features = ["codec", "net"] }
tokio-stream = "0.1.6"
url = "2.1"
yansi = "0.5.0"

[dev-dependencies]
ya-runtime-api = { version = "0.7", path = "runtime-api", features = ["codec", "server"] }
ya-runtime-api = { version = "0.7", path = "runtime-api", features = [
"codec",
"server",
] }
ya-sb-router = "0.6.1"

actix-files = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion exe-unit/examples/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn create_file(path: &Path, name: &str, chunk_size: usize, chunk_count: usize) -

for _ in 0..chunk_count {
let input: Vec<u8> = (0..chunk_size)
.map(|_| rng.gen_range(0, 256) as u8)
.map(|_| rng.gen_range(0..256) as u8)
.collect();

hasher.input(&input);
Expand Down
2 changes: 1 addition & 1 deletion exe-unit/examples/transfer_abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn create_file(path: &PathBuf) {

let mut rng = rand::thread_rng();
let input: Vec<u8> = (0..CHUNK_SIZE)
.map(|_| rng.gen_range(0, 256) as u8)
.map(|_| rng.gen_range(0..256) as u8)
.collect();

for _ in 0..CHUNK_COUNT {
Expand Down
2 changes: 1 addition & 1 deletion exe-unit/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Crypto {
let ec = Secp256k1::new();
let hash = sha3::Sha3_256::digest(data.as_ref());
let msg = Message::from_slice(hash.as_slice())?;
let sig = ec.sign(&msg, &self.sec_key).serialize_der();
let sig = ec.sign_ecdsa(&msg, &self.sec_key).serialize_der();
Ok(sig.as_ref().to_vec())
}
}

0 comments on commit 85a5c9d

Please sign in to comment.