repo
stringlengths
5
67
path
stringlengths
4
218
func_name
stringlengths
0
151
original_string
stringlengths
52
373k
language
stringclasses
6 values
code
stringlengths
52
373k
code_tokens
listlengths
10
512
docstring
stringlengths
3
47.2k
docstring_tokens
listlengths
3
234
sha
stringlengths
40
40
url
stringlengths
85
339
partition
stringclasses
3 values
stellar/go-stellar-base
build/set_options.go
MutateSetOptions
func (m Thresholds) MutateSetOptions(o *xdr.SetOptionsOp) (err error) { if m.Low != nil { val := xdr.Uint32(*m.Low) o.LowThreshold = &val } if m.Medium != nil { val := xdr.Uint32(*m.Medium) o.MedThreshold = &val } if m.High != nil { val := xdr.Uint32(*m.High) o.HighThreshold = &val } return }
go
func (m Thresholds) MutateSetOptions(o *xdr.SetOptionsOp) (err error) { if m.Low != nil { val := xdr.Uint32(*m.Low) o.LowThreshold = &val } if m.Medium != nil { val := xdr.Uint32(*m.Medium) o.MedThreshold = &val } if m.High != nil { val := xdr.Uint32(*m.High) o.HighThreshold = &val } return }
[ "func", "(", "m", "Thresholds", ")", "MutateSetOptions", "(", "o", "*", "xdr", ".", "SetOptionsOp", ")", "(", "err", "error", ")", "{", "if", "m", ".", "Low", "!=", "nil", "{", "val", ":=", "xdr", ".", "Uint32", "(", "*", "m", ".", "Low", ")", ...
// MutateSetOptions for Thresholds sets the SetOptionsOp's thresholds fields
[ "MutateSetOptions", "for", "Thresholds", "sets", "the", "SetOptionsOp", "s", "thresholds", "fields" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/set_options.go#L138-L155
test
stellar/go-stellar-base
build/set_options.go
MutateSetOptions
func (m SetFlag) MutateSetOptions(o *xdr.SetOptionsOp) (err error) { if !isFlagValid(xdr.AccountFlags(m)) { return errors.New("Unknown flag in SetFlag mutator") } var val xdr.Uint32 if o.SetFlags == nil { val = xdr.Uint32(m) } else { val = xdr.Uint32(m) | *o.SetFlags } o.SetFlags = &val return }
go
func (m SetFlag) MutateSetOptions(o *xdr.SetOptionsOp) (err error) { if !isFlagValid(xdr.AccountFlags(m)) { return errors.New("Unknown flag in SetFlag mutator") } var val xdr.Uint32 if o.SetFlags == nil { val = xdr.Uint32(m) } else { val = xdr.Uint32(m) | *o.SetFlags } o.SetFlags = &val return }
[ "func", "(", "m", "SetFlag", ")", "MutateSetOptions", "(", "o", "*", "xdr", ".", "SetOptionsOp", ")", "(", "err", "error", ")", "{", "if", "!", "isFlagValid", "(", "xdr", ".", "AccountFlags", "(", "m", ")", ")", "{", "return", "errors", ".", "New", ...
// MutateSetOptions for SetFlag sets the SetOptionsOp's SetFlags field
[ "MutateSetOptions", "for", "SetFlag", "sets", "the", "SetOptionsOp", "s", "SetFlags", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/set_options.go#L178-L191
test
stellar/go-stellar-base
build/set_options.go
MutateSetOptions
func (m ClearFlag) MutateSetOptions(o *xdr.SetOptionsOp) (err error) { if !isFlagValid(xdr.AccountFlags(m)) { return errors.New("Unknown flag in SetFlag mutator") } var val xdr.Uint32 if o.ClearFlags == nil { val = xdr.Uint32(m) } else { val = xdr.Uint32(m) | *o.ClearFlags } o.ClearFlags = &val return }
go
func (m ClearFlag) MutateSetOptions(o *xdr.SetOptionsOp) (err error) { if !isFlagValid(xdr.AccountFlags(m)) { return errors.New("Unknown flag in SetFlag mutator") } var val xdr.Uint32 if o.ClearFlags == nil { val = xdr.Uint32(m) } else { val = xdr.Uint32(m) | *o.ClearFlags } o.ClearFlags = &val return }
[ "func", "(", "m", "ClearFlag", ")", "MutateSetOptions", "(", "o", "*", "xdr", ".", "SetOptionsOp", ")", "(", "err", "error", ")", "{", "if", "!", "isFlagValid", "(", "xdr", ".", "AccountFlags", "(", "m", ")", ")", "{", "return", "errors", ".", "New",...
// MutateSetOptions for ClearFlag sets the SetOptionsOp's ClearFlags field
[ "MutateSetOptions", "for", "ClearFlag", "sets", "the", "SetOptionsOp", "s", "ClearFlags", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/set_options.go#L214-L227
test
stellar/go-stellar-base
build/create_account.go
MutateCreateAccount
func (m Destination) MutateCreateAccount(o *xdr.CreateAccountOp) error { return setAccountId(m.AddressOrSeed, &o.Destination) }
go
func (m Destination) MutateCreateAccount(o *xdr.CreateAccountOp) error { return setAccountId(m.AddressOrSeed, &o.Destination) }
[ "func", "(", "m", "Destination", ")", "MutateCreateAccount", "(", "o", "*", "xdr", ".", "CreateAccountOp", ")", "error", "{", "return", "setAccountId", "(", "m", ".", "AddressOrSeed", ",", "&", "o", ".", "Destination", ")", "\n", "}" ]
// MutateCreateAccount for Destination sets the CreateAccountOp's Destination // field
[ "MutateCreateAccount", "for", "Destination", "sets", "the", "CreateAccountOp", "s", "Destination", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/create_account.go#L53-L55
test
stellar/go-stellar-base
build/create_account.go
MutateCreateAccount
func (m NativeAmount) MutateCreateAccount(o *xdr.CreateAccountOp) (err error) { o.StartingBalance, err = amount.Parse(m.Amount) return }
go
func (m NativeAmount) MutateCreateAccount(o *xdr.CreateAccountOp) (err error) { o.StartingBalance, err = amount.Parse(m.Amount) return }
[ "func", "(", "m", "NativeAmount", ")", "MutateCreateAccount", "(", "o", "*", "xdr", ".", "CreateAccountOp", ")", "(", "err", "error", ")", "{", "o", ".", "StartingBalance", ",", "err", "=", "amount", ".", "Parse", "(", "m", ".", "Amount", ")", "\n", ...
// MutateCreateAccount for NativeAmount sets the CreateAccountOp's // StartingBalance field
[ "MutateCreateAccount", "for", "NativeAmount", "sets", "the", "CreateAccountOp", "s", "StartingBalance", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/create_account.go#L59-L62
test
stellar/go-stellar-base
keypair/main.go
Random
func Random() (*Full, error) { var rawSeed [32]byte _, err := io.ReadFull(rand.Reader, rawSeed[:]) if err != nil { return nil, err } kp, err := FromRawSeed(rawSeed) if err != nil { return nil, err } return kp, nil }
go
func Random() (*Full, error) { var rawSeed [32]byte _, err := io.ReadFull(rand.Reader, rawSeed[:]) if err != nil { return nil, err } kp, err := FromRawSeed(rawSeed) if err != nil { return nil, err } return kp, nil }
[ "func", "Random", "(", ")", "(", "*", "Full", ",", "error", ")", "{", "var", "rawSeed", "[", "32", "]", "byte", "\n", "_", ",", "err", ":=", "io", ".", "ReadFull", "(", "rand", ".", "Reader", ",", "rawSeed", "[", ":", "]", ")", "\n", "if", "e...
// Random creates a random full keypair
[ "Random", "creates", "a", "random", "full", "keypair" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/keypair/main.go#L44-L59
test
stellar/go-stellar-base
keypair/main.go
Master
func Master(networkPassphrase string) KP { kp, err := FromRawSeed(network.ID(networkPassphrase)) if err != nil { panic(err) } return kp }
go
func Master(networkPassphrase string) KP { kp, err := FromRawSeed(network.ID(networkPassphrase)) if err != nil { panic(err) } return kp }
[ "func", "Master", "(", "networkPassphrase", "string", ")", "KP", "{", "kp", ",", "err", ":=", "FromRawSeed", "(", "network", ".", "ID", "(", "networkPassphrase", ")", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n"...
// Master returns the master keypair for a given network passphrase
[ "Master", "returns", "the", "master", "keypair", "for", "a", "given", "network", "passphrase" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/keypair/main.go#L62-L70
test
stellar/go-stellar-base
keypair/main.go
Parse
func Parse(addressOrSeed string) (KP, error) { _, err := strkey.Decode(strkey.VersionByteAccountID, addressOrSeed) if err == nil { return &FromAddress{addressOrSeed}, nil } if err != strkey.ErrInvalidVersionByte { return nil, err } _, err = strkey.Decode(strkey.VersionByteSeed, addressOrSeed) if err == nil...
go
func Parse(addressOrSeed string) (KP, error) { _, err := strkey.Decode(strkey.VersionByteAccountID, addressOrSeed) if err == nil { return &FromAddress{addressOrSeed}, nil } if err != strkey.ErrInvalidVersionByte { return nil, err } _, err = strkey.Decode(strkey.VersionByteSeed, addressOrSeed) if err == nil...
[ "func", "Parse", "(", "addressOrSeed", "string", ")", "(", "KP", ",", "error", ")", "{", "_", ",", "err", ":=", "strkey", ".", "Decode", "(", "strkey", ".", "VersionByteAccountID", ",", "addressOrSeed", ")", "\n", "if", "err", "==", "nil", "{", "return...
// Parse constructs a new KP from the provided string, which should be either // an address, or a seed. If the provided input is a seed, the resulting KP // will have signing capabilities.
[ "Parse", "constructs", "a", "new", "KP", "from", "the", "provided", "string", "which", "should", "be", "either", "an", "address", "or", "a", "seed", ".", "If", "the", "provided", "input", "is", "a", "seed", "the", "resulting", "KP", "will", "have", "sign...
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/keypair/main.go#L75-L91
test
stellar/go-stellar-base
keypair/main.go
MustParse
func MustParse(addressOrSeed string) KP { kp, err := Parse(addressOrSeed) if err != nil { panic(err) } return kp }
go
func MustParse(addressOrSeed string) KP { kp, err := Parse(addressOrSeed) if err != nil { panic(err) } return kp }
[ "func", "MustParse", "(", "addressOrSeed", "string", ")", "KP", "{", "kp", ",", "err", ":=", "Parse", "(", "addressOrSeed", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n", "return", "kp", "\n", "}" ]
// MustParse is the panic-on-fail version of Parse
[ "MustParse", "is", "the", "panic", "-", "on", "-", "fail", "version", "of", "Parse" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/keypair/main.go#L104-L111
test
stellar/go-stellar-base
build/allow_trust.go
MutateAllowTrust
func (m Authorize) MutateAllowTrust(o *xdr.AllowTrustOp) error { o.Authorize = m.Value return nil }
go
func (m Authorize) MutateAllowTrust(o *xdr.AllowTrustOp) error { o.Authorize = m.Value return nil }
[ "func", "(", "m", "Authorize", ")", "MutateAllowTrust", "(", "o", "*", "xdr", ".", "AllowTrustOp", ")", "error", "{", "o", ".", "Authorize", "=", "m", ".", "Value", "\n", "return", "nil", "\n", "}" ]
// MutateAllowTrust for Authorize sets the AllowTrustOp's Authorize field
[ "MutateAllowTrust", "for", "Authorize", "sets", "the", "AllowTrustOp", "s", "Authorize", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/allow_trust.go#L50-L53
test
stellar/go-stellar-base
build/allow_trust.go
MutateAllowTrust
func (m AllowTrustAsset) MutateAllowTrust(o *xdr.AllowTrustOp) (err error) { length := len(m.Code) switch { case length >= 1 && length <= 4: var code [4]byte byteArray := []byte(m.Code) copy(code[:], byteArray[0:length]) o.Asset, err = xdr.NewAllowTrustOpAsset(xdr.AssetTypeAssetTypeCreditAlphanum4, code) c...
go
func (m AllowTrustAsset) MutateAllowTrust(o *xdr.AllowTrustOp) (err error) { length := len(m.Code) switch { case length >= 1 && length <= 4: var code [4]byte byteArray := []byte(m.Code) copy(code[:], byteArray[0:length]) o.Asset, err = xdr.NewAllowTrustOpAsset(xdr.AssetTypeAssetTypeCreditAlphanum4, code) c...
[ "func", "(", "m", "AllowTrustAsset", ")", "MutateAllowTrust", "(", "o", "*", "xdr", ".", "AllowTrustOp", ")", "(", "err", "error", ")", "{", "length", ":=", "len", "(", "m", ".", "Code", ")", "\n", "switch", "{", "case", "length", ">=", "1", "&&", ...
// MutateAllowTrust for Asset sets the AllowTrustOp's Asset field
[ "MutateAllowTrust", "for", "Asset", "sets", "the", "AllowTrustOp", "s", "Asset", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/allow_trust.go#L56-L75
test
stellar/go-stellar-base
build/allow_trust.go
MutateAllowTrust
func (m Trustor) MutateAllowTrust(o *xdr.AllowTrustOp) error { return setAccountId(m.Address, &o.Trustor) }
go
func (m Trustor) MutateAllowTrust(o *xdr.AllowTrustOp) error { return setAccountId(m.Address, &o.Trustor) }
[ "func", "(", "m", "Trustor", ")", "MutateAllowTrust", "(", "o", "*", "xdr", ".", "AllowTrustOp", ")", "error", "{", "return", "setAccountId", "(", "m", ".", "Address", ",", "&", "o", ".", "Trustor", ")", "\n", "}" ]
// MutateAllowTrust for Trustor sets the AllowTrustOp's Trustor field
[ "MutateAllowTrust", "for", "Trustor", "sets", "the", "AllowTrustOp", "s", "Trustor", "field" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/build/allow_trust.go#L78-L80
test
stellar/go-stellar-base
xdr/allow_trust_op_asset.go
ToAsset
func (a AllowTrustOpAsset) ToAsset(issuer AccountId) (ret Asset) { var err error switch a.Type { case AssetTypeAssetTypeCreditAlphanum4: ret, err = NewAsset(AssetTypeAssetTypeCreditAlphanum4, AssetAlphaNum4{ AssetCode: a.MustAssetCode4(), Issuer: issuer, }) case AssetTypeAssetTypeCreditAlphanum12: ...
go
func (a AllowTrustOpAsset) ToAsset(issuer AccountId) (ret Asset) { var err error switch a.Type { case AssetTypeAssetTypeCreditAlphanum4: ret, err = NewAsset(AssetTypeAssetTypeCreditAlphanum4, AssetAlphaNum4{ AssetCode: a.MustAssetCode4(), Issuer: issuer, }) case AssetTypeAssetTypeCreditAlphanum12: ...
[ "func", "(", "a", "AllowTrustOpAsset", ")", "ToAsset", "(", "issuer", "AccountId", ")", "(", "ret", "Asset", ")", "{", "var", "err", "error", "\n", "switch", "a", ".", "Type", "{", "case", "AssetTypeAssetTypeCreditAlphanum4", ":", "ret", ",", "err", "=", ...
// ToAsset converts `a` to a proper xdr.Asset
[ "ToAsset", "converts", "a", "to", "a", "proper", "xdr", ".", "Asset" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/allow_trust_op_asset.go#L8-L31
test
stellar/go-stellar-base
xdr/asset.go
SetNative
func (a *Asset) SetNative() error { newa, err := NewAsset(AssetTypeAssetTypeNative, nil) if err != nil { return err } *a = newa return nil }
go
func (a *Asset) SetNative() error { newa, err := NewAsset(AssetTypeAssetTypeNative, nil) if err != nil { return err } *a = newa return nil }
[ "func", "(", "a", "*", "Asset", ")", "SetNative", "(", ")", "error", "{", "newa", ",", "err", ":=", "NewAsset", "(", "AssetTypeAssetTypeNative", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "*", "a", "=", ...
// SetNative overwrites `a` with the native asset type
[ "SetNative", "overwrites", "a", "with", "the", "native", "asset", "type" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/asset.go#L45-L52
test
stellar/go-stellar-base
xdr/asset.go
String
func (a Asset) String() string { var t, c, i string a.MustExtract(&t, &c, &i) if a.Type == AssetTypeAssetTypeNative { return t } return fmt.Sprintf("%s/%s/%s", t, c, i) }
go
func (a Asset) String() string { var t, c, i string a.MustExtract(&t, &c, &i) if a.Type == AssetTypeAssetTypeNative { return t } return fmt.Sprintf("%s/%s/%s", t, c, i) }
[ "func", "(", "a", "Asset", ")", "String", "(", ")", "string", "{", "var", "t", ",", "c", ",", "i", "string", "\n", "a", ".", "MustExtract", "(", "&", "t", ",", "&", "c", ",", "&", "i", ")", "\n", "if", "a", ".", "Type", "==", "AssetTypeAssetT...
// String returns a display friendly form of the asset
[ "String", "returns", "a", "display", "friendly", "form", "of", "the", "asset" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/asset.go#L55-L65
test
stellar/go-stellar-base
xdr/asset.go
Equals
func (a Asset) Equals(other Asset) bool { if a.Type != other.Type { return false } switch a.Type { case AssetTypeAssetTypeNative: return true case AssetTypeAssetTypeCreditAlphanum4: l := a.MustAlphaNum4() r := other.MustAlphaNum4() return l.AssetCode == r.AssetCode && l.Issuer.Equals(r.Issuer) case Asse...
go
func (a Asset) Equals(other Asset) bool { if a.Type != other.Type { return false } switch a.Type { case AssetTypeAssetTypeNative: return true case AssetTypeAssetTypeCreditAlphanum4: l := a.MustAlphaNum4() r := other.MustAlphaNum4() return l.AssetCode == r.AssetCode && l.Issuer.Equals(r.Issuer) case Asse...
[ "func", "(", "a", "Asset", ")", "Equals", "(", "other", "Asset", ")", "bool", "{", "if", "a", ".", "Type", "!=", "other", ".", "Type", "{", "return", "false", "\n", "}", "\n", "switch", "a", ".", "Type", "{", "case", "AssetTypeAssetTypeNative", ":", ...
// Equals returns true if `other` is equivalent to `a`
[ "Equals", "returns", "true", "if", "other", "is", "equivalent", "to", "a" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/asset.go#L68-L86
test
stellar/go-stellar-base
xdr/asset.go
MustExtract
func (a Asset) MustExtract(typ interface{}, code interface{}, issuer interface{}) { err := a.Extract(typ, code, issuer) if err != nil { panic(err) } }
go
func (a Asset) MustExtract(typ interface{}, code interface{}, issuer interface{}) { err := a.Extract(typ, code, issuer) if err != nil { panic(err) } }
[ "func", "(", "a", "Asset", ")", "MustExtract", "(", "typ", "interface", "{", "}", ",", "code", "interface", "{", "}", ",", "issuer", "interface", "{", "}", ")", "{", "err", ":=", "a", ".", "Extract", "(", "typ", ",", "code", ",", "issuer", ")", "...
// MustExtract behaves as Extract, but panics if an error occurs.
[ "MustExtract", "behaves", "as", "Extract", "but", "panics", "if", "an", "error", "occurs", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/asset.go#L148-L154
test
stellar/go-stellar-base
xdr/xdr_generated.go
Unmarshal
func Unmarshal(r io.Reader, v interface{}) (int, error) { // delegate to xdr package's Unmarshal return xdr.Unmarshal(r, v) }
go
func Unmarshal(r io.Reader, v interface{}) (int, error) { // delegate to xdr package's Unmarshal return xdr.Unmarshal(r, v) }
[ "func", "Unmarshal", "(", "r", "io", ".", "Reader", ",", "v", "interface", "{", "}", ")", "(", "int", ",", "error", ")", "{", "return", "xdr", ".", "Unmarshal", "(", "r", ",", "v", ")", "\n", "}" ]
// Unmarshal reads an xdr element from `r` into `v`.
[ "Unmarshal", "reads", "an", "xdr", "element", "from", "r", "into", "v", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L21-L24
test
stellar/go-stellar-base
xdr/xdr_generated.go
Marshal
func Marshal(w io.Writer, v interface{}) (int, error) { // delegate to xdr package's Marshal return xdr.Marshal(w, v) }
go
func Marshal(w io.Writer, v interface{}) (int, error) { // delegate to xdr package's Marshal return xdr.Marshal(w, v) }
[ "func", "Marshal", "(", "w", "io", ".", "Writer", ",", "v", "interface", "{", "}", ")", "(", "int", ",", "error", ")", "{", "return", "xdr", ".", "Marshal", "(", "w", ",", "v", ")", "\n", "}" ]
// Marshal writes an xdr element `v` into `w`.
[ "Marshal", "writes", "an", "xdr", "element", "v", "into", "w", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L27-L30
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e CryptoKeyType) ValidEnum(v int32) bool { _, ok := cryptoKeyTypeMap[v] return ok }
go
func (e CryptoKeyType) ValidEnum(v int32) bool { _, ok := cryptoKeyTypeMap[v] return ok }
[ "func", "(", "e", "CryptoKeyType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "cryptoKeyTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for CryptoKeyType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "CryptoKeyType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L87-L90
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewPublicKey
func NewPublicKey(aType CryptoKeyType, value interface{}) (result PublicKey, err error) { result.Type = aType switch CryptoKeyType(aType) { case CryptoKeyTypeKeyTypeEd25519: tv, ok := value.(Uint256) if !ok { err = fmt.Errorf("invalid value, must be Uint256") return } result.Ed25519 = &tv } return }
go
func NewPublicKey(aType CryptoKeyType, value interface{}) (result PublicKey, err error) { result.Type = aType switch CryptoKeyType(aType) { case CryptoKeyTypeKeyTypeEd25519: tv, ok := value.(Uint256) if !ok { err = fmt.Errorf("invalid value, must be Uint256") return } result.Ed25519 = &tv } return }
[ "func", "NewPublicKey", "(", "aType", "CryptoKeyType", ",", "value", "interface", "{", "}", ")", "(", "result", "PublicKey", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "CryptoKeyType", "(", "aType", ")", "{", "cas...
// NewPublicKey creates a new PublicKey.
[ "NewPublicKey", "creates", "a", "new", "PublicKey", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L128-L140
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustEd25519
func (u PublicKey) MustEd25519() Uint256 { val, ok := u.GetEd25519() if !ok { panic("arm Ed25519 is not set") } return val }
go
func (u PublicKey) MustEd25519() Uint256 { val, ok := u.GetEd25519() if !ok { panic("arm Ed25519 is not set") } return val }
[ "func", "(", "u", "PublicKey", ")", "MustEd25519", "(", ")", "Uint256", "{", "val", ",", "ok", ":=", "u", ".", "GetEd25519", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Ed25519 is not set\"", ")", "\n", "}", "\n", "return", "val", "\n"...
// MustEd25519 retrieves the Ed25519 value from the union, // panicing if the value is not set.
[ "MustEd25519", "retrieves", "the", "Ed25519", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L144-L152
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewNodeId
func NewNodeId(aType CryptoKeyType, value interface{}) (result NodeId, err error) { u, err := NewPublicKey(aType, value) result = NodeId(u) return }
go
func NewNodeId(aType CryptoKeyType, value interface{}) (result NodeId, err error) { u, err := NewPublicKey(aType, value) result = NodeId(u) return }
[ "func", "NewNodeId", "(", "aType", "CryptoKeyType", ",", "value", "interface", "{", "}", ")", "(", "result", "NodeId", ",", "err", "error", ")", "{", "u", ",", "err", ":=", "NewPublicKey", "(", "aType", ",", "value", ")", "\n", "result", "=", "NodeId",...
// NewNodeId creates a new NodeId.
[ "NewNodeId", "creates", "a", "new", "NodeId", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L198-L202
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewAccountId
func NewAccountId(aType CryptoKeyType, value interface{}) (result AccountId, err error) { u, err := NewPublicKey(aType, value) result = AccountId(u) return }
go
func NewAccountId(aType CryptoKeyType, value interface{}) (result AccountId, err error) { u, err := NewPublicKey(aType, value) result = AccountId(u) return }
[ "func", "NewAccountId", "(", "aType", "CryptoKeyType", ",", "value", "interface", "{", "}", ")", "(", "result", "AccountId", ",", "err", "error", ")", "{", "u", ",", "err", ":=", "NewPublicKey", "(", "aType", ",", "value", ")", "\n", "result", "=", "Ac...
// NewAccountId creates a new AccountId.
[ "NewAccountId", "creates", "a", "new", "AccountId", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L279-L283
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e AssetType) ValidEnum(v int32) bool { _, ok := assetTypeMap[v] return ok }
go
func (e AssetType) ValidEnum(v int32) bool { _, ok := assetTypeMap[v] return ok }
[ "func", "(", "e", "AssetType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "assetTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for AssetType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "AssetType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L362-L365
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u Asset) ArmForSwitch(sw int32) (string, bool) { switch AssetType(sw) { case AssetTypeAssetTypeNative: return "", true case AssetTypeAssetTypeCreditAlphanum4: return "AlphaNum4", true case AssetTypeAssetTypeCreditAlphanum12: return "AlphaNum12", true } return "-", false }
go
func (u Asset) ArmForSwitch(sw int32) (string, bool) { switch AssetType(sw) { case AssetTypeAssetTypeNative: return "", true case AssetTypeAssetTypeCreditAlphanum4: return "AlphaNum4", true case AssetTypeAssetTypeCreditAlphanum12: return "AlphaNum12", true } return "-", false }
[ "func", "(", "u", "Asset", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "AssetType", "(", "sw", ")", "{", "case", "AssetTypeAssetTypeNative", ":", "return", "\"\"", ",", "true", "\n", "case", "AssetTypeAss...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of Asset
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "Asset" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L437-L447
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewAsset
func NewAsset(aType AssetType, value interface{}) (result Asset, err error) { result.Type = aType switch AssetType(aType) { case AssetTypeAssetTypeNative: // void case AssetTypeAssetTypeCreditAlphanum4: tv, ok := value.(AssetAlphaNum4) if !ok { err = fmt.Errorf("invalid value, must be AssetAlphaNum4") r...
go
func NewAsset(aType AssetType, value interface{}) (result Asset, err error) { result.Type = aType switch AssetType(aType) { case AssetTypeAssetTypeNative: // void case AssetTypeAssetTypeCreditAlphanum4: tv, ok := value.(AssetAlphaNum4) if !ok { err = fmt.Errorf("invalid value, must be AssetAlphaNum4") r...
[ "func", "NewAsset", "(", "aType", "AssetType", ",", "value", "interface", "{", "}", ")", "(", "result", "Asset", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "AssetType", "(", "aType", ")", "{", "case", "AssetType...
// NewAsset creates a new Asset.
[ "NewAsset", "creates", "a", "new", "Asset", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L450-L471
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAlphaNum4
func (u Asset) MustAlphaNum4() AssetAlphaNum4 { val, ok := u.GetAlphaNum4() if !ok { panic("arm AlphaNum4 is not set") } return val }
go
func (u Asset) MustAlphaNum4() AssetAlphaNum4 { val, ok := u.GetAlphaNum4() if !ok { panic("arm AlphaNum4 is not set") } return val }
[ "func", "(", "u", "Asset", ")", "MustAlphaNum4", "(", ")", "AssetAlphaNum4", "{", "val", ",", "ok", ":=", "u", ".", "GetAlphaNum4", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AlphaNum4 is not set\"", ")", "\n", "}", "\n", "return", "val...
// MustAlphaNum4 retrieves the AlphaNum4 value from the union, // panicing if the value is not set.
[ "MustAlphaNum4", "retrieves", "the", "AlphaNum4", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L475-L483
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAlphaNum4
func (u Asset) GetAlphaNum4() (result AssetAlphaNum4, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AlphaNum4" { result = *u.AlphaNum4 ok = true } return }
go
func (u Asset) GetAlphaNum4() (result AssetAlphaNum4, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AlphaNum4" { result = *u.AlphaNum4 ok = true } return }
[ "func", "(", "u", "Asset", ")", "GetAlphaNum4", "(", ")", "(", "result", "AssetAlphaNum4", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==",...
// GetAlphaNum4 retrieves the AlphaNum4 value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAlphaNum4", "retrieves", "the", "AlphaNum4", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L487-L496
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAlphaNum12
func (u Asset) MustAlphaNum12() AssetAlphaNum12 { val, ok := u.GetAlphaNum12() if !ok { panic("arm AlphaNum12 is not set") } return val }
go
func (u Asset) MustAlphaNum12() AssetAlphaNum12 { val, ok := u.GetAlphaNum12() if !ok { panic("arm AlphaNum12 is not set") } return val }
[ "func", "(", "u", "Asset", ")", "MustAlphaNum12", "(", ")", "AssetAlphaNum12", "{", "val", ",", "ok", ":=", "u", ".", "GetAlphaNum12", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AlphaNum12 is not set\"", ")", "\n", "}", "\n", "return", ...
// MustAlphaNum12 retrieves the AlphaNum12 value from the union, // panicing if the value is not set.
[ "MustAlphaNum12", "retrieves", "the", "AlphaNum12", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L500-L508
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAlphaNum12
func (u Asset) GetAlphaNum12() (result AssetAlphaNum12, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AlphaNum12" { result = *u.AlphaNum12 ok = true } return }
go
func (u Asset) GetAlphaNum12() (result AssetAlphaNum12, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AlphaNum12" { result = *u.AlphaNum12 ok = true } return }
[ "func", "(", "u", "Asset", ")", "GetAlphaNum12", "(", ")", "(", "result", "AssetAlphaNum12", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==...
// GetAlphaNum12 retrieves the AlphaNum12 value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAlphaNum12", "retrieves", "the", "AlphaNum12", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L512-L521
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e ThresholdIndexes) ValidEnum(v int32) bool { _, ok := thresholdIndexesMap[v] return ok }
go
func (e ThresholdIndexes) ValidEnum(v int32) bool { _, ok := thresholdIndexesMap[v] return ok }
[ "func", "(", "e", "ThresholdIndexes", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "thresholdIndexesMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for ThresholdIndexes
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "ThresholdIndexes" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L564-L567
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e LedgerEntryType) ValidEnum(v int32) bool { _, ok := ledgerEntryTypeMap[v] return ok }
go
func (e LedgerEntryType) ValidEnum(v int32) bool { _, ok := ledgerEntryTypeMap[v] return ok }
[ "func", "(", "e", "LedgerEntryType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "ledgerEntryTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for LedgerEntryType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "LedgerEntryType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L603-L606
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e AccountFlags) ValidEnum(v int32) bool { _, ok := accountFlagsMap[v] return ok }
go
func (e AccountFlags) ValidEnum(v int32) bool { _, ok := accountFlagsMap[v] return ok }
[ "func", "(", "e", "AccountFlags", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "accountFlagsMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for AccountFlags
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "AccountFlags" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L659-L662
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewAccountEntryExt
func NewAccountEntryExt(v int32, value interface{}) (result AccountEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewAccountEntryExt(v int32, value interface{}) (result AccountEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewAccountEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "AccountEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", ...
// NewAccountEntryExt creates a new AccountEntryExt.
[ "NewAccountEntryExt", "creates", "a", "new", "AccountEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L699-L706
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e TrustLineFlags) ValidEnum(v int32) bool { _, ok := trustLineFlagsMap[v] return ok }
go
func (e TrustLineFlags) ValidEnum(v int32) bool { _, ok := trustLineFlagsMap[v] return ok }
[ "func", "(", "e", "TrustLineFlags", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "trustLineFlagsMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for TrustLineFlags
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "TrustLineFlags" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L770-L773
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTrustLineEntryExt
func NewTrustLineEntryExt(v int32, value interface{}) (result TrustLineEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewTrustLineEntryExt(v int32, value interface{}) (result TrustLineEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewTrustLineEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "TrustLineEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":...
// NewTrustLineEntryExt creates a new TrustLineEntryExt.
[ "NewTrustLineEntryExt", "creates", "a", "new", "TrustLineEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L810-L817
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e OfferEntryFlags) ValidEnum(v int32) bool { _, ok := offerEntryFlagsMap[v] return ok }
go
func (e OfferEntryFlags) ValidEnum(v int32) bool { _, ok := offerEntryFlagsMap[v] return ok }
[ "func", "(", "e", "OfferEntryFlags", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "offerEntryFlagsMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for OfferEntryFlags
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "OfferEntryFlags" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L869-L872
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewOfferEntryExt
func NewOfferEntryExt(v int32, value interface{}) (result OfferEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewOfferEntryExt(v int32, value interface{}) (result OfferEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewOfferEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "OfferEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}"...
// NewOfferEntryExt creates a new OfferEntryExt.
[ "NewOfferEntryExt", "creates", "a", "new", "OfferEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L909-L916
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewDataEntryExt
func NewDataEntryExt(v int32, value interface{}) (result DataEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewDataEntryExt(v int32, value interface{}) (result DataEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewDataEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "DataEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", ...
// NewDataEntryExt creates a new DataEntryExt.
[ "NewDataEntryExt", "creates", "a", "new", "DataEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L985-L992
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerEntryData
func NewLedgerEntryData(aType LedgerEntryType, value interface{}) (result LedgerEntryData, err error) { result.Type = aType switch LedgerEntryType(aType) { case LedgerEntryTypeAccount: tv, ok := value.(AccountEntry) if !ok { err = fmt.Errorf("invalid value, must be AccountEntry") return } result.Accoun...
go
func NewLedgerEntryData(aType LedgerEntryType, value interface{}) (result LedgerEntryData, err error) { result.Type = aType switch LedgerEntryType(aType) { case LedgerEntryTypeAccount: tv, ok := value.(AccountEntry) if !ok { err = fmt.Errorf("invalid value, must be AccountEntry") return } result.Accoun...
[ "func", "NewLedgerEntryData", "(", "aType", "LedgerEntryType", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerEntryData", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "LedgerEntryType", "(", "aType", ")...
// NewLedgerEntryData creates a new LedgerEntryData.
[ "NewLedgerEntryData", "creates", "a", "new", "LedgerEntryData", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1063-L1096
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerEntryExt
func NewLedgerEntryExt(v int32, value interface{}) (result LedgerEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewLedgerEntryExt(v int32, value interface{}) (result LedgerEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewLedgerEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "...
// NewLedgerEntryExt creates a new LedgerEntryExt.
[ "NewLedgerEntryExt", "creates", "a", "new", "LedgerEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1227-L1234
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e EnvelopeType) ValidEnum(v int32) bool { _, ok := envelopeTypeMap[v] return ok }
go
func (e EnvelopeType) ValidEnum(v int32) bool { _, ok := envelopeTypeMap[v] return ok }
[ "func", "(", "e", "EnvelopeType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "envelopeTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for EnvelopeType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "EnvelopeType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1295-L1298
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e OperationType) ValidEnum(v int32) bool { _, ok := operationTypeMap[v] return ok }
go
func (e OperationType) ValidEnum(v int32) bool { _, ok := operationTypeMap[v] return ok }
[ "func", "(", "e", "OperationType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "operationTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for OperationType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "OperationType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1368-L1371
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u AllowTrustOpAsset) ArmForSwitch(sw int32) (string, bool) { switch AssetType(sw) { case AssetTypeAssetTypeCreditAlphanum4: return "AssetCode4", true case AssetTypeAssetTypeCreditAlphanum12: return "AssetCode12", true } return "-", false }
go
func (u AllowTrustOpAsset) ArmForSwitch(sw int32) (string, bool) { switch AssetType(sw) { case AssetTypeAssetTypeCreditAlphanum4: return "AssetCode4", true case AssetTypeAssetTypeCreditAlphanum12: return "AssetCode12", true } return "-", false }
[ "func", "(", "u", "AllowTrustOpAsset", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "AssetType", "(", "sw", ")", "{", "case", "AssetTypeAssetTypeCreditAlphanum4", ":", "return", "\"AssetCode4\"", ",", "true", ...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of AllowTrustOpAsset
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "AllowTrustOpAsset" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1547-L1555
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewAllowTrustOpAsset
func NewAllowTrustOpAsset(aType AssetType, value interface{}) (result AllowTrustOpAsset, err error) { result.Type = aType switch AssetType(aType) { case AssetTypeAssetTypeCreditAlphanum4: tv, ok := value.([4]byte) if !ok { err = fmt.Errorf("invalid value, must be [4]byte") return } result.AssetCode4 = ...
go
func NewAllowTrustOpAsset(aType AssetType, value interface{}) (result AllowTrustOpAsset, err error) { result.Type = aType switch AssetType(aType) { case AssetTypeAssetTypeCreditAlphanum4: tv, ok := value.([4]byte) if !ok { err = fmt.Errorf("invalid value, must be [4]byte") return } result.AssetCode4 = ...
[ "func", "NewAllowTrustOpAsset", "(", "aType", "AssetType", ",", "value", "interface", "{", "}", ")", "(", "result", "AllowTrustOpAsset", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "AssetType", "(", "aType", ")", "{"...
// NewAllowTrustOpAsset creates a new AllowTrustOpAsset.
[ "NewAllowTrustOpAsset", "creates", "a", "new", "AllowTrustOpAsset", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1558-L1577
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAssetCode4
func (u AllowTrustOpAsset) MustAssetCode4() [4]byte { val, ok := u.GetAssetCode4() if !ok { panic("arm AssetCode4 is not set") } return val }
go
func (u AllowTrustOpAsset) MustAssetCode4() [4]byte { val, ok := u.GetAssetCode4() if !ok { panic("arm AssetCode4 is not set") } return val }
[ "func", "(", "u", "AllowTrustOpAsset", ")", "MustAssetCode4", "(", ")", "[", "4", "]", "byte", "{", "val", ",", "ok", ":=", "u", ".", "GetAssetCode4", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AssetCode4 is not set\"", ")", "\n", "}", ...
// MustAssetCode4 retrieves the AssetCode4 value from the union, // panicing if the value is not set.
[ "MustAssetCode4", "retrieves", "the", "AssetCode4", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1581-L1589
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAssetCode4
func (u AllowTrustOpAsset) GetAssetCode4() (result [4]byte, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AssetCode4" { result = *u.AssetCode4 ok = true } return }
go
func (u AllowTrustOpAsset) GetAssetCode4() (result [4]byte, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AssetCode4" { result = *u.AssetCode4 ok = true } return }
[ "func", "(", "u", "AllowTrustOpAsset", ")", "GetAssetCode4", "(", ")", "(", "result", "[", "4", "]", "byte", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "i...
// GetAssetCode4 retrieves the AssetCode4 value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAssetCode4", "retrieves", "the", "AssetCode4", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1593-L1602
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAssetCode12
func (u AllowTrustOpAsset) MustAssetCode12() [12]byte { val, ok := u.GetAssetCode12() if !ok { panic("arm AssetCode12 is not set") } return val }
go
func (u AllowTrustOpAsset) MustAssetCode12() [12]byte { val, ok := u.GetAssetCode12() if !ok { panic("arm AssetCode12 is not set") } return val }
[ "func", "(", "u", "AllowTrustOpAsset", ")", "MustAssetCode12", "(", ")", "[", "12", "]", "byte", "{", "val", ",", "ok", ":=", "u", ".", "GetAssetCode12", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AssetCode12 is not set\"", ")", "\n", "...
// MustAssetCode12 retrieves the AssetCode12 value from the union, // panicing if the value is not set.
[ "MustAssetCode12", "retrieves", "the", "AssetCode12", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1606-L1614
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAssetCode12
func (u AllowTrustOpAsset) GetAssetCode12() (result [12]byte, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AssetCode12" { result = *u.AssetCode12 ok = true } return }
go
func (u AllowTrustOpAsset) GetAssetCode12() (result [12]byte, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AssetCode12" { result = *u.AssetCode12 ok = true } return }
[ "func", "(", "u", "AllowTrustOpAsset", ")", "GetAssetCode12", "(", ")", "(", "result", "[", "12", "]", "byte", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", ...
// GetAssetCode12 retrieves the AssetCode12 value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAssetCode12", "retrieves", "the", "AssetCode12", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1618-L1627
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewOperationBody
func NewOperationBody(aType OperationType, value interface{}) (result OperationBody, err error) { result.Type = aType switch OperationType(aType) { case OperationTypeCreateAccount: tv, ok := value.(CreateAccountOp) if !ok { err = fmt.Errorf("invalid value, must be CreateAccountOp") return } result.Crea...
go
func NewOperationBody(aType OperationType, value interface{}) (result OperationBody, err error) { result.Type = aType switch OperationType(aType) { case OperationTypeCreateAccount: tv, ok := value.(CreateAccountOp) if !ok { err = fmt.Errorf("invalid value, must be CreateAccountOp") return } result.Crea...
[ "func", "NewOperationBody", "(", "aType", "OperationType", ",", "value", "interface", "{", "}", ")", "(", "result", "OperationBody", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "OperationType", "(", "aType", ")", "{"...
// NewOperationBody creates a new OperationBody.
[ "NewOperationBody", "creates", "a", "new", "OperationBody", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1748-L1825
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustCreateAccountOp
func (u OperationBody) MustCreateAccountOp() CreateAccountOp { val, ok := u.GetCreateAccountOp() if !ok { panic("arm CreateAccountOp is not set") } return val }
go
func (u OperationBody) MustCreateAccountOp() CreateAccountOp { val, ok := u.GetCreateAccountOp() if !ok { panic("arm CreateAccountOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustCreateAccountOp", "(", ")", "CreateAccountOp", "{", "val", ",", "ok", ":=", "u", ".", "GetCreateAccountOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm CreateAccountOp is not set\"", ")", "\n", "}",...
// MustCreateAccountOp retrieves the CreateAccountOp value from the union, // panicing if the value is not set.
[ "MustCreateAccountOp", "retrieves", "the", "CreateAccountOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1829-L1837
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetCreateAccountOp
func (u OperationBody) GetCreateAccountOp() (result CreateAccountOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "CreateAccountOp" { result = *u.CreateAccountOp ok = true } return }
go
func (u OperationBody) GetCreateAccountOp() (result CreateAccountOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "CreateAccountOp" { result = *u.CreateAccountOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetCreateAccountOp", "(", ")", "(", "result", "CreateAccountOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "ar...
// GetCreateAccountOp retrieves the CreateAccountOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetCreateAccountOp", "retrieves", "the", "CreateAccountOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1841-L1850
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustPaymentOp
func (u OperationBody) MustPaymentOp() PaymentOp { val, ok := u.GetPaymentOp() if !ok { panic("arm PaymentOp is not set") } return val }
go
func (u OperationBody) MustPaymentOp() PaymentOp { val, ok := u.GetPaymentOp() if !ok { panic("arm PaymentOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustPaymentOp", "(", ")", "PaymentOp", "{", "val", ",", "ok", ":=", "u", ".", "GetPaymentOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm PaymentOp is not set\"", ")", "\n", "}", "\n", "return", "...
// MustPaymentOp retrieves the PaymentOp value from the union, // panicing if the value is not set.
[ "MustPaymentOp", "retrieves", "the", "PaymentOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1854-L1862
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetPaymentOp
func (u OperationBody) GetPaymentOp() (result PaymentOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PaymentOp" { result = *u.PaymentOp ok = true } return }
go
func (u OperationBody) GetPaymentOp() (result PaymentOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PaymentOp" { result = *u.PaymentOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetPaymentOp", "(", ")", "(", "result", "PaymentOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "=...
// GetPaymentOp retrieves the PaymentOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetPaymentOp", "retrieves", "the", "PaymentOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1866-L1875
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustPathPaymentOp
func (u OperationBody) MustPathPaymentOp() PathPaymentOp { val, ok := u.GetPathPaymentOp() if !ok { panic("arm PathPaymentOp is not set") } return val }
go
func (u OperationBody) MustPathPaymentOp() PathPaymentOp { val, ok := u.GetPathPaymentOp() if !ok { panic("arm PathPaymentOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustPathPaymentOp", "(", ")", "PathPaymentOp", "{", "val", ",", "ok", ":=", "u", ".", "GetPathPaymentOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm PathPaymentOp is not set\"", ")", "\n", "}", "\n",...
// MustPathPaymentOp retrieves the PathPaymentOp value from the union, // panicing if the value is not set.
[ "MustPathPaymentOp", "retrieves", "the", "PathPaymentOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1879-L1887
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetPathPaymentOp
func (u OperationBody) GetPathPaymentOp() (result PathPaymentOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PathPaymentOp" { result = *u.PathPaymentOp ok = true } return }
go
func (u OperationBody) GetPathPaymentOp() (result PathPaymentOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PathPaymentOp" { result = *u.PathPaymentOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetPathPaymentOp", "(", ")", "(", "result", "PathPaymentOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armNam...
// GetPathPaymentOp retrieves the PathPaymentOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetPathPaymentOp", "retrieves", "the", "PathPaymentOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1891-L1900
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustManageOfferOp
func (u OperationBody) MustManageOfferOp() ManageOfferOp { val, ok := u.GetManageOfferOp() if !ok { panic("arm ManageOfferOp is not set") } return val }
go
func (u OperationBody) MustManageOfferOp() ManageOfferOp { val, ok := u.GetManageOfferOp() if !ok { panic("arm ManageOfferOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustManageOfferOp", "(", ")", "ManageOfferOp", "{", "val", ",", "ok", ":=", "u", ".", "GetManageOfferOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm ManageOfferOp is not set\"", ")", "\n", "}", "\n",...
// MustManageOfferOp retrieves the ManageOfferOp value from the union, // panicing if the value is not set.
[ "MustManageOfferOp", "retrieves", "the", "ManageOfferOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1904-L1912
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetManageOfferOp
func (u OperationBody) GetManageOfferOp() (result ManageOfferOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageOfferOp" { result = *u.ManageOfferOp ok = true } return }
go
func (u OperationBody) GetManageOfferOp() (result ManageOfferOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageOfferOp" { result = *u.ManageOfferOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetManageOfferOp", "(", ")", "(", "result", "ManageOfferOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armNam...
// GetManageOfferOp retrieves the ManageOfferOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetManageOfferOp", "retrieves", "the", "ManageOfferOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1916-L1925
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustCreatePassiveOfferOp
func (u OperationBody) MustCreatePassiveOfferOp() CreatePassiveOfferOp { val, ok := u.GetCreatePassiveOfferOp() if !ok { panic("arm CreatePassiveOfferOp is not set") } return val }
go
func (u OperationBody) MustCreatePassiveOfferOp() CreatePassiveOfferOp { val, ok := u.GetCreatePassiveOfferOp() if !ok { panic("arm CreatePassiveOfferOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustCreatePassiveOfferOp", "(", ")", "CreatePassiveOfferOp", "{", "val", ",", "ok", ":=", "u", ".", "GetCreatePassiveOfferOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm CreatePassiveOfferOp is not set\"", ...
// MustCreatePassiveOfferOp retrieves the CreatePassiveOfferOp value from the union, // panicing if the value is not set.
[ "MustCreatePassiveOfferOp", "retrieves", "the", "CreatePassiveOfferOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1929-L1937
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetCreatePassiveOfferOp
func (u OperationBody) GetCreatePassiveOfferOp() (result CreatePassiveOfferOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "CreatePassiveOfferOp" { result = *u.CreatePassiveOfferOp ok = true } return }
go
func (u OperationBody) GetCreatePassiveOfferOp() (result CreatePassiveOfferOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "CreatePassiveOfferOp" { result = *u.CreatePassiveOfferOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetCreatePassiveOfferOp", "(", ")", "(", "result", "CreatePassiveOfferOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "...
// GetCreatePassiveOfferOp retrieves the CreatePassiveOfferOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetCreatePassiveOfferOp", "retrieves", "the", "CreatePassiveOfferOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1941-L1950
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustSetOptionsOp
func (u OperationBody) MustSetOptionsOp() SetOptionsOp { val, ok := u.GetSetOptionsOp() if !ok { panic("arm SetOptionsOp is not set") } return val }
go
func (u OperationBody) MustSetOptionsOp() SetOptionsOp { val, ok := u.GetSetOptionsOp() if !ok { panic("arm SetOptionsOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustSetOptionsOp", "(", ")", "SetOptionsOp", "{", "val", ",", "ok", ":=", "u", ".", "GetSetOptionsOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm SetOptionsOp is not set\"", ")", "\n", "}", "\n", "...
// MustSetOptionsOp retrieves the SetOptionsOp value from the union, // panicing if the value is not set.
[ "MustSetOptionsOp", "retrieves", "the", "SetOptionsOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1954-L1962
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetSetOptionsOp
func (u OperationBody) GetSetOptionsOp() (result SetOptionsOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "SetOptionsOp" { result = *u.SetOptionsOp ok = true } return }
go
func (u OperationBody) GetSetOptionsOp() (result SetOptionsOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "SetOptionsOp" { result = *u.SetOptionsOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetSetOptionsOp", "(", ")", "(", "result", "SetOptionsOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName"...
// GetSetOptionsOp retrieves the SetOptionsOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetSetOptionsOp", "retrieves", "the", "SetOptionsOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1966-L1975
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustChangeTrustOp
func (u OperationBody) MustChangeTrustOp() ChangeTrustOp { val, ok := u.GetChangeTrustOp() if !ok { panic("arm ChangeTrustOp is not set") } return val }
go
func (u OperationBody) MustChangeTrustOp() ChangeTrustOp { val, ok := u.GetChangeTrustOp() if !ok { panic("arm ChangeTrustOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustChangeTrustOp", "(", ")", "ChangeTrustOp", "{", "val", ",", "ok", ":=", "u", ".", "GetChangeTrustOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm ChangeTrustOp is not set\"", ")", "\n", "}", "\n",...
// MustChangeTrustOp retrieves the ChangeTrustOp value from the union, // panicing if the value is not set.
[ "MustChangeTrustOp", "retrieves", "the", "ChangeTrustOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1979-L1987
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetChangeTrustOp
func (u OperationBody) GetChangeTrustOp() (result ChangeTrustOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ChangeTrustOp" { result = *u.ChangeTrustOp ok = true } return }
go
func (u OperationBody) GetChangeTrustOp() (result ChangeTrustOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ChangeTrustOp" { result = *u.ChangeTrustOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetChangeTrustOp", "(", ")", "(", "result", "ChangeTrustOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armNam...
// GetChangeTrustOp retrieves the ChangeTrustOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetChangeTrustOp", "retrieves", "the", "ChangeTrustOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L1991-L2000
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAllowTrustOp
func (u OperationBody) MustAllowTrustOp() AllowTrustOp { val, ok := u.GetAllowTrustOp() if !ok { panic("arm AllowTrustOp is not set") } return val }
go
func (u OperationBody) MustAllowTrustOp() AllowTrustOp { val, ok := u.GetAllowTrustOp() if !ok { panic("arm AllowTrustOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustAllowTrustOp", "(", ")", "AllowTrustOp", "{", "val", ",", "ok", ":=", "u", ".", "GetAllowTrustOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AllowTrustOp is not set\"", ")", "\n", "}", "\n", "...
// MustAllowTrustOp retrieves the AllowTrustOp value from the union, // panicing if the value is not set.
[ "MustAllowTrustOp", "retrieves", "the", "AllowTrustOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2004-L2012
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAllowTrustOp
func (u OperationBody) GetAllowTrustOp() (result AllowTrustOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AllowTrustOp" { result = *u.AllowTrustOp ok = true } return }
go
func (u OperationBody) GetAllowTrustOp() (result AllowTrustOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AllowTrustOp" { result = *u.AllowTrustOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetAllowTrustOp", "(", ")", "(", "result", "AllowTrustOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName"...
// GetAllowTrustOp retrieves the AllowTrustOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAllowTrustOp", "retrieves", "the", "AllowTrustOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2016-L2025
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustDestination
func (u OperationBody) MustDestination() AccountId { val, ok := u.GetDestination() if !ok { panic("arm Destination is not set") } return val }
go
func (u OperationBody) MustDestination() AccountId { val, ok := u.GetDestination() if !ok { panic("arm Destination is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustDestination", "(", ")", "AccountId", "{", "val", ",", "ok", ":=", "u", ".", "GetDestination", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Destination is not set\"", ")", "\n", "}", "\n", "return...
// MustDestination retrieves the Destination value from the union, // panicing if the value is not set.
[ "MustDestination", "retrieves", "the", "Destination", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2029-L2037
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetDestination
func (u OperationBody) GetDestination() (result AccountId, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Destination" { result = *u.Destination ok = true } return }
go
func (u OperationBody) GetDestination() (result AccountId, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Destination" { result = *u.Destination ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetDestination", "(", ")", "(", "result", "AccountId", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", ...
// GetDestination retrieves the Destination value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetDestination", "retrieves", "the", "Destination", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2041-L2050
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustManageDataOp
func (u OperationBody) MustManageDataOp() ManageDataOp { val, ok := u.GetManageDataOp() if !ok { panic("arm ManageDataOp is not set") } return val }
go
func (u OperationBody) MustManageDataOp() ManageDataOp { val, ok := u.GetManageDataOp() if !ok { panic("arm ManageDataOp is not set") } return val }
[ "func", "(", "u", "OperationBody", ")", "MustManageDataOp", "(", ")", "ManageDataOp", "{", "val", ",", "ok", ":=", "u", ".", "GetManageDataOp", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm ManageDataOp is not set\"", ")", "\n", "}", "\n", "...
// MustManageDataOp retrieves the ManageDataOp value from the union, // panicing if the value is not set.
[ "MustManageDataOp", "retrieves", "the", "ManageDataOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2054-L2062
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetManageDataOp
func (u OperationBody) GetManageDataOp() (result ManageDataOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageDataOp" { result = *u.ManageDataOp ok = true } return }
go
func (u OperationBody) GetManageDataOp() (result ManageDataOp, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageDataOp" { result = *u.ManageDataOp ok = true } return }
[ "func", "(", "u", "OperationBody", ")", "GetManageDataOp", "(", ")", "(", "result", "ManageDataOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName"...
// GetManageDataOp retrieves the ManageDataOp value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetManageDataOp", "retrieves", "the", "ManageDataOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2066-L2075
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e MemoType) ValidEnum(v int32) bool { _, ok := memoTypeMap[v] return ok }
go
func (e MemoType) ValidEnum(v int32) bool { _, ok := memoTypeMap[v] return ok }
[ "func", "(", "e", "MemoType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "memoTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for MemoType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "MemoType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2150-L2153
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u Memo) ArmForSwitch(sw int32) (string, bool) { switch MemoType(sw) { case MemoTypeMemoNone: return "", true case MemoTypeMemoText: return "Text", true case MemoTypeMemoId: return "Id", true case MemoTypeMemoHash: return "Hash", true case MemoTypeMemoReturn: return "RetHash", true } return "-", ...
go
func (u Memo) ArmForSwitch(sw int32) (string, bool) { switch MemoType(sw) { case MemoTypeMemoNone: return "", true case MemoTypeMemoText: return "Text", true case MemoTypeMemoId: return "Id", true case MemoTypeMemoHash: return "Hash", true case MemoTypeMemoReturn: return "RetHash", true } return "-", ...
[ "func", "(", "u", "Memo", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "MemoType", "(", "sw", ")", "{", "case", "MemoTypeMemoNone", ":", "return", "\"\"", ",", "true", "\n", "case", "MemoTypeMemoText", "...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of Memo
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "Memo" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2193-L2207
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewMemo
func NewMemo(aType MemoType, value interface{}) (result Memo, err error) { result.Type = aType switch MemoType(aType) { case MemoTypeMemoNone: // void case MemoTypeMemoText: tv, ok := value.(string) if !ok { err = fmt.Errorf("invalid value, must be string") return } result.Text = &tv case MemoTypeM...
go
func NewMemo(aType MemoType, value interface{}) (result Memo, err error) { result.Type = aType switch MemoType(aType) { case MemoTypeMemoNone: // void case MemoTypeMemoText: tv, ok := value.(string) if !ok { err = fmt.Errorf("invalid value, must be string") return } result.Text = &tv case MemoTypeM...
[ "func", "NewMemo", "(", "aType", "MemoType", ",", "value", "interface", "{", "}", ")", "(", "result", "Memo", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "MemoType", "(", "aType", ")", "{", "case", "MemoTypeMemoN...
// NewMemo creates a new Memo.
[ "NewMemo", "creates", "a", "new", "Memo", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2210-L2245
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustText
func (u Memo) MustText() string { val, ok := u.GetText() if !ok { panic("arm Text is not set") } return val }
go
func (u Memo) MustText() string { val, ok := u.GetText() if !ok { panic("arm Text is not set") } return val }
[ "func", "(", "u", "Memo", ")", "MustText", "(", ")", "string", "{", "val", ",", "ok", ":=", "u", ".", "GetText", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Text is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustText retrieves the Text value from the union, // panicing if the value is not set.
[ "MustText", "retrieves", "the", "Text", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2249-L2257
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetText
func (u Memo) GetText() (result string, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Text" { result = *u.Text ok = true } return }
go
func (u Memo) GetText() (result string, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Text" { result = *u.Text ok = true } return }
[ "func", "(", "u", "Memo", ")", "GetText", "(", ")", "(", "result", "string", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Text\"",...
// GetText retrieves the Text value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetText", "retrieves", "the", "Text", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2261-L2270
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustId
func (u Memo) MustId() Uint64 { val, ok := u.GetId() if !ok { panic("arm Id is not set") } return val }
go
func (u Memo) MustId() Uint64 { val, ok := u.GetId() if !ok { panic("arm Id is not set") } return val }
[ "func", "(", "u", "Memo", ")", "MustId", "(", ")", "Uint64", "{", "val", ",", "ok", ":=", "u", ".", "GetId", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Id is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustId retrieves the Id value from the union, // panicing if the value is not set.
[ "MustId", "retrieves", "the", "Id", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2274-L2282
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetId
func (u Memo) GetId() (result Uint64, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Id" { result = *u.Id ok = true } return }
go
func (u Memo) GetId() (result Uint64, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Id" { result = *u.Id ok = true } return }
[ "func", "(", "u", "Memo", ")", "GetId", "(", ")", "(", "result", "Uint64", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Id\"", "...
// GetId retrieves the Id value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetId", "retrieves", "the", "Id", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2286-L2295
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustHash
func (u Memo) MustHash() Hash { val, ok := u.GetHash() if !ok { panic("arm Hash is not set") } return val }
go
func (u Memo) MustHash() Hash { val, ok := u.GetHash() if !ok { panic("arm Hash is not set") } return val }
[ "func", "(", "u", "Memo", ")", "MustHash", "(", ")", "Hash", "{", "val", ",", "ok", ":=", "u", ".", "GetHash", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Hash is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustHash retrieves the Hash value from the union, // panicing if the value is not set.
[ "MustHash", "retrieves", "the", "Hash", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2299-L2307
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetHash
func (u Memo) GetHash() (result Hash, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Hash" { result = *u.Hash ok = true } return }
go
func (u Memo) GetHash() (result Hash, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Hash" { result = *u.Hash ok = true } return }
[ "func", "(", "u", "Memo", ")", "GetHash", "(", ")", "(", "result", "Hash", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Hash\"", ...
// GetHash retrieves the Hash value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetHash", "retrieves", "the", "Hash", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2311-L2320
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustRetHash
func (u Memo) MustRetHash() Hash { val, ok := u.GetRetHash() if !ok { panic("arm RetHash is not set") } return val }
go
func (u Memo) MustRetHash() Hash { val, ok := u.GetRetHash() if !ok { panic("arm RetHash is not set") } return val }
[ "func", "(", "u", "Memo", ")", "MustRetHash", "(", ")", "Hash", "{", "val", ",", "ok", ":=", "u", ".", "GetRetHash", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm RetHash is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ...
// MustRetHash retrieves the RetHash value from the union, // panicing if the value is not set.
[ "MustRetHash", "retrieves", "the", "RetHash", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2324-L2332
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTransactionExt
func NewTransactionExt(v int32, value interface{}) (result TransactionExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewTransactionExt(v int32, value interface{}) (result TransactionExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewTransactionExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "TransactionExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "...
// NewTransactionExt creates a new TransactionExt.
[ "NewTransactionExt", "creates", "a", "new", "TransactionExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2389-L2396
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e CreateAccountResultCode) ValidEnum(v int32) bool { _, ok := createAccountResultCodeMap[v] return ok }
go
func (e CreateAccountResultCode) ValidEnum(v int32) bool { _, ok := createAccountResultCodeMap[v] return ok }
[ "func", "(", "e", "CreateAccountResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "createAccountResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for CreateAccountResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "CreateAccountResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2511-L2514
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u CreateAccountResult) ArmForSwitch(sw int32) (string, bool) { switch CreateAccountResultCode(sw) { case CreateAccountResultCodeCreateAccountSuccess: return "", true default: return "", true } }
go
func (u CreateAccountResult) ArmForSwitch(sw int32) (string, bool) { switch CreateAccountResultCode(sw) { case CreateAccountResultCodeCreateAccountSuccess: return "", true default: return "", true } }
[ "func", "(", "u", "CreateAccountResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "CreateAccountResultCode", "(", "sw", ")", "{", "case", "CreateAccountResultCodeCreateAccountSuccess", ":", "return", "\"\"", "...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of CreateAccountResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "CreateAccountResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2544-L2551
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewCreateAccountResult
func NewCreateAccountResult(code CreateAccountResultCode, value interface{}) (result CreateAccountResult, err error) { result.Code = code switch CreateAccountResultCode(code) { case CreateAccountResultCodeCreateAccountSuccess: // void default: // void } return }
go
func NewCreateAccountResult(code CreateAccountResultCode, value interface{}) (result CreateAccountResult, err error) { result.Code = code switch CreateAccountResultCode(code) { case CreateAccountResultCodeCreateAccountSuccess: // void default: // void } return }
[ "func", "NewCreateAccountResult", "(", "code", "CreateAccountResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "CreateAccountResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "CreateAccountResultCode", ...
// NewCreateAccountResult creates a new CreateAccountResult.
[ "NewCreateAccountResult", "creates", "a", "new", "CreateAccountResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2554-L2563
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e PaymentResultCode) ValidEnum(v int32) bool { _, ok := paymentResultCodeMap[v] return ok }
go
func (e PaymentResultCode) ValidEnum(v int32) bool { _, ok := paymentResultCodeMap[v] return ok }
[ "func", "(", "e", "PaymentResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "paymentResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for PaymentResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "PaymentResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2614-L2617
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u PaymentResult) ArmForSwitch(sw int32) (string, bool) { switch PaymentResultCode(sw) { case PaymentResultCodePaymentSuccess: return "", true default: return "", true } }
go
func (u PaymentResult) ArmForSwitch(sw int32) (string, bool) { switch PaymentResultCode(sw) { case PaymentResultCodePaymentSuccess: return "", true default: return "", true } }
[ "func", "(", "u", "PaymentResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "PaymentResultCode", "(", "sw", ")", "{", "case", "PaymentResultCodePaymentSuccess", ":", "return", "\"\"", ",", "true", "\n", ...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of PaymentResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "PaymentResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2647-L2654
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewPaymentResult
func NewPaymentResult(code PaymentResultCode, value interface{}) (result PaymentResult, err error) { result.Code = code switch PaymentResultCode(code) { case PaymentResultCodePaymentSuccess: // void default: // void } return }
go
func NewPaymentResult(code PaymentResultCode, value interface{}) (result PaymentResult, err error) { result.Code = code switch PaymentResultCode(code) { case PaymentResultCodePaymentSuccess: // void default: // void } return }
[ "func", "NewPaymentResult", "(", "code", "PaymentResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "PaymentResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "PaymentResultCode", "(", "code", ")", ...
// NewPaymentResult creates a new PaymentResult.
[ "NewPaymentResult", "creates", "a", "new", "PaymentResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2657-L2666
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e PathPaymentResultCode) ValidEnum(v int32) bool { _, ok := pathPaymentResultCodeMap[v] return ok }
go
func (e PathPaymentResultCode) ValidEnum(v int32) bool { _, ok := pathPaymentResultCodeMap[v] return ok }
[ "func", "(", "e", "PathPaymentResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "pathPaymentResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for PathPaymentResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "PathPaymentResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2726-L2729
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u PathPaymentResult) ArmForSwitch(sw int32) (string, bool) { switch PathPaymentResultCode(sw) { case PathPaymentResultCodePathPaymentSuccess: return "Success", true case PathPaymentResultCodePathPaymentNoIssuer: return "NoIssuer", true default: return "", true } }
go
func (u PathPaymentResult) ArmForSwitch(sw int32) (string, bool) { switch PathPaymentResultCode(sw) { case PathPaymentResultCodePathPaymentSuccess: return "Success", true case PathPaymentResultCodePathPaymentNoIssuer: return "NoIssuer", true default: return "", true } }
[ "func", "(", "u", "PathPaymentResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "PathPaymentResultCode", "(", "sw", ")", "{", "case", "PathPaymentResultCodePathPaymentSuccess", ":", "return", "\"Success\"", ",...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of PathPaymentResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "PathPaymentResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2795-L2804
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewPathPaymentResult
func NewPathPaymentResult(code PathPaymentResultCode, value interface{}) (result PathPaymentResult, err error) { result.Code = code switch PathPaymentResultCode(code) { case PathPaymentResultCodePathPaymentSuccess: tv, ok := value.(PathPaymentResultSuccess) if !ok { err = fmt.Errorf("invalid value, must be Pa...
go
func NewPathPaymentResult(code PathPaymentResultCode, value interface{}) (result PathPaymentResult, err error) { result.Code = code switch PathPaymentResultCode(code) { case PathPaymentResultCodePathPaymentSuccess: tv, ok := value.(PathPaymentResultSuccess) if !ok { err = fmt.Errorf("invalid value, must be Pa...
[ "func", "NewPathPaymentResult", "(", "code", "PathPaymentResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "PathPaymentResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "PathPaymentResultCode", "(", ...
// NewPathPaymentResult creates a new PathPaymentResult.
[ "NewPathPaymentResult", "creates", "a", "new", "PathPaymentResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2807-L2828
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustNoIssuer
func (u PathPaymentResult) MustNoIssuer() Asset { val, ok := u.GetNoIssuer() if !ok { panic("arm NoIssuer is not set") } return val }
go
func (u PathPaymentResult) MustNoIssuer() Asset { val, ok := u.GetNoIssuer() if !ok { panic("arm NoIssuer is not set") } return val }
[ "func", "(", "u", "PathPaymentResult", ")", "MustNoIssuer", "(", ")", "Asset", "{", "val", ",", "ok", ":=", "u", ".", "GetNoIssuer", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm NoIssuer is not set\"", ")", "\n", "}", "\n", "return", "val...
// MustNoIssuer retrieves the NoIssuer value from the union, // panicing if the value is not set.
[ "MustNoIssuer", "retrieves", "the", "NoIssuer", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2857-L2865
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetNoIssuer
func (u PathPaymentResult) GetNoIssuer() (result Asset, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "NoIssuer" { result = *u.NoIssuer ok = true } return }
go
func (u PathPaymentResult) GetNoIssuer() (result Asset, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "NoIssuer" { result = *u.NoIssuer ok = true } return }
[ "func", "(", "u", "PathPaymentResult", ")", "GetNoIssuer", "(", ")", "(", "result", "Asset", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Code", ")", ")", "\n", "if", "armName", "==...
// GetNoIssuer retrieves the NoIssuer value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetNoIssuer", "retrieves", "the", "NoIssuer", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2869-L2878
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e ManageOfferResultCode) ValidEnum(v int32) bool { _, ok := manageOfferResultCodeMap[v] return ok }
go
func (e ManageOfferResultCode) ValidEnum(v int32) bool { _, ok := manageOfferResultCodeMap[v] return ok }
[ "func", "(", "e", "ManageOfferResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "manageOfferResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for ManageOfferResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "ManageOfferResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2941-L2944
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e ManageOfferEffect) ValidEnum(v int32) bool { _, ok := manageOfferEffectMap[v] return ok }
go
func (e ManageOfferEffect) ValidEnum(v int32) bool { _, ok := manageOfferEffectMap[v] return ok }
[ "func", "(", "e", "ManageOfferEffect", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "manageOfferEffectMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for ManageOfferEffect
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "ManageOfferEffect" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L2977-L2980
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u ManageOfferSuccessResultOffer) ArmForSwitch(sw int32) (string, bool) { switch ManageOfferEffect(sw) { case ManageOfferEffectManageOfferCreated: return "Offer", true case ManageOfferEffectManageOfferUpdated: return "Offer", true default: return "", true } }
go
func (u ManageOfferSuccessResultOffer) ArmForSwitch(sw int32) (string, bool) { switch ManageOfferEffect(sw) { case ManageOfferEffectManageOfferCreated: return "Offer", true case ManageOfferEffectManageOfferUpdated: return "Offer", true default: return "", true } }
[ "func", "(", "u", "ManageOfferSuccessResultOffer", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "ManageOfferEffect", "(", "sw", ")", "{", "case", "ManageOfferEffectManageOfferCreated", ":", "return", "\"Offer\"", ...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of ManageOfferSuccessResultOffer
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "ManageOfferSuccessResultOffer" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3012-L3021
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewManageOfferSuccessResultOffer
func NewManageOfferSuccessResultOffer(effect ManageOfferEffect, value interface{}) (result ManageOfferSuccessResultOffer, err error) { result.Effect = effect switch ManageOfferEffect(effect) { case ManageOfferEffectManageOfferCreated: tv, ok := value.(OfferEntry) if !ok { err = fmt.Errorf("invalid value, must...
go
func NewManageOfferSuccessResultOffer(effect ManageOfferEffect, value interface{}) (result ManageOfferSuccessResultOffer, err error) { result.Effect = effect switch ManageOfferEffect(effect) { case ManageOfferEffectManageOfferCreated: tv, ok := value.(OfferEntry) if !ok { err = fmt.Errorf("invalid value, must...
[ "func", "NewManageOfferSuccessResultOffer", "(", "effect", "ManageOfferEffect", ",", "value", "interface", "{", "}", ")", "(", "result", "ManageOfferSuccessResultOffer", ",", "err", "error", ")", "{", "result", ".", "Effect", "=", "effect", "\n", "switch", "Manage...
// NewManageOfferSuccessResultOffer creates a new ManageOfferSuccessResultOffer.
[ "NewManageOfferSuccessResultOffer", "creates", "a", "new", "ManageOfferSuccessResultOffer", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3024-L3045
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u ManageOfferResult) ArmForSwitch(sw int32) (string, bool) { switch ManageOfferResultCode(sw) { case ManageOfferResultCodeManageOfferSuccess: return "Success", true default: return "", true } }
go
func (u ManageOfferResult) ArmForSwitch(sw int32) (string, bool) { switch ManageOfferResultCode(sw) { case ManageOfferResultCodeManageOfferSuccess: return "Success", true default: return "", true } }
[ "func", "(", "u", "ManageOfferResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "ManageOfferResultCode", "(", "sw", ")", "{", "case", "ManageOfferResultCodeManageOfferSuccess", ":", "return", "\"Success\"", ",...
// ArmForSwitch returns which field name should be used for storing // the value for an instance of ManageOfferResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "ManageOfferResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3118-L3125
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewManageOfferResult
func NewManageOfferResult(code ManageOfferResultCode, value interface{}) (result ManageOfferResult, err error) { result.Code = code switch ManageOfferResultCode(code) { case ManageOfferResultCodeManageOfferSuccess: tv, ok := value.(ManageOfferSuccessResult) if !ok { err = fmt.Errorf("invalid value, must be Ma...
go
func NewManageOfferResult(code ManageOfferResultCode, value interface{}) (result ManageOfferResult, err error) { result.Code = code switch ManageOfferResultCode(code) { case ManageOfferResultCodeManageOfferSuccess: tv, ok := value.(ManageOfferSuccessResult) if !ok { err = fmt.Errorf("invalid value, must be Ma...
[ "func", "NewManageOfferResult", "(", "code", "ManageOfferResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "ManageOfferResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "ManageOfferResultCode", "(", ...
// NewManageOfferResult creates a new ManageOfferResult.
[ "NewManageOfferResult", "creates", "a", "new", "ManageOfferResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3128-L3142
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e SetOptionsResultCode) ValidEnum(v int32) bool { _, ok := setOptionsResultCodeMap[v] return ok }
go
func (e SetOptionsResultCode) ValidEnum(v int32) bool { _, ok := setOptionsResultCodeMap[v] return ok }
[ "func", "(", "e", "SetOptionsResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "setOptionsResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for SetOptionsResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "SetOptionsResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3217-L3220
test