-
Notifications
You must be signed in to change notification settings - Fork 198
/
simpleNFTStorageHandlerStub.go
36 lines (30 loc) · 1.24 KB
/
simpleNFTStorageHandlerStub.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 testscommon
import (
"math/big"
"github.com/ElrondNetwork/elrond-go-core/data"
"github.com/ElrondNetwork/elrond-go-core/data/esdt"
vmcommon "github.com/ElrondNetwork/elrond-vm-common"
)
// SimpleNFTStorageHandlerStub -
type SimpleNFTStorageHandlerStub struct {
GetESDTNFTTokenOnDestinationCalled func(accnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64) (*esdt.ESDigitalToken, bool, error)
SaveNFTMetaDataToSystemAccountCalled func(tx data.TransactionHandler) error
}
// GetESDTNFTTokenOnDestination -
func (s *SimpleNFTStorageHandlerStub) GetESDTNFTTokenOnDestination(accnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64) (*esdt.ESDigitalToken, bool, error) {
if s.GetESDTNFTTokenOnDestinationCalled != nil {
return s.GetESDTNFTTokenOnDestinationCalled(accnt, esdtTokenKey, nonce)
}
return &esdt.ESDigitalToken{Value: big.NewInt(0)}, true, nil
}
// SaveNFTMetaDataToSystemAccount -
func (s *SimpleNFTStorageHandlerStub) SaveNFTMetaDataToSystemAccount(tx data.TransactionHandler) error {
if s.SaveNFTMetaDataToSystemAccountCalled != nil {
return s.SaveNFTMetaDataToSystemAccountCalled(tx)
}
return nil
}
// IsInterfaceNil -
func (s *SimpleNFTStorageHandlerStub) IsInterfaceNil() bool {
return s == nil
}