/
helpers.go
36 lines (31 loc) · 1012 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
package testmessagebus
import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
)
// TestMessageBusRef is a bound Messaging Bus Upgradeable contract and the address of the contract
//
//nolint:golint
type TestMessageBusRef struct {
*TestMessageBusUpgradeable
address common.Address
}
// Address is the contract address.
func (s TestMessageBusRef) Address() common.Address {
return s.address
}
// NewTestMessageBusRef gets a bound Messaging Bus Upgradeable contract and the address of the contract
//
//nolint:golint
func NewTestMessageBusRef(address common.Address, backend bind.ContractBackend) (*TestMessageBusRef, error) {
messageBusUpgradeable, err := NewTestMessageBusUpgradeable(address, backend)
if err != nil {
return nil, err
}
return &TestMessageBusRef{
TestMessageBusUpgradeable: messageBusUpgradeable,
address: address,
}, nil
}
var _ vm.ContractRef = &TestMessageBusRef{}