Skip to content

Commit

Permalink
Payments mainnet preparation fixes
Browse files Browse the repository at this point in the history
* Added missing call to `get_networks()` in driver registration.
* Changed default platform from 'ZK-NGNT' to 'zksync-rinkeby-tglm'.
* Removed upper-casing platforms (that was introduced to distinguish
  platform names from driver names which is no longer an issue since
  adopting the <driver>-<network>-<token> convention.

Signed-off-by: Adam Wierzbicki <awierzbicki@golem.network>
  • Loading branch information
Wiezzel committed Jan 13, 2021
1 parent 6d49fa2 commit 951fe9a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/payment-driver/base/src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub async fn bind_service<Driver: PaymentDriver + 'static>(
driver_name: driver.get_name(),
details: payment_srv::DriverDetails {
default_network: driver.get_default_network(),
networks: Default::default(),
networks: driver.get_networks(),
recv_init_required: driver.recv_init_required(),
},
};
Expand Down
4 changes: 1 addition & 3 deletions core/payment/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ impl PaymentCli {
}
PaymentCli::Status { address, platform } => {
let address = resolve_address(address).await?;
let platform = platform
.unwrap_or(DEFAULT_PAYMENT_PLATFORM.to_owned())
.to_uppercase();
let platform = platform.unwrap_or(DEFAULT_PAYMENT_PLATFORM.to_owned());
CommandOutput::object(
bus::service(pay::BUS_ID)
.call(pay::GetStatus { address, platform })
Expand Down
2 changes: 1 addition & 1 deletion core/payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod migrations {
struct _Dummy;
}

pub const DEFAULT_PAYMENT_PLATFORM: &str = "ZK-NGNT";
pub const DEFAULT_PAYMENT_PLATFORM: &str = "zksync-rinkeby-tglm";
pub const DEFAULT_PAYMENT_DRIVER: &str = "zksync";

pub struct PaymentService;
Expand Down
2 changes: 1 addition & 1 deletion core/payment/src/models/agreement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl WriteObj {
peer_id,
payee_addr,
payer_addr,
payment_platform: payment_platform.to_uppercase(),
payment_platform,
total_amount_due: Default::default(),
total_amount_accepted: Default::default(),
total_amount_paid: Default::default(),
Expand Down
6 changes: 6 additions & 0 deletions core/payment/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ impl DriverRegistry {
driver_name,
details,
} = msg;
log::trace!(
"register_driver: driver_name={} details={:?}",
driver_name,
details
);

if !details.networks.contains_key(&details.default_network) {
return Err(RegisterDriverError::InvalidDefaultNetwork(
details.default_network,
Expand Down

0 comments on commit 951fe9a

Please sign in to comment.