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

Test payment syncs #3288

Merged
merged 23 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f62064f
Restore test_payment_sync
nieznanysprawiciel Aug 7, 2024
75d6500
Merge branch 'test-environment-identity-with-base-gsb-address' of git…
nieznanysprawiciel Aug 9, 2024
ce39e82
Send Accept Invoice to FakePayment
nieznanysprawiciel Aug 9, 2024
af87391
Merge branch 'master' into test-payment-sync
nieznanysprawiciel Aug 9, 2024
83106c2
FakePayment - override GSB bindings and message channel
nieznanysprawiciel Aug 9, 2024
c4239c3
Document GSB message capture channels in tutorial
nieznanysprawiciel Aug 9, 2024
f3c64c1
Payments test env: breaking network; Test payment sync
nieznanysprawiciel Sep 2, 2024
934a0e6
Fix unit tests
nieznanysprawiciel Sep 3, 2024
03992b3
Test Payment confirmation sync delivery
nieznanysprawiciel Sep 3, 2024
9a3cef2
Fix payment sync identites loop. Fix test
nieznanysprawiciel Sep 3, 2024
fba48bc
Send payment confirmation per owner id
nieznanysprawiciel Sep 4, 2024
d938e7f
Test payment sync with fallback mechanism
nieznanysprawiciel Sep 4, 2024
88a39f8
Test delayed invoice acceptance; Send acceptance event if status is S…
nieznanysprawiciel Sep 4, 2024
0392764
Payment confirmation (not sync) checks if endpoint is avaiable the sa…
nieznanysprawiciel Sep 4, 2024
d66b31e
Test delayed DebitNotes acceptance
nieznanysprawiciel Sep 4, 2024
1445136
Merge branch 'master' of github.com:golemfactory/yagna into test-paym…
nieznanysprawiciel Sep 5, 2024
d8dff86
Fix inability to update ya-client{-model} to newer version dues to co…
nieznanysprawiciel Sep 5, 2024
c12fee9
Test payment signature (in middle of the work)
nieznanysprawiciel Sep 5, 2024
bcb1399
Merge branch 'master' into test-payment-sync
nieznanysprawiciel Sep 5, 2024
e3eca36
Test payment signatures (different rejection scenarios); Introduce Si…
nieznanysprawiciel Sep 5, 2024
4f0348d
Use Signable trait to handle signatures using single code
nieznanysprawiciel Sep 5, 2024
02cd9f6
Fix SGX tests and clippy
nieznanysprawiciel Sep 6, 2024
268eb79
Merge branch 'master' of github.com:golemfactory/yagna into test-paym…
nieznanysprawiciel Sep 10, 2024
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
45 changes: 23 additions & 22 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ya-fd-metrics = { path = "utils/fd-metrics" }
ya-version = "0.2"
ya-vpn = "0.2"
ya-client = "0.8"
ya-client-model = "0.6"
ya-client-model = "0.7"
gftp = { workspace = true, optional = true }
# just to enable gftp build for cargo-deb
ya-provider = { version = "0.3", optional = true } # just to enable conditionally running some tests
Expand Down Expand Up @@ -251,7 +251,7 @@ url = "2.3.1"
regex = "1.10.4"

ya-agreement-utils = { version = "0.6", path = "utils/agreement-utils" }
ya-relay-client = { git = "https://github.com/golemfactory/ya-relay.git", rev = "0588dd1af311ae19c621b04cc2a4cfd9c0483252" }
ya-relay-client = { git = "https://github.com/golemfactory/ya-relay.git", rev = "e199ee1cfdb22837f9d95f4202378e182d3cb489" }
ya-relay-stack = { git = "https://github.com/golemfactory/ya-relay.git", rev = "c92a75b0cf062fcc9dbb3ea2a034d913e5fad8e5" }
ya-utils-futures = { path = "utils/futures" }

Expand Down Expand Up @@ -287,11 +287,11 @@ ya-service-api-interfaces = { path = "core/serv-api/interfaces" }
ya-service-api-web = { path = "core/serv-api/web" }

## CLIENT
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "fbb15b49f8b9635cf3c3e2351ba6a9879f3b62d1" }
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "258d5e085e591cab33858e8d1b19eff01b64687d" }
#ya-client = { path = "../ya-client" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "fbb15b49f8b9635cf3c3e2351ba6a9879f3b62d1" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "258d5e085e591cab33858e8d1b19eff01b64687d" }
#ya-client-model = { path = "../ya-client/model" }
golem-certificate = { git = "https://github.com/golemfactory/golem-certificate.git", rev = "f2d7514c18fc066e9cfb796090b90f5b27cfe1c6" }
golem-certificate = { git = "https://github.com/golemfactory/golem-certificate.git", rev = "800d710331cdf3bf82f2be5de8345b90b6982af1" }

