Skip to content

Commit

Permalink
Revert "chore(sql): user numeric type to represent numbers (#327)" (#358
Browse files Browse the repository at this point in the history
)

This reverts commit f0312c3.
  • Loading branch information
iand authored Jan 15, 2021
1 parent 6bd1428 commit 655e693
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 223 deletions.
2 changes: 1 addition & 1 deletion model/actors/miner/feedebt.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type MinerFeeDebt struct {
MinerID string `pg:",pk,notnull"`
StateRoot string `pg:",pk,notnull"`

FeeDebt string `pg:"type:numeric,notnull"`
FeeDebt string `pg:",notnull"`
}

func (m *MinerFeeDebt) Persist(ctx context.Context, s model.StorageBatch) error {
Expand Down
6 changes: 3 additions & 3 deletions model/actors/miner/lockedfunds.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type MinerLockedFund struct {
MinerID string `pg:",pk,notnull"`
StateRoot string `pg:",pk,notnull"`

LockedFunds string `pg:"type:numeric,notnull"`
InitialPledge string `pg:"type:numeric,notnull"`
PreCommitDeposits string `pg:"type:numeric,notnull"`
LockedFunds string `pg:",notnull"`
InitialPledge string `pg:",notnull"`
PreCommitDeposits string `pg:",notnull"`
}

func (m *MinerLockedFund) Persist(ctx context.Context, s model.StorageBatch) error {
Expand Down
6 changes: 3 additions & 3 deletions model/actors/miner/precommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type MinerPreCommitInfo struct {
SealRandEpoch int64 `pg:",use_zero"`
ExpirationEpoch int64 `pg:",use_zero"`

PreCommitDeposit string `pg:"type:numeric,notnull"`
PreCommitDeposit string `pg:",notnull"`
PreCommitEpoch int64 `pg:",use_zero"`
DealWeight string `pg:"type:numeric,notnull"`
VerifiedDealWeight string `pg:"type:numeric,notnull"`
DealWeight string `pg:",notnull"`
VerifiedDealWeight string `pg:",notnull"`

IsReplaceCapacity bool
ReplaceSectorDeadline uint64 `pg:",use_zero"`
Expand Down
10 changes: 5 additions & 5 deletions model/actors/miner/sector.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ type MinerSectorInfo struct {
ActivationEpoch int64 `pg:",use_zero"`
ExpirationEpoch int64 `pg:",use_zero"`

DealWeight string `pg:"type:numeric,notnull"`
VerifiedDealWeight string `pg:"type:numeric,notnull"`
DealWeight string `pg:",notnull"`
VerifiedDealWeight string `pg:",notnull"`

InitialPledge string `pg:"type:numeric,notnull"`
ExpectedDayReward string `pg:"type:numeric,notnull"`
ExpectedStoragePledge string `pg:"type:numeric,notnull"`
InitialPledge string `pg:",notnull"`
ExpectedDayReward string `pg:",notnull"`
ExpectedStoragePledge string `pg:",notnull"`
}

func (msi *MinerSectorInfo) Persist(ctx context.Context, s model.StorageBatch) error {
Expand Down
14 changes: 7 additions & 7 deletions model/actors/power/chainpower.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ type ChainPower struct {
Height int64 `pg:",pk,notnull,use_zero"`
StateRoot string `pg:",pk"`

TotalRawBytesPower string `pg:"type:numeric,notnull"`
TotalQABytesPower string `pg:"type:numeric,notnull"`
TotalRawBytesPower string `pg:",notnull"`
TotalQABytesPower string `pg:",notnull"`

TotalRawBytesCommitted string `pg:"type:numeric,notnull"`
TotalQABytesCommitted string `pg:"type:numeric,notnull"`
TotalRawBytesCommitted string `pg:",notnull"`
TotalQABytesCommitted string `pg:",notnull"`

TotalPledgeCollateral string `pg:"type:numeric,notnull"`
TotalPledgeCollateral string `pg:",notnull"`

QASmoothedPositionEstimate string `pg:"type:numeric,notnull"`
QASmoothedVelocityEstimate string `pg:"type:numeric,notnull"`
QASmoothedPositionEstimate string `pg:",notnull"`
QASmoothedVelocityEstimate string `pg:",notnull"`

MinerCount uint64 `pg:",use_zero"`
ParticipatingMinerCount uint64 `pg:",use_zero"`
Expand Down
4 changes: 2 additions & 2 deletions model/actors/power/claimedpower.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type PowerActorClaim struct {
Height int64 `pg:",pk,notnull,use_zero"`
MinerID string `pg:",pk,notnull"`
StateRoot string `pg:",pk,notnull"`
RawBytePower string `pg:"type:numeric,notnull"`
QualityAdjPower string `pg:"type:numeric,notnull"`
RawBytePower string `pg:",notnull"`
QualityAdjPower string `pg:",notnull"`
}

func (p *PowerActorClaim) Persist(ctx context.Context, s model.StorageBatch) error {
Expand Down
18 changes: 9 additions & 9 deletions model/actors/reward/chainreward.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
type ChainReward struct {
Height int64 `pg:",pk,notnull,use_zero"`
StateRoot string `pg:",pk,notnull"`
CumSumBaseline string `pg:"type:numeric,notnull"`
CumSumRealized string `pg:"type:numeric,notnull"`
EffectiveBaselinePower string `pg:"type:numeric,notnull"`
NewBaselinePower string `pg:"type:numeric,notnull"`
NewRewardSmoothedPositionEstimate string `pg:"type:numeric,notnull"`
NewRewardSmoothedVelocityEstimate string `pg:"type:numeric,notnull"`
TotalMinedReward string `pg:"type:numeric,notnull"`

NewReward string `pg:"type:numeric,use_zero"`
CumSumBaseline string `pg:",notnull"`
CumSumRealized string `pg:",notnull"`
EffectiveBaselinePower string `pg:",notnull"`
NewBaselinePower string `pg:",notnull"`
NewRewardSmoothedPositionEstimate string `pg:",notnull"`
NewRewardSmoothedVelocityEstimate string `pg:",notnull"`
TotalMinedReward string `pg:",notnull"`

NewReward string `pg:",use_zero"`
EffectiveNetworkTime int64 `pg:",use_zero"`
}

Expand Down
18 changes: 9 additions & 9 deletions model/derived/gasoutputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ type GasOutputs struct {
StateRoot string `pg:",pk,notnull"`
From string `pg:",notnull"`
To string `pg:",notnull"`
Value string `pg:"type:numeric,notnull"`
GasFeeCap string `pg:"type:numeric,notnull"`
GasPremium string `pg:"type:numeric,notnull"`
Value string `pg:",notnull"`
GasFeeCap string `pg:",notnull"`
GasPremium string `pg:",notnull"`
GasLimit int64 `pg:",use_zero,notnull"`
SizeBytes int `pg:",use_zero,notnull"`
Nonce uint64 `pg:",use_zero,notnull"`
Method uint64 `pg:",use_zero,notnull"`
ActorName string `pg:",notnull"`
ExitCode int64 `pg:",use_zero,notnull"`
GasUsed int64 `pg:",use_zero,notnull"`
ParentBaseFee string `pg:"type:numeric,notnull"`
BaseFeeBurn string `pg:"type:numeric,notnull"`
OverEstimationBurn string `pg:"type:numeric,notnull"`
MinerPenalty string `pg:"type:numeric,notnull"`
MinerTip string `pg:"type:numeric,notnull"`
Refund string `pg:"type:numeric,notnull"`
ParentBaseFee string `pg:",notnull"`
BaseFeeBurn string `pg:",notnull"`
OverEstimationBurn string `pg:",notnull"`
MinerPenalty string `pg:",notnull"`
MinerTip string `pg:",notnull"`
Refund string `pg:",notnull"`
GasRefund int64 `pg:",use_zero,notnull"`
GasBurned int64 `pg:",use_zero,notnull"`
}
Expand Down
6 changes: 3 additions & 3 deletions model/messages/gaseconomy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ type MessageGasEconomy struct {
Height int64 `pg:",pk,notnull,use_zero"`
StateRoot string `pg:",pk,notnull"`

BaseFee float64 `pg:"type:numeric,use_zero"`
BaseFee float64 `pg:",use_zero"`
BaseFeeChangeLog float64 `pg:",use_zero"`

GasLimitTotal int64 `pg:"type:numeric,use_zero"`
GasLimitUniqueTotal int64 `pg:"type:numeric,use_zero"`
GasLimitTotal int64 `pg:",use_zero"`
GasLimitUniqueTotal int64 `pg:",use_zero"`

GasFillRatio float64 `pg:",use_zero"`
GasCapacityRatio float64 `pg:",use_zero"`
Expand Down
6 changes: 3 additions & 3 deletions model/messages/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type Message struct {

From string `pg:",notnull"`
To string `pg:",notnull"`
Value string `pg:"type:numeric,notnull"`
GasFeeCap string `pg:"type:numeric,notnull"`
GasPremium string `pg:"type:numeric,notnull"`
Value string `pg:",notnull"`
GasFeeCap string `pg:",notnull"`
GasPremium string `pg:",notnull"`

GasLimit int64 `pg:",use_zero"`
SizeBytes int `pg:",use_zero"`
Expand Down
178 changes: 0 additions & 178 deletions storage/migrations/27_use_numberic_types.go

This file was deleted.

0 comments on commit 655e693

Please sign in to comment.