-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathaddress_implicit_account_creation.go
74 lines (57 loc) · 2.15 KB
/
address_implicit_account_creation.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package iotago
import (
"github.com/iotaledger/hive.go/ierrors"
"github.com/iotaledger/iota.go/v4/hexutil"
)
// ParseImplicitAccountCreationAddressFromHexString parses the given hex string into an ImplicitAccountCreationAddress.
func ParseImplicitAccountCreationAddressFromHexString(hexAddr string) (*ImplicitAccountCreationAddress, error) {
addrBytes, err := hexutil.DecodeHex(hexAddr)
if err != nil {
return nil, err
}
if len(addrBytes) < ImplicitAccountCreationAddressBytesLength {
return nil, ierrors.New("invalid ImplicitAccountCreationAddress length")
}
addr := &ImplicitAccountCreationAddress{}
copy(addr[:], addrBytes)
return addr, nil
}
// MustParseImplicitAccountCreationAddressFromHexString parses the given hex string into an ImplicitAccountCreationAddress.
// It panics if the hex address is invalid.
func MustParseImplicitAccountCreationAddressFromHexString(hexAddr string) *ImplicitAccountCreationAddress {
addr, err := ParseImplicitAccountCreationAddressFromHexString(hexAddr)
if err != nil {
panic(err)
}
return addr
}
func (addr *ImplicitAccountCreationAddress) StorageScore(storageScoreStruct *StorageScoreStructure, _ StorageScoreFunc) StorageScore {
return storageScoreStruct.OffsetImplicitAccountCreationAddress
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveNativeTokens() bool {
return false
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveMana() bool {
return false
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveOutputsWithTimelockUnlockCondition() bool {
return true
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveOutputsWithExpirationUnlockCondition() bool {
return true
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveOutputsWithStorageDepositReturnUnlockCondition() bool {
return true
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveAccountOutputs() bool {
return true
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveAnchorOutputs() bool {
return true
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveNFTOutputs() bool {
return true
}
func (addr *ImplicitAccountCreationAddress) CannotReceiveDelegationOutputs() bool {
return true
}