## RELAY and networking stack

Expand Down
2 changes: 1 addition & 1 deletion agent/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/main.rs"
ya-agreement-utils = { workspace = true }
ya-manifest-utils = { version = "0.2" }
ya-client = { version = "0.8", features = ['cli'] }
ya-client-model = "0.6"
ya-client-model = "0.7"
ya-compile-time-utils = "0.2"
ya-core-model = { version = "^0.9", features = ['activity', 'payment'] }
ya-file-logging = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion core/activity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
ya-core-model = { version = "0.9", features = ["activity", "market"] }
ya-client-model = { version = "0.6", features = ["sgx"] }
ya-client-model = { version = "0.7", features = ["sgx"] }
ya-net = "0.3"
ya-persistence = "0.3"
ya-service-api = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion core/gsb-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Golem Factory <[email protected]>"]
edition = "2018"

[dependencies]
ya-client-model = "0.6"
ya-client-model = "0.7"
ya-persistence = "0.3"
ya-service-api = "0.1"
ya-service-api-interfaces = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion core/identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ framework-test = []


[dependencies]
ya-client-model = { version = "0.6", features = ["with-diesel"] }
ya-client-model = { version = "0.7", features = ["with-diesel"] }
ya-core-model = { version = "^0.9", features = ["identity", "appkey"] }
ya-persistence = "0.3"
ya-service-api = "0.1"
Expand Down
10 changes: 6 additions & 4 deletions core/model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ gftp = []
identity = []
market = []
net = []
payment = ['bigdecimal', 'bitflags']
payment = ['bigdecimal', 'bitflags', 'anyhow', 'serde_json_canonicalizer', 'sha3']
sgx = ['graphene-sgx']
version = []

[dependencies]
ya-client-model = "0.6"
ya-client-model = "0.7"
ya-service-bus = { workspace = true }

anyhow = { version = "1.0", optional = true }
bigdecimal = { version = "0.2", features = ["serde"], optional = true }
bitflags = { version = "1.2", optional = true }
chrono = { version = "0.4", features = ["serde"] }
Expand All @@ -35,10 +36,11 @@ graphene-sgx = { version = "0.3.3", optional = true }
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11.3"
serde_json_canonicalizer = { version = "0.2.0", optional = true }
serde_json = "1.0.113"
sha3 = { version = "0.9", optional = true }
structopt = "0.3"
strum = { workspace = true }
strum_macros = "0.24"
thiserror = "1.0.9"
serde_json_canonicalizer = "0.2.0"
serde_json = "1.0.113"

6 changes: 3 additions & 3 deletions core/model/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,15 +587,15 @@ impl RpcMessage for crate::driver::SignPaymentCanonicalized {
pub struct VerifySignature {
pub payment: Payment,
pub signature: Vec<u8>,
pub canonicalized: bool,
pub canonical: Option<Vec<u8>>,
}

impl VerifySignature {
pub fn new(payment: Payment, signature: Vec<u8>, canonicalized: bool) -> Self {
pub fn new(payment: Payment, signature: Vec<u8>, canonical: Option<Vec<u8>>) -> Self {
Self {
payment,
signature,
canonicalized,
canonical,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub mod net;

#[cfg(feature = "payment")]
pub mod payment;
#[cfg(feature = "payment")]
pub mod signable;

#[cfg(feature = "gftp")]
pub mod gftp;
Expand Down
11 changes: 8 additions & 3 deletions core/model/src/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ pub mod local {

pub mod public {
use super::*;
use crate::signable::Signable;
use ya_client_model::NodeId;

pub const BUS_ID: &str = "/public/payment";
Expand Down Expand Up @@ -839,7 +840,10 @@ pub mod public {

impl SendPayment {
pub fn new(payment: Payment, signature: Vec<u8>) -> Self {
Self { payment, signature }
Self {
payment: payment.remove_private_info(),
signature,
}
}
}

Expand All @@ -861,9 +865,10 @@ pub mod public {

impl SendSignedPayment {
pub fn new(payment: Payment, signature: Vec<u8>) -> Self {
let signed_bytes = serde_json_canonicalizer::to_vec(&payment).unwrap();
// Unwrap won't happen, because serialization is always possible.
let signed_bytes = payment.canonicalize().unwrap_or_default();
Self {
payment,
payment: payment.remove_private_info(),
signature,
signed_bytes,
}
Expand Down
Loading
Loading