MCPcopy Create free account
hub / github.com/copernet/copernicus / Equal

Method Equal

util/stack.go:155–165  ·  view source on GitHub ↗

func CopyStackByteType(des *Stack, src *Stack) { if src.Size() == 0 { return } for _, v := range src.array { switch element := v.(type) { case []byte: { length := len(element) tmpSlice := make([]byte, length) copy(tmpSlice, element) des.array = append(des.array, tmpSlice)

(other *Stack)

Source from the content-addressed store, hash-verified

153//}
154
155func (s *Stack) Equal(other *Stack) bool {
156 if s.Size() != other.Size() {
157 return false
158 }
159 for i := 0; i < s.Size(); i++ {
160 if s.array[i] != other.array[i] {
161 return false
162 }
163 }
164 return true
165}
166
167//func (s *Stack) Last() interface{} {
168// if s.Size() == 0 {

Callers 15

TestStackFunction · 0.95
TestSwapStackFunction · 0.95
TestPubKeysFunction · 0.45
TestPublicKeyIsEqualFunction · 0.45
TestKeyPairFunction · 0.45
TestKeyStore_GetKeyPairFunction · 0.45
TestKeyStore_GetKeyPairsFunction · 0.45
TestKeyStore_AddKeyPairsFunction · 0.45
TestPrivKeysFunction · 0.45
TestPrivateKeyFromBytesFunction · 0.45

Calls 1

SizeMethod · 0.95

Tested by 15

TestStackFunction · 0.76
TestSwapStackFunction · 0.76
TestPubKeysFunction · 0.36
TestPublicKeyIsEqualFunction · 0.36
TestKeyPairFunction · 0.36
TestKeyStore_GetKeyPairFunction · 0.36
TestKeyStore_GetKeyPairsFunction · 0.36
TestKeyStore_AddKeyPairsFunction · 0.36
TestPrivKeysFunction · 0.36
TestPrivateKeyFromBytesFunction · 0.36