package helpers

import (
	"math/big"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
)

type CommitStoreReportAccepted struct {
	Report ICommitStoreCommitReport
	Raw    types.Log
}

type ICommitStoreCommitReport struct {
	PriceUpdates InternalPriceUpdates
	Interval     ICommitStoreInterval
	MerkleRoot   [32]byte
}

type InternalGasPriceUpdate struct {
	DestChainSelector uint64
	UsdPerUnitGas     *big.Int
}

type InternalPriceUpdates struct {
	TokenPriceUpdates []InternalTokenPriceUpdate
	GasPriceUpdates   []InternalGasPriceUpdate
}

type InternalTokenPriceUpdate struct {
	SourceToken common.Address
	UsdPerToken *big.Int
}

type ICommitStoreInterval struct {
	Min uint64
	Max uint64
}

type InternalEVM2EVMMessage struct {
	SourceChainSelector uint64
	Sender              common.Address
	Receiver            common.Address
	SequenceNumber      uint64
	GasLimit            *big.Int
	Strict              bool
	Nonce               uint64
	FeeToken            common.Address
	FeeTokenAmount      *big.Int
	Data                []byte
	TokenAmounts        []ClientEVMTokenAmount
	SourceTokenData     [][]byte
	MessageID           [32]byte
}

type ClientEVMTokenAmount struct {
	Token  common.Address
	Amount *big.Int
}

type SendRequestedEvent struct {
	Message InternalEVM2EVMMessage
	Raw     types.Log
}

type InternalExecutionReport struct {
	Messages          []InternalEVM2EVMMessage
	OffchainTokenData [][][]byte
	Proofs            [][32]byte
	ProofFlagBits     *big.Int
}

type EVM2EVMOffRampExecutionStateChanged struct {
	SequenceNumber uint64
	MessageID      [32]byte
	State          uint8
	ReturnData     []byte
	Raw            types.Log
}

type EVM2EVMOffRampGasLimitOverride struct {
	ReceiverExecutionGasLimit *big.Int
	TokenGasOverrides         []*big.Int
}
