transfer_option.go 413 B

12345678910111213141516171819202122232425
  1. package eth
  2. import "math/big"
  3. type transferValue struct {
  4. nonce uint64
  5. gasPrice *big.Int
  6. gasLimit uint64
  7. }
  8. type Option func(v *transferValue)
  9. func OptionGasLimit(gasLimit uint64) Option {
  10. return func(v *transferValue) {
  11. v.gasLimit = gasLimit
  12. return
  13. }
  14. }
  15. func OptionGasPrice(gasPrice *big.Int) Option {
  16. return func(v *transferValue) {
  17. v.gasPrice = gasPrice
  18. return
  19. }
  20. }