-
Notifications
You must be signed in to change notification settings - Fork 23
/
helpers.go
37 lines (31 loc) · 933 Bytes
/
helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package mocktokenminter
import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
)
// MockTokenMinterRef is a bound cctp contract that conforms to vm.ContractRef.
//
//nolint:golint
type MockTokenMinterRef struct {
*MockTokenMinter
address common.Address
}
// Address is the contract address.
func (m MockTokenMinterRef) Address() common.Address {
return m.address
}
// NewMockTokenMinterRef creates a new MockMessageTransmitterRef contract with a contract ref.
//
//nolint:golint
func NewMockTokenMinterRef(address common.Address, backend bind.ContractBackend) (*MockTokenMinterRef, error) {
cctpContract, err := NewMockTokenMinter(address, backend)
if err != nil {
return nil, err
}
return &MockTokenMinterRef{
MockTokenMinter: cctpContract,
address: address,
}, nil
}
var _ vm.ContractRef = MockTokenMinterRef{}