github.com/klaytn/klaytn@v1.10.2/blockchain/types/contract_ref.go (about)

     1  // Modifications Copyright 2019 The klaytn Authors
     2  // Copyright 2014 The go-ethereum Authors
     3  // This file is part of the go-ethereum library.
     4  //
     5  // The go-ethereum library is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU Lesser General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // The go-ethereum library is distributed in the hope that it will be useful,
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    13  // GNU Lesser General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Lesser General Public License
    16  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    17  //
    18  // This file is derived from core/state_transition.go (2018/06/04).
    19  // Modified and improved for the klaytn development.
    20  
    21  package types
    22  
    23  import "github.com/klaytn/klaytn/common"
    24  
    25  // ContractRef is a reference to the contract's backing object
    26  type ContractRef interface {
    27  	Address() common.Address
    28  	FeePayer() common.Address
    29  }
    30  
    31  // AccountRefWithFeePayer implements ContractRef.
    32  // This structure has an additional field `feePayer` compared to `AccountRef`.
    33  type AccountRefWithFeePayer struct {
    34  	SenderAddress   common.Address
    35  	FeePayerAddress common.Address
    36  }
    37  
    38  func NewAccountRefWithFeePayer(sender common.Address, feePayer common.Address) *AccountRefWithFeePayer {
    39  	return &AccountRefWithFeePayer{sender, feePayer}
    40  }
    41  
    42  func (a *AccountRefWithFeePayer) Address() common.Address  { return a.SenderAddress }
    43  func (a *AccountRefWithFeePayer) FeePayer() common.Address { return a.FeePayerAddress }