Skip to content

Commit

Permalink
fixing naming
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Mar 7, 2024
1 parent f08adc5 commit 0af5f3d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/allocation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,11 @@ jobs:
run: |
[ $(erc20_processor balance | jq -r ".\"$ETH_ADDRESS_1\".tokenDecimal") == "1000" ]
- name: Deposit 800.0 GLM tokens
run: |
erc20_processor deposit --account-no 1 --amount 800
erc20_processor run
erc20_processor balance
- name: Create deposit
run: |
set -x
erc20_processor make-deposit --account-no 1 --amount 1 --fee-amount 0.1 --block-for 0 --spender $ETH_ADDRESS_2 --deposit-id $DEPOSIT_ID0 --use-internal
erc20_processor make-deposit --account-no 1 --amount 1 --fee-amount 0.1 --block-for 1000 --spender $ETH_ADDRESS_2 --deposit-id $DEPOSIT_ID1 --use-internal
erc20_processor create-deposit --account-no 1 --amount 1 --fee-amount 0.1 --block-for 0 --spender $ETH_ADDRESS_2 --deposit-id $DEPOSIT_ID0 --use-internal
erc20_processor create-deposit --account-no 1 --amount 1 --fee-amount 0.1 --block-for 1000 --spender $ETH_ADDRESS_2 --deposit-id $DEPOSIT_ID1 --use-internal
erc20_processor run
- name: Check token balance zero
Expand Down
4 changes: 2 additions & 2 deletions crates/erc20_payment_lib/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ pub async fn cancel_deposit(
Ok(())
}

pub struct MakeDepositOptionsInt {
pub struct CreateDepositOptionsInt {
pub lock_contract_address: Address,
pub spender: Address,
pub skip_balance_check: bool,
Expand All @@ -1204,7 +1204,7 @@ pub async fn make_deposit(
chain_id: u64,
from: Address,
glm_address: Address,
opt: MakeDepositOptionsInt,
opt: CreateDepositOptionsInt,
) -> Result<(), PaymentError> {
let amount = if let Some(amount) = opt.amount {
amount.to_u256_from_eth().map_err(err_from!())?
Expand Down
8 changes: 4 additions & 4 deletions src/actions/create_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::actions::check_address_name;
use erc20_payment_lib::config::Config;
use erc20_payment_lib::eth::{deposit_id_from_nonce, check_allowance};
use erc20_payment_lib::process_allowance;
use erc20_payment_lib::runtime::{make_deposit, MakeDepositOptionsInt};
use erc20_payment_lib::runtime::{make_deposit, CreateDepositOptionsInt};
use erc20_payment_lib::setup::PaymentSetup;
use erc20_payment_lib::signer::PrivateKeySigner;
use erc20_payment_lib::utils::DecimalConvExt;
Expand All @@ -18,7 +18,7 @@ use web3::types::{Address, U256};

#[derive(StructOpt)]
#[structopt(about = "Allocate funds for use by payer")]
pub struct MakeDepositOptions {
pub struct CreateDepositOptions {
#[structopt(short = "c", long = "chain-name", default_value = "holesky")]
pub chain_name: String,

Expand Down Expand Up @@ -80,7 +80,7 @@ pub struct MakeDepositOptions {

pub async fn make_deposit_local(
conn: SqlitePool,
make_deposit_options: MakeDepositOptions,
make_deposit_options: CreateDepositOptions,
config: Config,
public_addrs: &[Address],
signer: PrivateKeySigner,
Expand Down Expand Up @@ -196,7 +196,7 @@ pub async fn make_deposit_local(
chain_cfg.chain_id as u64,
public_addr,
chain_cfg.token.address,
MakeDepositOptionsInt {
CreateDepositOptionsInt {
lock_contract_address: chain_cfg
.lock_contract
.clone()
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn main_internal() -> Result<(), PaymentError> {
PaymentCommands::CheckRpc { .. } => {}
PaymentCommands::GetDevEth { .. } => {}
PaymentCommands::MintTestTokens { .. } => {}
PaymentCommands::MakeDeposit { .. } => {}
PaymentCommands::CreateDeposit { .. } => {}
PaymentCommands::CancelDeposit { .. } => {}
PaymentCommands::CheckDeposit { .. } => {}
PaymentCommands::Transfer { .. } => {}
Expand Down Expand Up @@ -350,7 +350,7 @@ async fn main_internal() -> Result<(), PaymentError> {
)
.await?;
}
PaymentCommands::MakeDeposit {
PaymentCommands::CreateDeposit {
make_deposit_options,
} => {
make_deposit_local(
Expand Down
6 changes: 3 additions & 3 deletions src/options.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{fmt::Debug, path::PathBuf};

use crate::actions::cancel_deposit::CancelDepositOptions;
use crate::actions::create_deposit::MakeDepositOptions;
use crate::actions::create_deposit::CreateDepositOptions;
use erc20_payment_lib_extra::{BalanceOptions, GenerateOptions};
use structopt::StructOpt;
use web3::types::Address;
Expand Down Expand Up @@ -394,9 +394,9 @@ pub enum PaymentCommands {
#[structopt(flatten)]
mint_test_tokens_options: MintTestTokensOptions,
},
MakeDeposit {
CreateDeposit {
#[structopt(flatten)]
make_deposit_options: MakeDepositOptions,
make_deposit_options: CreateDepositOptions,
},
CancelDeposit {
#[structopt(flatten)]
Expand Down

0 comments on commit 0af5f3d

Please sign in to comment.