@@ -474,13 +474,13 @@ func (tx *Transaction) ConvertToEth() *EthTransaction {
474
474
// XXX Rename message to something less arbitrary?
475
475
func (tx * Transaction ) AsMessage (s Signer ) (Message , error ) {
476
476
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 ,
484
484
}
485
485
486
486
var err error
@@ -681,43 +681,82 @@ func (t *TransactionsByPriceAndNonce) Pop() {
681
681
// Message is a fully derived transaction and implements core.Message
682
682
// NOTE: In a future PR this will be removed.
683
683
type 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
+ //}
695
734
696
735
// 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 {
698
737
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 ,
707
746
}
708
747
}
709
748
710
749
// NewStakingMessage returns new message of staking type
711
750
// always need checkNonce
712
751
func NewStakingMessage (from common.Address , nonce uint64 , gasLimit uint64 , gasPrice * big.Int , data []byte , blockNum * big.Int ) Message {
713
752
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 ,
721
760
}
722
761
}
723
762
@@ -738,7 +777,7 @@ func (m Message) GasPrice() *big.Int {
738
777
739
778
// Value returns the value amount from Message.
740
779
func (m Message ) Value () * big.Int {
741
- return m .amount
780
+ return m .value
742
781
}
743
782
744
783
// Gas returns gas limit of the Message.
@@ -757,8 +796,8 @@ func (m Message) Data() []byte {
757
796
}
758
797
759
798
// 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
762
801
}
763
802
764
803
// Type returns the type of message
0 commit comments