Skip to content

Commit

Permalink
Change partial_billed_amount to partially_billed_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Aug 15, 2024
1 parent 7de554d commit a64f5b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions clients/tfchain-client-go/contract_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ type ContractGracePeriodElapsed struct {
}

type ContractPaymentOverdrafted struct {
Phase types.Phase
ContractID types.U64 `json:"contract_id"`
Timestamp types.U64 `json:"timestamp"`
PartialBilledAmount types.U128 `json:"partial_billed_amount"`
OverdraftedAmount types.U128 `json:"overdrafted_amount"`
Topics []types.Hash
Phase types.Phase
ContractID types.U64 `json:"contract_id"`
Timestamp types.U64 `json:"timestamp"`
PartiallyBilledAmount types.U128 `json:"partially_billed_amount"`
OverdraftedAmount types.U128 `json:"overdrafted_amount"`
Topics []types.Hash
}

type RewardDistributed struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl<T: Config> Pallet<T> {
contract_id: contract.contract_id,
timestamp: now,
// This is the partial amount successfully reserved from the user's account in this billing cycle
partial_billed_amount: reservable,
partially_billed_amount: reservable,
// This is the total overdrafted amount for this contract since grace period started
overdrafted_amount: contract_payment_state.get_overdrafted(),
});
Expand Down
6 changes: 4 additions & 2 deletions substrate-node/pallets/pallet-smart-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub mod pallet {
use frame_support::{
pallet_prelude::*,
traits::{
tokens::fungible::*, Currency, Get, Hooks, LockableCurrency,
tokens::fungible::*, Currency, Get, Hooks, LockIdentifier, LockableCurrency,
OnUnbalanced, ReservableCurrency,
},
};
Expand All @@ -86,6 +86,8 @@ pub mod pallet {
<<T as Config>::Currency as Currency<<T as system::Config>::AccountId>>::Balance;
pub type NegativeImbalanceOf<T> =
<<T as Config>::Currency as Currency<<T as system::Config>::AccountId>>::NegativeImbalance;
pub const GRID_LOCK_ID: LockIdentifier = *b"gridlock";

use tfchain_support::types::PublicIP;

#[pallet::pallet]
Expand Down Expand Up @@ -350,7 +352,7 @@ pub mod pallet {
ContractPaymentOverdrafted {
contract_id: u64,
timestamp: u64,
partial_billed_amount: BalanceOf<T>, // amount billed
partially_billed_amount: BalanceOf<T>, // amount billed
overdrafted_amount: BalanceOf<T>, // amount overdrafted
},
// RewardDistributed
Expand Down

0 comments on commit a64f5b7

Please sign in to comment.