@@ -474,13 +474,13 @@ func (tx *Transaction) ConvertToEth() *EthTransaction {
474474// XXX Rename message to something less arbitrary?
475475func (tx * Transaction ) AsMessage (s Signer ) (Message , error ) {
476476 msg := Message {
477- nonce : tx .data .AccountNonce ,
478- gasLimit : tx .data .GasLimit ,
479- gasPrice : new (big.Int ).Set (tx .data .Price ),
480- to : tx .data .Recipient ,
481- amount : tx .data .Amount ,
482- data : tx .data .Payload ,
483- checkNonce : true ,
477+ nonce : tx .data .AccountNonce ,
478+ gasLimit : tx .data .GasLimit ,
479+ gasPrice : new (big.Int ).Set (tx .data .Price ),
480+ to : tx .data .Recipient ,
481+ value : tx .data .Amount ,
482+ data : tx .data .Payload ,
483+ skipNonceChecks : false ,
484484 }
485485
486486 var err error
@@ -681,43 +681,82 @@ func (t *TransactionsByPriceAndNonce) Pop() {
681681// Message is a fully derived transaction and implements core.Message
682682// NOTE: In a future PR this will be removed.
683683type Message struct {
684- to * common.Address
685- from common.Address
686- nonce uint64
687- amount * big.Int
688- gasLimit uint64
689- gasPrice * big.Int
690- data []byte
691- checkNonce bool
692- blockNum * big.Int
693- txType TransactionType
694- }
684+ to * common.Address
685+ from common.Address
686+ nonce uint64
687+ value * big.Int
688+ gasLimit uint64
689+ gasPrice * big.Int
690+ gasFeeCap * big.Int
691+ gasTipCap * big.Int
692+ data []byte
693+ // AccessList types.AccessList TODO: implemented in Berlin 2021-04-15
694+ BlobGasFeeCap * big.Int
695+ BlobHashes []common.Hash
696+
697+ // SetCodeAuthorizations []types.SetCodeAuthorization TODO: understand do we need this
698+
699+ // When SkipNonceChecks is true, the message nonce is not checked against the
700+ // account nonce in state.
701+ // This field will be set to true for operations like RPC eth_call.
702+ skipNonceChecks bool
703+
704+ // When SkipFromEOACheck is true, the message sender is not checked to be an EOA.
705+ skipFromEOACheck bool
706+
707+ blockNum * big.Int
708+ txType TransactionType
709+ }
710+
711+ //type Message struct {
712+ // To *common.Address
713+ // From common.Address
714+ // Nonce uint64
715+ // Value *big.Int
716+ // GasLimit uint64
717+ // GasPrice *big.Int
718+ // GasFeeCap *big.Int
719+ // GasTipCap *big.Int
720+ // Data []byte
721+ // AccessList types.AccessList
722+ // BlobGasFeeCap *big.Int
723+ // BlobHashes []common.Hash
724+ // SetCodeAuthorizations []types.SetCodeAuthorization
725+ //
726+ // // When SkipNonceChecks is true, the message nonce is not checked against the
727+ // // account nonce in state.
728+ // // This field will be set to true for operations like RPC eth_call.
729+ // SkipNonceChecks bool
730+ //
731+ // // When SkipFromEOACheck is true, the message sender is not checked to be an EOA.
732+ // SkipFromEOACheck bool
733+ //}
695734
696735// NewMessage returns new message.
697- func NewMessage (from common.Address , to * common.Address , nonce uint64 , amount * big.Int , gasLimit uint64 , gasPrice * big.Int , data []byte , checkNonce bool ) Message {
736+ func NewMessage (from common.Address , to * common.Address , nonce uint64 , amount * big.Int , gasLimit uint64 , gasPrice * big.Int , data []byte , skipNonceChecks bool ) Message {
698737 return Message {
699- from : from ,
700- to : to ,
701- nonce : nonce ,
702- amount : amount ,
703- gasLimit : gasLimit ,
704- gasPrice : gasPrice ,
705- data : data ,
706- checkNonce : checkNonce ,
738+ from : from ,
739+ to : to ,
740+ nonce : nonce ,
741+ value : amount ,
742+ gasLimit : gasLimit ,
743+ gasPrice : gasPrice ,
744+ data : data ,
745+ skipNonceChecks : skipNonceChecks ,
707746 }
708747}
709748
710749// NewStakingMessage returns new message of staking type
711750// always need checkNonce
712751func NewStakingMessage (from common.Address , nonce uint64 , gasLimit uint64 , gasPrice * big.Int , data []byte , blockNum * big.Int ) Message {
713752 return Message {
714- from : from ,
715- nonce : nonce ,
716- gasLimit : gasLimit ,
717- gasPrice : new (big.Int ).Set (gasPrice ),
718- data : data ,
719- checkNonce : true ,
720- blockNum : blockNum ,
753+ from : from ,
754+ nonce : nonce ,
755+ gasLimit : gasLimit ,
756+ gasPrice : new (big.Int ).Set (gasPrice ),
757+ data : data ,
758+ skipNonceChecks : false ,
759+ blockNum : blockNum ,
721760 }
722761}
723762
@@ -738,7 +777,7 @@ func (m Message) GasPrice() *big.Int {
738777
739778// Value returns the value amount from Message.
740779func (m Message ) Value () * big.Int {
741- return m .amount
780+ return m .value
742781}
743782
744783// Gas returns gas limit of the Message.
@@ -757,8 +796,8 @@ func (m Message) Data() []byte {
757796}
758797
759798// CheckNonce returns checkNonce of Message.
760- func (m Message ) CheckNonce () bool {
761- return m .checkNonce
799+ func (m Message ) SkipNonceChecks () bool {
800+ return m .skipNonceChecks
762801}
763802
764803// Type returns the type of message
0 commit comments