refactor: pgx supports big.Int type conversion internally

This commit is contained in:
Mohamed Sohail 2023-04-06 06:31:07 +00:00
parent e67a42ede3
commit 82294b96f8
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
4 changed files with 5 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package store
import ( import (
"context" "context"
"math/big"
"github.com/grassrootseconomics/cic-custodial/pkg/enum" "github.com/grassrootseconomics/cic-custodial/pkg/enum"
) )
@ -26,7 +27,7 @@ type (
Data string Data string
GasLimit uint64 GasLimit uint64
TransferValue uint64 TransferValue uint64
GasPrice uint64 GasPrice *big.Int
Nonce uint64 Nonce uint64
} }

View File

@ -149,7 +149,7 @@ func AccountRefillGasProcessor(cu *custodial.Custodial) func(context.Context, *a
TxHash: builtTx.Hash().Hex(), TxHash: builtTx.Hash().Hex(),
From: cu.SystemPublicKey, From: cu.SystemPublicKey,
Data: hexutil.Encode(builtTx.Data()), Data: hexutil.Encode(builtTx.Data()),
GasPrice: builtTx.GasPrice().Uint64(), GasPrice: builtTx.GasPrice(),
GasLimit: builtTx.Gas(), GasLimit: builtTx.Gas(),
Nonce: builtTx.Nonce(), Nonce: builtTx.Nonce(),
}) })

View File

@ -89,7 +89,7 @@ func AccountRegisterOnChainProcessor(cu *custodial.Custodial) func(context.Conte
TxHash: builtTx.Hash().Hex(), TxHash: builtTx.Hash().Hex(),
From: cu.SystemPublicKey, From: cu.SystemPublicKey,
Data: hexutil.Encode(builtTx.Data()), Data: hexutil.Encode(builtTx.Data()),
GasPrice: builtTx.GasPrice().Uint64(), GasPrice: builtTx.GasPrice(),
GasLimit: builtTx.Gas(), GasLimit: builtTx.Gas(),
Nonce: builtTx.Nonce(), Nonce: builtTx.Nonce(),
}) })

View File

@ -96,7 +96,7 @@ func SignTransfer(cu *custodial.Custodial) func(context.Context, *asynq.Task) er
TxHash: builtTx.Hash().Hex(), TxHash: builtTx.Hash().Hex(),
From: payload.From, From: payload.From,
Data: hexutil.Encode(builtTx.Data()), Data: hexutil.Encode(builtTx.Data()),
GasPrice: builtTx.GasPrice().Uint64(), GasPrice: builtTx.GasPrice(),
GasLimit: builtTx.Gas(), GasLimit: builtTx.Gas(),
TransferValue: payload.Amount, TransferValue: payload.Amount,
Nonce: builtTx.Nonce(), Nonce: builtTx.Nonce(),