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
xdr/xdr_generated.go
ArmForSwitch
func (u SetOptionsResult) ArmForSwitch(sw int32) (string, bool) { switch SetOptionsResultCode(sw) { case SetOptionsResultCodeSetOptionsSuccess: return "", true default: return "", true } }
go
func (u SetOptionsResult) ArmForSwitch(sw int32) (string, bool) { switch SetOptionsResultCode(sw) { case SetOptionsResultCodeSetOptionsSuccess: return "", true default: return "", true } }
[ "func", "(", "u", "SetOptionsResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "SetOptionsResultCode", "(", "sw", ")", "{", "case", "SetOptionsResultCodeSetOptionsSuccess", ":", "return", "\"\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of SetOptionsResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "SetOptionsResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3250-L3257
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewSetOptionsResult
func NewSetOptionsResult(code SetOptionsResultCode, value interface{}) (result SetOptionsResult, err error) { result.Code = code switch SetOptionsResultCode(code) { case SetOptionsResultCodeSetOptionsSuccess: // void default: // void } return }
go
func NewSetOptionsResult(code SetOptionsResultCode, value interface{}) (result SetOptionsResult, err error) { result.Code = code switch SetOptionsResultCode(code) { case SetOptionsResultCodeSetOptionsSuccess: // void default: // void } return }
[ "func", "NewSetOptionsResult", "(", "code", "SetOptionsResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "SetOptionsResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "SetOptionsResultCode", "(", "code", ")", "{", "case", "SetOptionsResultCodeSetOptionsSuccess", ":", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewSetOptionsResult creates a new SetOptionsResult.
[ "NewSetOptionsResult", "creates", "a", "new", "SetOptionsResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3260-L3269
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e ChangeTrustResultCode) ValidEnum(v int32) bool { _, ok := changeTrustResultCodeMap[v] return ok }
go
func (e ChangeTrustResultCode) ValidEnum(v int32) bool { _, ok := changeTrustResultCodeMap[v] return ok }
[ "func", "(", "e", "ChangeTrustResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "changeTrustResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for ChangeTrustResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "ChangeTrustResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3305-L3308
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u ChangeTrustResult) ArmForSwitch(sw int32) (string, bool) { switch ChangeTrustResultCode(sw) { case ChangeTrustResultCodeChangeTrustSuccess: return "", true default: return "", true } }
go
func (u ChangeTrustResult) ArmForSwitch(sw int32) (string, bool) { switch ChangeTrustResultCode(sw) { case ChangeTrustResultCodeChangeTrustSuccess: return "", true default: return "", true } }
[ "func", "(", "u", "ChangeTrustResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "ChangeTrustResultCode", "(", "sw", ")", "{", "case", "ChangeTrustResultCodeChangeTrustSuccess", ":", "return", "\"\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of ChangeTrustResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "ChangeTrustResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3338-L3345
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewChangeTrustResult
func NewChangeTrustResult(code ChangeTrustResultCode, value interface{}) (result ChangeTrustResult, err error) { result.Code = code switch ChangeTrustResultCode(code) { case ChangeTrustResultCodeChangeTrustSuccess: // void default: // void } return }
go
func NewChangeTrustResult(code ChangeTrustResultCode, value interface{}) (result ChangeTrustResult, err error) { result.Code = code switch ChangeTrustResultCode(code) { case ChangeTrustResultCodeChangeTrustSuccess: // void default: // void } return }
[ "func", "NewChangeTrustResult", "(", "code", "ChangeTrustResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "ChangeTrustResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "ChangeTrustResultCode", "(", "code", ")", "{", "case", "ChangeTrustResultCodeChangeTrustSuccess", ":", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewChangeTrustResult creates a new ChangeTrustResult.
[ "NewChangeTrustResult", "creates", "a", "new", "ChangeTrustResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3348-L3357
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e AllowTrustResultCode) ValidEnum(v int32) bool { _, ok := allowTrustResultCodeMap[v] return ok }
go
func (e AllowTrustResultCode) ValidEnum(v int32) bool { _, ok := allowTrustResultCodeMap[v] return ok }
[ "func", "(", "e", "AllowTrustResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "allowTrustResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for AllowTrustResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "AllowTrustResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3393-L3396
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u AllowTrustResult) ArmForSwitch(sw int32) (string, bool) { switch AllowTrustResultCode(sw) { case AllowTrustResultCodeAllowTrustSuccess: return "", true default: return "", true } }
go
func (u AllowTrustResult) ArmForSwitch(sw int32) (string, bool) { switch AllowTrustResultCode(sw) { case AllowTrustResultCodeAllowTrustSuccess: return "", true default: return "", true } }
[ "func", "(", "u", "AllowTrustResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "AllowTrustResultCode", "(", "sw", ")", "{", "case", "AllowTrustResultCodeAllowTrustSuccess", ":", "return", "\"\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of AllowTrustResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "AllowTrustResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3426-L3433
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewAllowTrustResult
func NewAllowTrustResult(code AllowTrustResultCode, value interface{}) (result AllowTrustResult, err error) { result.Code = code switch AllowTrustResultCode(code) { case AllowTrustResultCodeAllowTrustSuccess: // void default: // void } return }
go
func NewAllowTrustResult(code AllowTrustResultCode, value interface{}) (result AllowTrustResult, err error) { result.Code = code switch AllowTrustResultCode(code) { case AllowTrustResultCodeAllowTrustSuccess: // void default: // void } return }
[ "func", "NewAllowTrustResult", "(", "code", "AllowTrustResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "AllowTrustResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "AllowTrustResultCode", "(", "code", ")", "{", "case", "AllowTrustResultCodeAllowTrustSuccess", ":", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewAllowTrustResult creates a new AllowTrustResult.
[ "NewAllowTrustResult", "creates", "a", "new", "AllowTrustResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3436-L3445
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e AccountMergeResultCode) ValidEnum(v int32) bool { _, ok := accountMergeResultCodeMap[v] return ok }
go
func (e AccountMergeResultCode) ValidEnum(v int32) bool { _, ok := accountMergeResultCodeMap[v] return ok }
[ "func", "(", "e", "AccountMergeResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "accountMergeResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for AccountMergeResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "AccountMergeResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3480-L3483
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u AccountMergeResult) ArmForSwitch(sw int32) (string, bool) { switch AccountMergeResultCode(sw) { case AccountMergeResultCodeAccountMergeSuccess: return "SourceAccountBalance", true default: return "", true } }
go
func (u AccountMergeResult) ArmForSwitch(sw int32) (string, bool) { switch AccountMergeResultCode(sw) { case AccountMergeResultCodeAccountMergeSuccess: return "SourceAccountBalance", true default: return "", true } }
[ "func", "(", "u", "AccountMergeResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "AccountMergeResultCode", "(", "sw", ")", "{", "case", "AccountMergeResultCodeAccountMergeSuccess", ":", "return", "\"SourceAccountBalance\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of AccountMergeResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "AccountMergeResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3514-L3521
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewAccountMergeResult
func NewAccountMergeResult(code AccountMergeResultCode, value interface{}) (result AccountMergeResult, err error) { result.Code = code switch AccountMergeResultCode(code) { case AccountMergeResultCodeAccountMergeSuccess: tv, ok := value.(Int64) if !ok { err = fmt.Errorf("invalid value, must be Int64") return } result.SourceAccountBalance = &tv default: // void } return }
go
func NewAccountMergeResult(code AccountMergeResultCode, value interface{}) (result AccountMergeResult, err error) { result.Code = code switch AccountMergeResultCode(code) { case AccountMergeResultCodeAccountMergeSuccess: tv, ok := value.(Int64) if !ok { err = fmt.Errorf("invalid value, must be Int64") return } result.SourceAccountBalance = &tv default: // void } return }
[ "func", "NewAccountMergeResult", "(", "code", "AccountMergeResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "AccountMergeResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "AccountMergeResultCode", "(", "code", ")", "{", "case", "AccountMergeResultCodeAccountMergeSuccess", ":", "tv", ",", "ok", ":=", "value", ".", "(", "Int64", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be Int64\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "SourceAccountBalance", "=", "&", "tv", "\n", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewAccountMergeResult creates a new AccountMergeResult.
[ "NewAccountMergeResult", "creates", "a", "new", "AccountMergeResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3524-L3538
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustSourceAccountBalance
func (u AccountMergeResult) MustSourceAccountBalance() Int64 { val, ok := u.GetSourceAccountBalance() if !ok { panic("arm SourceAccountBalance is not set") } return val }
go
func (u AccountMergeResult) MustSourceAccountBalance() Int64 { val, ok := u.GetSourceAccountBalance() if !ok { panic("arm SourceAccountBalance is not set") } return val }
[ "func", "(", "u", "AccountMergeResult", ")", "MustSourceAccountBalance", "(", ")", "Int64", "{", "val", ",", "ok", ":=", "u", ".", "GetSourceAccountBalance", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm SourceAccountBalance is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustSourceAccountBalance retrieves the SourceAccountBalance value from the union, // panicing if the value is not set.
[ "MustSourceAccountBalance", "retrieves", "the", "SourceAccountBalance", "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#L3542-L3550
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetSourceAccountBalance
func (u AccountMergeResult) GetSourceAccountBalance() (result Int64, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "SourceAccountBalance" { result = *u.SourceAccountBalance ok = true } return }
go
func (u AccountMergeResult) GetSourceAccountBalance() (result Int64, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "SourceAccountBalance" { result = *u.SourceAccountBalance ok = true } return }
[ "func", "(", "u", "AccountMergeResult", ")", "GetSourceAccountBalance", "(", ")", "(", "result", "Int64", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Code", ")", ")", "\n", "if", "armName", "==", "\"SourceAccountBalance\"", "{", "result", "=", "*", "u", ".", "SourceAccountBalance", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetSourceAccountBalance retrieves the SourceAccountBalance value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetSourceAccountBalance", "retrieves", "the", "SourceAccountBalance", "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#L3554-L3563
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e InflationResultCode) ValidEnum(v int32) bool { _, ok := inflationResultCodeMap[v] return ok }
go
func (e InflationResultCode) ValidEnum(v int32) bool { _, ok := inflationResultCodeMap[v] return ok }
[ "func", "(", "e", "InflationResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "inflationResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for InflationResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "InflationResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3589-L3592
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u InflationResult) ArmForSwitch(sw int32) (string, bool) { switch InflationResultCode(sw) { case InflationResultCodeInflationSuccess: return "Payouts", true default: return "", true } }
go
func (u InflationResult) ArmForSwitch(sw int32) (string, bool) { switch InflationResultCode(sw) { case InflationResultCodeInflationSuccess: return "Payouts", true default: return "", true } }
[ "func", "(", "u", "InflationResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "InflationResultCode", "(", "sw", ")", "{", "case", "InflationResultCodeInflationSuccess", ":", "return", "\"Payouts\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of InflationResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "InflationResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3636-L3643
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewInflationResult
func NewInflationResult(code InflationResultCode, value interface{}) (result InflationResult, err error) { result.Code = code switch InflationResultCode(code) { case InflationResultCodeInflationSuccess: tv, ok := value.([]InflationPayout) if !ok { err = fmt.Errorf("invalid value, must be []InflationPayout") return } result.Payouts = &tv default: // void } return }
go
func NewInflationResult(code InflationResultCode, value interface{}) (result InflationResult, err error) { result.Code = code switch InflationResultCode(code) { case InflationResultCodeInflationSuccess: tv, ok := value.([]InflationPayout) if !ok { err = fmt.Errorf("invalid value, must be []InflationPayout") return } result.Payouts = &tv default: // void } return }
[ "func", "NewInflationResult", "(", "code", "InflationResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "InflationResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "InflationResultCode", "(", "code", ")", "{", "case", "InflationResultCodeInflationSuccess", ":", "tv", ",", "ok", ":=", "value", ".", "(", "[", "]", "InflationPayout", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be []InflationPayout\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Payouts", "=", "&", "tv", "\n", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewInflationResult creates a new InflationResult.
[ "NewInflationResult", "creates", "a", "new", "InflationResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3646-L3660
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustPayouts
func (u InflationResult) MustPayouts() []InflationPayout { val, ok := u.GetPayouts() if !ok { panic("arm Payouts is not set") } return val }
go
func (u InflationResult) MustPayouts() []InflationPayout { val, ok := u.GetPayouts() if !ok { panic("arm Payouts is not set") } return val }
[ "func", "(", "u", "InflationResult", ")", "MustPayouts", "(", ")", "[", "]", "InflationPayout", "{", "val", ",", "ok", ":=", "u", ".", "GetPayouts", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Payouts is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustPayouts retrieves the Payouts value from the union, // panicing if the value is not set.
[ "MustPayouts", "retrieves", "the", "Payouts", "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#L3664-L3672
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetPayouts
func (u InflationResult) GetPayouts() (result []InflationPayout, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "Payouts" { result = *u.Payouts ok = true } return }
go
func (u InflationResult) GetPayouts() (result []InflationPayout, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "Payouts" { result = *u.Payouts ok = true } return }
[ "func", "(", "u", "InflationResult", ")", "GetPayouts", "(", ")", "(", "result", "[", "]", "InflationPayout", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Code", ")", ")", "\n", "if", "armName", "==", "\"Payouts\"", "{", "result", "=", "*", "u", ".", "Payouts", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetPayouts retrieves the Payouts value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetPayouts", "retrieves", "the", "Payouts", "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#L3676-L3685
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e ManageDataResultCode) ValidEnum(v int32) bool { _, ok := manageDataResultCodeMap[v] return ok }
go
func (e ManageDataResultCode) ValidEnum(v int32) bool { _, ok := manageDataResultCodeMap[v] return ok }
[ "func", "(", "e", "ManageDataResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "manageDataResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for ManageDataResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "ManageDataResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3720-L3723
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u ManageDataResult) ArmForSwitch(sw int32) (string, bool) { switch ManageDataResultCode(sw) { case ManageDataResultCodeManageDataSuccess: return "", true default: return "", true } }
go
func (u ManageDataResult) ArmForSwitch(sw int32) (string, bool) { switch ManageDataResultCode(sw) { case ManageDataResultCodeManageDataSuccess: return "", true default: return "", true } }
[ "func", "(", "u", "ManageDataResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "ManageDataResultCode", "(", "sw", ")", "{", "case", "ManageDataResultCodeManageDataSuccess", ":", "return", "\"\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of ManageDataResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "ManageDataResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3753-L3760
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewManageDataResult
func NewManageDataResult(code ManageDataResultCode, value interface{}) (result ManageDataResult, err error) { result.Code = code switch ManageDataResultCode(code) { case ManageDataResultCodeManageDataSuccess: // void default: // void } return }
go
func NewManageDataResult(code ManageDataResultCode, value interface{}) (result ManageDataResult, err error) { result.Code = code switch ManageDataResultCode(code) { case ManageDataResultCodeManageDataSuccess: // void default: // void } return }
[ "func", "NewManageDataResult", "(", "code", "ManageDataResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "ManageDataResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "ManageDataResultCode", "(", "code", ")", "{", "case", "ManageDataResultCodeManageDataSuccess", ":", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewManageDataResult creates a new ManageDataResult.
[ "NewManageDataResult", "creates", "a", "new", "ManageDataResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3763-L3772
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e OperationResultCode) ValidEnum(v int32) bool { _, ok := operationResultCodeMap[v] return ok }
go
func (e OperationResultCode) ValidEnum(v int32) bool { _, ok := operationResultCodeMap[v] return ok }
[ "func", "(", "e", "OperationResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "operationResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for OperationResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "OperationResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3800-L3803
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u OperationResultTr) ArmForSwitch(sw int32) (string, bool) { switch OperationType(sw) { case OperationTypeCreateAccount: return "CreateAccountResult", true case OperationTypePayment: return "PaymentResult", true case OperationTypePathPayment: return "PathPaymentResult", true case OperationTypeManageOffer: return "ManageOfferResult", true case OperationTypeCreatePassiveOffer: return "CreatePassiveOfferResult", true case OperationTypeSetOptions: return "SetOptionsResult", true case OperationTypeChangeTrust: return "ChangeTrustResult", true case OperationTypeAllowTrust: return "AllowTrustResult", true case OperationTypeAccountMerge: return "AccountMergeResult", true case OperationTypeInflation: return "InflationResult", true case OperationTypeManageData: return "ManageDataResult", true } return "-", false }
go
func (u OperationResultTr) ArmForSwitch(sw int32) (string, bool) { switch OperationType(sw) { case OperationTypeCreateAccount: return "CreateAccountResult", true case OperationTypePayment: return "PaymentResult", true case OperationTypePathPayment: return "PathPaymentResult", true case OperationTypeManageOffer: return "ManageOfferResult", true case OperationTypeCreatePassiveOffer: return "CreatePassiveOfferResult", true case OperationTypeSetOptions: return "SetOptionsResult", true case OperationTypeChangeTrust: return "ChangeTrustResult", true case OperationTypeAllowTrust: return "AllowTrustResult", true case OperationTypeAccountMerge: return "AccountMergeResult", true case OperationTypeInflation: return "InflationResult", true case OperationTypeManageData: return "ManageDataResult", true } return "-", false }
[ "func", "(", "u", "OperationResultTr", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "OperationType", "(", "sw", ")", "{", "case", "OperationTypeCreateAccount", ":", "return", "\"CreateAccountResult\"", ",", "true", "\n", "case", "OperationTypePayment", ":", "return", "\"PaymentResult\"", ",", "true", "\n", "case", "OperationTypePathPayment", ":", "return", "\"PathPaymentResult\"", ",", "true", "\n", "case", "OperationTypeManageOffer", ":", "return", "\"ManageOfferResult\"", ",", "true", "\n", "case", "OperationTypeCreatePassiveOffer", ":", "return", "\"CreatePassiveOfferResult\"", ",", "true", "\n", "case", "OperationTypeSetOptions", ":", "return", "\"SetOptionsResult\"", ",", "true", "\n", "case", "OperationTypeChangeTrust", ":", "return", "\"ChangeTrustResult\"", ",", "true", "\n", "case", "OperationTypeAllowTrust", ":", "return", "\"AllowTrustResult\"", ",", "true", "\n", "case", "OperationTypeAccountMerge", ":", "return", "\"AccountMergeResult\"", ",", "true", "\n", "case", "OperationTypeInflation", ":", "return", "\"InflationResult\"", ",", "true", "\n", "case", "OperationTypeManageData", ":", "return", "\"ManageDataResult\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of OperationResultTr
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "OperationResultTr" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3862-L3888
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewOperationResultTr
func NewOperationResultTr(aType OperationType, value interface{}) (result OperationResultTr, err error) { result.Type = aType switch OperationType(aType) { case OperationTypeCreateAccount: tv, ok := value.(CreateAccountResult) if !ok { err = fmt.Errorf("invalid value, must be CreateAccountResult") return } result.CreateAccountResult = &tv case OperationTypePayment: tv, ok := value.(PaymentResult) if !ok { err = fmt.Errorf("invalid value, must be PaymentResult") return } result.PaymentResult = &tv case OperationTypePathPayment: tv, ok := value.(PathPaymentResult) if !ok { err = fmt.Errorf("invalid value, must be PathPaymentResult") return } result.PathPaymentResult = &tv case OperationTypeManageOffer: tv, ok := value.(ManageOfferResult) if !ok { err = fmt.Errorf("invalid value, must be ManageOfferResult") return } result.ManageOfferResult = &tv case OperationTypeCreatePassiveOffer: tv, ok := value.(ManageOfferResult) if !ok { err = fmt.Errorf("invalid value, must be ManageOfferResult") return } result.CreatePassiveOfferResult = &tv case OperationTypeSetOptions: tv, ok := value.(SetOptionsResult) if !ok { err = fmt.Errorf("invalid value, must be SetOptionsResult") return } result.SetOptionsResult = &tv case OperationTypeChangeTrust: tv, ok := value.(ChangeTrustResult) if !ok { err = fmt.Errorf("invalid value, must be ChangeTrustResult") return } result.ChangeTrustResult = &tv case OperationTypeAllowTrust: tv, ok := value.(AllowTrustResult) if !ok { err = fmt.Errorf("invalid value, must be AllowTrustResult") return } result.AllowTrustResult = &tv case OperationTypeAccountMerge: tv, ok := value.(AccountMergeResult) if !ok { err = fmt.Errorf("invalid value, must be AccountMergeResult") return } result.AccountMergeResult = &tv case OperationTypeInflation: tv, ok := value.(InflationResult) if !ok { err = fmt.Errorf("invalid value, must be InflationResult") return } result.InflationResult = &tv case OperationTypeManageData: tv, ok := value.(ManageDataResult) if !ok { err = fmt.Errorf("invalid value, must be ManageDataResult") return } result.ManageDataResult = &tv } return }
go
func NewOperationResultTr(aType OperationType, value interface{}) (result OperationResultTr, err error) { result.Type = aType switch OperationType(aType) { case OperationTypeCreateAccount: tv, ok := value.(CreateAccountResult) if !ok { err = fmt.Errorf("invalid value, must be CreateAccountResult") return } result.CreateAccountResult = &tv case OperationTypePayment: tv, ok := value.(PaymentResult) if !ok { err = fmt.Errorf("invalid value, must be PaymentResult") return } result.PaymentResult = &tv case OperationTypePathPayment: tv, ok := value.(PathPaymentResult) if !ok { err = fmt.Errorf("invalid value, must be PathPaymentResult") return } result.PathPaymentResult = &tv case OperationTypeManageOffer: tv, ok := value.(ManageOfferResult) if !ok { err = fmt.Errorf("invalid value, must be ManageOfferResult") return } result.ManageOfferResult = &tv case OperationTypeCreatePassiveOffer: tv, ok := value.(ManageOfferResult) if !ok { err = fmt.Errorf("invalid value, must be ManageOfferResult") return } result.CreatePassiveOfferResult = &tv case OperationTypeSetOptions: tv, ok := value.(SetOptionsResult) if !ok { err = fmt.Errorf("invalid value, must be SetOptionsResult") return } result.SetOptionsResult = &tv case OperationTypeChangeTrust: tv, ok := value.(ChangeTrustResult) if !ok { err = fmt.Errorf("invalid value, must be ChangeTrustResult") return } result.ChangeTrustResult = &tv case OperationTypeAllowTrust: tv, ok := value.(AllowTrustResult) if !ok { err = fmt.Errorf("invalid value, must be AllowTrustResult") return } result.AllowTrustResult = &tv case OperationTypeAccountMerge: tv, ok := value.(AccountMergeResult) if !ok { err = fmt.Errorf("invalid value, must be AccountMergeResult") return } result.AccountMergeResult = &tv case OperationTypeInflation: tv, ok := value.(InflationResult) if !ok { err = fmt.Errorf("invalid value, must be InflationResult") return } result.InflationResult = &tv case OperationTypeManageData: tv, ok := value.(ManageDataResult) if !ok { err = fmt.Errorf("invalid value, must be ManageDataResult") return } result.ManageDataResult = &tv } return }
[ "func", "NewOperationResultTr", "(", "aType", "OperationType", ",", "value", "interface", "{", "}", ")", "(", "result", "OperationResultTr", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "OperationType", "(", "aType", ")", "{", "case", "OperationTypeCreateAccount", ":", "tv", ",", "ok", ":=", "value", ".", "(", "CreateAccountResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be CreateAccountResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "CreateAccountResult", "=", "&", "tv", "\n", "case", "OperationTypePayment", ":", "tv", ",", "ok", ":=", "value", ".", "(", "PaymentResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be PaymentResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "PaymentResult", "=", "&", "tv", "\n", "case", "OperationTypePathPayment", ":", "tv", ",", "ok", ":=", "value", ".", "(", "PathPaymentResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be PathPaymentResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "PathPaymentResult", "=", "&", "tv", "\n", "case", "OperationTypeManageOffer", ":", "tv", ",", "ok", ":=", "value", ".", "(", "ManageOfferResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be ManageOfferResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "ManageOfferResult", "=", "&", "tv", "\n", "case", "OperationTypeCreatePassiveOffer", ":", "tv", ",", "ok", ":=", "value", ".", "(", "ManageOfferResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be ManageOfferResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "CreatePassiveOfferResult", "=", "&", "tv", "\n", "case", "OperationTypeSetOptions", ":", "tv", ",", "ok", ":=", "value", ".", "(", "SetOptionsResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be SetOptionsResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "SetOptionsResult", "=", "&", "tv", "\n", "case", "OperationTypeChangeTrust", ":", "tv", ",", "ok", ":=", "value", ".", "(", "ChangeTrustResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be ChangeTrustResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "ChangeTrustResult", "=", "&", "tv", "\n", "case", "OperationTypeAllowTrust", ":", "tv", ",", "ok", ":=", "value", ".", "(", "AllowTrustResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be AllowTrustResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "AllowTrustResult", "=", "&", "tv", "\n", "case", "OperationTypeAccountMerge", ":", "tv", ",", "ok", ":=", "value", ".", "(", "AccountMergeResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be AccountMergeResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "AccountMergeResult", "=", "&", "tv", "\n", "case", "OperationTypeInflation", ":", "tv", ",", "ok", ":=", "value", ".", "(", "InflationResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be InflationResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "InflationResult", "=", "&", "tv", "\n", "case", "OperationTypeManageData", ":", "tv", ",", "ok", ":=", "value", ".", "(", "ManageDataResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be ManageDataResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "ManageDataResult", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewOperationResultTr creates a new OperationResultTr.
[ "NewOperationResultTr", "creates", "a", "new", "OperationResultTr", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L3891-L3973
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustCreateAccountResult
func (u OperationResultTr) MustCreateAccountResult() CreateAccountResult { val, ok := u.GetCreateAccountResult() if !ok { panic("arm CreateAccountResult is not set") } return val }
go
func (u OperationResultTr) MustCreateAccountResult() CreateAccountResult { val, ok := u.GetCreateAccountResult() if !ok { panic("arm CreateAccountResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustCreateAccountResult", "(", ")", "CreateAccountResult", "{", "val", ",", "ok", ":=", "u", ".", "GetCreateAccountResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm CreateAccountResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustCreateAccountResult retrieves the CreateAccountResult value from the union, // panicing if the value is not set.
[ "MustCreateAccountResult", "retrieves", "the", "CreateAccountResult", "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#L3977-L3985
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetCreateAccountResult
func (u OperationResultTr) GetCreateAccountResult() (result CreateAccountResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "CreateAccountResult" { result = *u.CreateAccountResult ok = true } return }
go
func (u OperationResultTr) GetCreateAccountResult() (result CreateAccountResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "CreateAccountResult" { result = *u.CreateAccountResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetCreateAccountResult", "(", ")", "(", "result", "CreateAccountResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"CreateAccountResult\"", "{", "result", "=", "*", "u", ".", "CreateAccountResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetCreateAccountResult retrieves the CreateAccountResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetCreateAccountResult", "retrieves", "the", "CreateAccountResult", "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#L3989-L3998
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustPaymentResult
func (u OperationResultTr) MustPaymentResult() PaymentResult { val, ok := u.GetPaymentResult() if !ok { panic("arm PaymentResult is not set") } return val }
go
func (u OperationResultTr) MustPaymentResult() PaymentResult { val, ok := u.GetPaymentResult() if !ok { panic("arm PaymentResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustPaymentResult", "(", ")", "PaymentResult", "{", "val", ",", "ok", ":=", "u", ".", "GetPaymentResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm PaymentResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustPaymentResult retrieves the PaymentResult value from the union, // panicing if the value is not set.
[ "MustPaymentResult", "retrieves", "the", "PaymentResult", "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#L4002-L4010
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetPaymentResult
func (u OperationResultTr) GetPaymentResult() (result PaymentResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PaymentResult" { result = *u.PaymentResult ok = true } return }
go
func (u OperationResultTr) GetPaymentResult() (result PaymentResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PaymentResult" { result = *u.PaymentResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetPaymentResult", "(", ")", "(", "result", "PaymentResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"PaymentResult\"", "{", "result", "=", "*", "u", ".", "PaymentResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetPaymentResult retrieves the PaymentResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetPaymentResult", "retrieves", "the", "PaymentResult", "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#L4014-L4023
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustPathPaymentResult
func (u OperationResultTr) MustPathPaymentResult() PathPaymentResult { val, ok := u.GetPathPaymentResult() if !ok { panic("arm PathPaymentResult is not set") } return val }
go
func (u OperationResultTr) MustPathPaymentResult() PathPaymentResult { val, ok := u.GetPathPaymentResult() if !ok { panic("arm PathPaymentResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustPathPaymentResult", "(", ")", "PathPaymentResult", "{", "val", ",", "ok", ":=", "u", ".", "GetPathPaymentResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm PathPaymentResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustPathPaymentResult retrieves the PathPaymentResult value from the union, // panicing if the value is not set.
[ "MustPathPaymentResult", "retrieves", "the", "PathPaymentResult", "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#L4027-L4035
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetPathPaymentResult
func (u OperationResultTr) GetPathPaymentResult() (result PathPaymentResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PathPaymentResult" { result = *u.PathPaymentResult ok = true } return }
go
func (u OperationResultTr) GetPathPaymentResult() (result PathPaymentResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "PathPaymentResult" { result = *u.PathPaymentResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetPathPaymentResult", "(", ")", "(", "result", "PathPaymentResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"PathPaymentResult\"", "{", "result", "=", "*", "u", ".", "PathPaymentResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetPathPaymentResult retrieves the PathPaymentResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetPathPaymentResult", "retrieves", "the", "PathPaymentResult", "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#L4039-L4048
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustManageOfferResult
func (u OperationResultTr) MustManageOfferResult() ManageOfferResult { val, ok := u.GetManageOfferResult() if !ok { panic("arm ManageOfferResult is not set") } return val }
go
func (u OperationResultTr) MustManageOfferResult() ManageOfferResult { val, ok := u.GetManageOfferResult() if !ok { panic("arm ManageOfferResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustManageOfferResult", "(", ")", "ManageOfferResult", "{", "val", ",", "ok", ":=", "u", ".", "GetManageOfferResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm ManageOfferResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustManageOfferResult retrieves the ManageOfferResult value from the union, // panicing if the value is not set.
[ "MustManageOfferResult", "retrieves", "the", "ManageOfferResult", "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#L4052-L4060
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetManageOfferResult
func (u OperationResultTr) GetManageOfferResult() (result ManageOfferResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageOfferResult" { result = *u.ManageOfferResult ok = true } return }
go
func (u OperationResultTr) GetManageOfferResult() (result ManageOfferResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageOfferResult" { result = *u.ManageOfferResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetManageOfferResult", "(", ")", "(", "result", "ManageOfferResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"ManageOfferResult\"", "{", "result", "=", "*", "u", ".", "ManageOfferResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetManageOfferResult retrieves the ManageOfferResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetManageOfferResult", "retrieves", "the", "ManageOfferResult", "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#L4064-L4073
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustCreatePassiveOfferResult
func (u OperationResultTr) MustCreatePassiveOfferResult() ManageOfferResult { val, ok := u.GetCreatePassiveOfferResult() if !ok { panic("arm CreatePassiveOfferResult is not set") } return val }
go
func (u OperationResultTr) MustCreatePassiveOfferResult() ManageOfferResult { val, ok := u.GetCreatePassiveOfferResult() if !ok { panic("arm CreatePassiveOfferResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustCreatePassiveOfferResult", "(", ")", "ManageOfferResult", "{", "val", ",", "ok", ":=", "u", ".", "GetCreatePassiveOfferResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm CreatePassiveOfferResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustCreatePassiveOfferResult retrieves the CreatePassiveOfferResult value from the union, // panicing if the value is not set.
[ "MustCreatePassiveOfferResult", "retrieves", "the", "CreatePassiveOfferResult", "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#L4077-L4085
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustSetOptionsResult
func (u OperationResultTr) MustSetOptionsResult() SetOptionsResult { val, ok := u.GetSetOptionsResult() if !ok { panic("arm SetOptionsResult is not set") } return val }
go
func (u OperationResultTr) MustSetOptionsResult() SetOptionsResult { val, ok := u.GetSetOptionsResult() if !ok { panic("arm SetOptionsResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustSetOptionsResult", "(", ")", "SetOptionsResult", "{", "val", ",", "ok", ":=", "u", ".", "GetSetOptionsResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm SetOptionsResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustSetOptionsResult retrieves the SetOptionsResult value from the union, // panicing if the value is not set.
[ "MustSetOptionsResult", "retrieves", "the", "SetOptionsResult", "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#L4102-L4110
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetSetOptionsResult
func (u OperationResultTr) GetSetOptionsResult() (result SetOptionsResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "SetOptionsResult" { result = *u.SetOptionsResult ok = true } return }
go
func (u OperationResultTr) GetSetOptionsResult() (result SetOptionsResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "SetOptionsResult" { result = *u.SetOptionsResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetSetOptionsResult", "(", ")", "(", "result", "SetOptionsResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"SetOptionsResult\"", "{", "result", "=", "*", "u", ".", "SetOptionsResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetSetOptionsResult retrieves the SetOptionsResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetSetOptionsResult", "retrieves", "the", "SetOptionsResult", "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#L4114-L4123
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustChangeTrustResult
func (u OperationResultTr) MustChangeTrustResult() ChangeTrustResult { val, ok := u.GetChangeTrustResult() if !ok { panic("arm ChangeTrustResult is not set") } return val }
go
func (u OperationResultTr) MustChangeTrustResult() ChangeTrustResult { val, ok := u.GetChangeTrustResult() if !ok { panic("arm ChangeTrustResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustChangeTrustResult", "(", ")", "ChangeTrustResult", "{", "val", ",", "ok", ":=", "u", ".", "GetChangeTrustResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm ChangeTrustResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustChangeTrustResult retrieves the ChangeTrustResult value from the union, // panicing if the value is not set.
[ "MustChangeTrustResult", "retrieves", "the", "ChangeTrustResult", "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#L4127-L4135
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetChangeTrustResult
func (u OperationResultTr) GetChangeTrustResult() (result ChangeTrustResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ChangeTrustResult" { result = *u.ChangeTrustResult ok = true } return }
go
func (u OperationResultTr) GetChangeTrustResult() (result ChangeTrustResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ChangeTrustResult" { result = *u.ChangeTrustResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetChangeTrustResult", "(", ")", "(", "result", "ChangeTrustResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"ChangeTrustResult\"", "{", "result", "=", "*", "u", ".", "ChangeTrustResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetChangeTrustResult retrieves the ChangeTrustResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetChangeTrustResult", "retrieves", "the", "ChangeTrustResult", "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#L4139-L4148
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAllowTrustResult
func (u OperationResultTr) MustAllowTrustResult() AllowTrustResult { val, ok := u.GetAllowTrustResult() if !ok { panic("arm AllowTrustResult is not set") } return val }
go
func (u OperationResultTr) MustAllowTrustResult() AllowTrustResult { val, ok := u.GetAllowTrustResult() if !ok { panic("arm AllowTrustResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustAllowTrustResult", "(", ")", "AllowTrustResult", "{", "val", ",", "ok", ":=", "u", ".", "GetAllowTrustResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AllowTrustResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustAllowTrustResult retrieves the AllowTrustResult value from the union, // panicing if the value is not set.
[ "MustAllowTrustResult", "retrieves", "the", "AllowTrustResult", "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#L4152-L4160
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAllowTrustResult
func (u OperationResultTr) GetAllowTrustResult() (result AllowTrustResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AllowTrustResult" { result = *u.AllowTrustResult ok = true } return }
go
func (u OperationResultTr) GetAllowTrustResult() (result AllowTrustResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AllowTrustResult" { result = *u.AllowTrustResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetAllowTrustResult", "(", ")", "(", "result", "AllowTrustResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"AllowTrustResult\"", "{", "result", "=", "*", "u", ".", "AllowTrustResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetAllowTrustResult retrieves the AllowTrustResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAllowTrustResult", "retrieves", "the", "AllowTrustResult", "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#L4164-L4173
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustAccountMergeResult
func (u OperationResultTr) MustAccountMergeResult() AccountMergeResult { val, ok := u.GetAccountMergeResult() if !ok { panic("arm AccountMergeResult is not set") } return val }
go
func (u OperationResultTr) MustAccountMergeResult() AccountMergeResult { val, ok := u.GetAccountMergeResult() if !ok { panic("arm AccountMergeResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustAccountMergeResult", "(", ")", "AccountMergeResult", "{", "val", ",", "ok", ":=", "u", ".", "GetAccountMergeResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm AccountMergeResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustAccountMergeResult retrieves the AccountMergeResult value from the union, // panicing if the value is not set.
[ "MustAccountMergeResult", "retrieves", "the", "AccountMergeResult", "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#L4177-L4185
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetAccountMergeResult
func (u OperationResultTr) GetAccountMergeResult() (result AccountMergeResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AccountMergeResult" { result = *u.AccountMergeResult ok = true } return }
go
func (u OperationResultTr) GetAccountMergeResult() (result AccountMergeResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "AccountMergeResult" { result = *u.AccountMergeResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetAccountMergeResult", "(", ")", "(", "result", "AccountMergeResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"AccountMergeResult\"", "{", "result", "=", "*", "u", ".", "AccountMergeResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetAccountMergeResult retrieves the AccountMergeResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetAccountMergeResult", "retrieves", "the", "AccountMergeResult", "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#L4189-L4198
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustInflationResult
func (u OperationResultTr) MustInflationResult() InflationResult { val, ok := u.GetInflationResult() if !ok { panic("arm InflationResult is not set") } return val }
go
func (u OperationResultTr) MustInflationResult() InflationResult { val, ok := u.GetInflationResult() if !ok { panic("arm InflationResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustInflationResult", "(", ")", "InflationResult", "{", "val", ",", "ok", ":=", "u", ".", "GetInflationResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm InflationResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustInflationResult retrieves the InflationResult value from the union, // panicing if the value is not set.
[ "MustInflationResult", "retrieves", "the", "InflationResult", "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#L4202-L4210
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetInflationResult
func (u OperationResultTr) GetInflationResult() (result InflationResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "InflationResult" { result = *u.InflationResult ok = true } return }
go
func (u OperationResultTr) GetInflationResult() (result InflationResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "InflationResult" { result = *u.InflationResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetInflationResult", "(", ")", "(", "result", "InflationResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"InflationResult\"", "{", "result", "=", "*", "u", ".", "InflationResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetInflationResult retrieves the InflationResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetInflationResult", "retrieves", "the", "InflationResult", "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#L4214-L4223
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustManageDataResult
func (u OperationResultTr) MustManageDataResult() ManageDataResult { val, ok := u.GetManageDataResult() if !ok { panic("arm ManageDataResult is not set") } return val }
go
func (u OperationResultTr) MustManageDataResult() ManageDataResult { val, ok := u.GetManageDataResult() if !ok { panic("arm ManageDataResult is not set") } return val }
[ "func", "(", "u", "OperationResultTr", ")", "MustManageDataResult", "(", ")", "ManageDataResult", "{", "val", ",", "ok", ":=", "u", ".", "GetManageDataResult", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm ManageDataResult is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustManageDataResult retrieves the ManageDataResult value from the union, // panicing if the value is not set.
[ "MustManageDataResult", "retrieves", "the", "ManageDataResult", "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#L4227-L4235
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetManageDataResult
func (u OperationResultTr) GetManageDataResult() (result ManageDataResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageDataResult" { result = *u.ManageDataResult ok = true } return }
go
func (u OperationResultTr) GetManageDataResult() (result ManageDataResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "ManageDataResult" { result = *u.ManageDataResult ok = true } return }
[ "func", "(", "u", "OperationResultTr", ")", "GetManageDataResult", "(", ")", "(", "result", "ManageDataResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"ManageDataResult\"", "{", "result", "=", "*", "u", ".", "ManageDataResult", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetManageDataResult retrieves the ManageDataResult value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetManageDataResult", "retrieves", "the", "ManageDataResult", "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#L4239-L4248
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u OperationResult) ArmForSwitch(sw int32) (string, bool) { switch OperationResultCode(sw) { case OperationResultCodeOpInner: return "Tr", true default: return "", true } }
go
func (u OperationResult) ArmForSwitch(sw int32) (string, bool) { switch OperationResultCode(sw) { case OperationResultCodeOpInner: return "Tr", true default: return "", true } }
[ "func", "(", "u", "OperationResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "OperationResultCode", "(", "sw", ")", "{", "case", "OperationResultCodeOpInner", ":", "return", "\"Tr\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of OperationResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "OperationResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4298-L4305
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewOperationResult
func NewOperationResult(code OperationResultCode, value interface{}) (result OperationResult, err error) { result.Code = code switch OperationResultCode(code) { case OperationResultCodeOpInner: tv, ok := value.(OperationResultTr) if !ok { err = fmt.Errorf("invalid value, must be OperationResultTr") return } result.Tr = &tv default: // void } return }
go
func NewOperationResult(code OperationResultCode, value interface{}) (result OperationResult, err error) { result.Code = code switch OperationResultCode(code) { case OperationResultCodeOpInner: tv, ok := value.(OperationResultTr) if !ok { err = fmt.Errorf("invalid value, must be OperationResultTr") return } result.Tr = &tv default: // void } return }
[ "func", "NewOperationResult", "(", "code", "OperationResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "OperationResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "OperationResultCode", "(", "code", ")", "{", "case", "OperationResultCodeOpInner", ":", "tv", ",", "ok", ":=", "value", ".", "(", "OperationResultTr", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be OperationResultTr\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Tr", "=", "&", "tv", "\n", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewOperationResult creates a new OperationResult.
[ "NewOperationResult", "creates", "a", "new", "OperationResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4308-L4322
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustTr
func (u OperationResult) MustTr() OperationResultTr { val, ok := u.GetTr() if !ok { panic("arm Tr is not set") } return val }
go
func (u OperationResult) MustTr() OperationResultTr { val, ok := u.GetTr() if !ok { panic("arm Tr is not set") } return val }
[ "func", "(", "u", "OperationResult", ")", "MustTr", "(", ")", "OperationResultTr", "{", "val", ",", "ok", ":=", "u", ".", "GetTr", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Tr is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustTr retrieves the Tr value from the union, // panicing if the value is not set.
[ "MustTr", "retrieves", "the", "Tr", "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#L4326-L4334
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetTr
func (u OperationResult) GetTr() (result OperationResultTr, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "Tr" { result = *u.Tr ok = true } return }
go
func (u OperationResult) GetTr() (result OperationResultTr, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "Tr" { result = *u.Tr ok = true } return }
[ "func", "(", "u", "OperationResult", ")", "GetTr", "(", ")", "(", "result", "OperationResultTr", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Code", ")", ")", "\n", "if", "armName", "==", "\"Tr\"", "{", "result", "=", "*", "u", ".", "Tr", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetTr retrieves the Tr value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetTr", "retrieves", "the", "Tr", "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#L4338-L4347
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e TransactionResultCode) ValidEnum(v int32) bool { _, ok := transactionResultCodeMap[v] return ok }
go
func (e TransactionResultCode) ValidEnum(v int32) bool { _, ok := transactionResultCodeMap[v] return ok }
[ "func", "(", "e", "TransactionResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "transactionResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for TransactionResultCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "TransactionResultCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4404-L4407
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u TransactionResultResult) ArmForSwitch(sw int32) (string, bool) { switch TransactionResultCode(sw) { case TransactionResultCodeTxSuccess: return "Results", true case TransactionResultCodeTxFailed: return "Results", true default: return "", true } }
go
func (u TransactionResultResult) ArmForSwitch(sw int32) (string, bool) { switch TransactionResultCode(sw) { case TransactionResultCodeTxSuccess: return "Results", true case TransactionResultCodeTxFailed: return "Results", true default: return "", true } }
[ "func", "(", "u", "TransactionResultResult", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "TransactionResultCode", "(", "sw", ")", "{", "case", "TransactionResultCodeTxSuccess", ":", "return", "\"Results\"", ",", "true", "\n", "case", "TransactionResultCodeTxFailed", ":", "return", "\"Results\"", ",", "true", "\n", "default", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of TransactionResultResult
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "TransactionResultResult" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4439-L4448
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTransactionResultResult
func NewTransactionResultResult(code TransactionResultCode, value interface{}) (result TransactionResultResult, err error) { result.Code = code switch TransactionResultCode(code) { case TransactionResultCodeTxSuccess: tv, ok := value.([]OperationResult) if !ok { err = fmt.Errorf("invalid value, must be []OperationResult") return } result.Results = &tv case TransactionResultCodeTxFailed: tv, ok := value.([]OperationResult) if !ok { err = fmt.Errorf("invalid value, must be []OperationResult") return } result.Results = &tv default: // void } return }
go
func NewTransactionResultResult(code TransactionResultCode, value interface{}) (result TransactionResultResult, err error) { result.Code = code switch TransactionResultCode(code) { case TransactionResultCodeTxSuccess: tv, ok := value.([]OperationResult) if !ok { err = fmt.Errorf("invalid value, must be []OperationResult") return } result.Results = &tv case TransactionResultCodeTxFailed: tv, ok := value.([]OperationResult) if !ok { err = fmt.Errorf("invalid value, must be []OperationResult") return } result.Results = &tv default: // void } return }
[ "func", "NewTransactionResultResult", "(", "code", "TransactionResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "TransactionResultResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "TransactionResultCode", "(", "code", ")", "{", "case", "TransactionResultCodeTxSuccess", ":", "tv", ",", "ok", ":=", "value", ".", "(", "[", "]", "OperationResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be []OperationResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Results", "=", "&", "tv", "\n", "case", "TransactionResultCodeTxFailed", ":", "tv", ",", "ok", ":=", "value", ".", "(", "[", "]", "OperationResult", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be []OperationResult\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Results", "=", "&", "tv", "\n", "default", ":", "}", "\n", "return", "\n", "}" ]
// NewTransactionResultResult creates a new TransactionResultResult.
[ "NewTransactionResultResult", "creates", "a", "new", "TransactionResultResult", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4451-L4472
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustResults
func (u TransactionResultResult) MustResults() []OperationResult { val, ok := u.GetResults() if !ok { panic("arm Results is not set") } return val }
go
func (u TransactionResultResult) MustResults() []OperationResult { val, ok := u.GetResults() if !ok { panic("arm Results is not set") } return val }
[ "func", "(", "u", "TransactionResultResult", ")", "MustResults", "(", ")", "[", "]", "OperationResult", "{", "val", ",", "ok", ":=", "u", ".", "GetResults", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Results is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustResults retrieves the Results value from the union, // panicing if the value is not set.
[ "MustResults", "retrieves", "the", "Results", "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#L4476-L4484
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetResults
func (u TransactionResultResult) GetResults() (result []OperationResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "Results" { result = *u.Results ok = true } return }
go
func (u TransactionResultResult) GetResults() (result []OperationResult, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Code)) if armName == "Results" { result = *u.Results ok = true } return }
[ "func", "(", "u", "TransactionResultResult", ")", "GetResults", "(", ")", "(", "result", "[", "]", "OperationResult", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Code", ")", ")", "\n", "if", "armName", "==", "\"Results\"", "{", "result", "=", "*", "u", ".", "Results", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetResults retrieves the Results value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetResults", "retrieves", "the", "Results", "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#L4488-L4497
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTransactionResultExt
func NewTransactionResultExt(v int32, value interface{}) (result TransactionResultExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewTransactionResultExt(v int32, value interface{}) (result TransactionResultExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewTransactionResultExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "TransactionResultExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", "\n", "return", "\n", "}" ]
// NewTransactionResultExt creates a new TransactionResultExt.
[ "NewTransactionResultExt", "creates", "a", "new", "TransactionResultExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4528-L4535
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewStellarValueExt
func NewStellarValueExt(v int32, value interface{}) (result StellarValueExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewStellarValueExt(v int32, value interface{}) (result StellarValueExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewStellarValueExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "StellarValueExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", "\n", "return", "\n", "}" ]
// NewStellarValueExt creates a new StellarValueExt.
[ "NewStellarValueExt", "creates", "a", "new", "StellarValueExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4603-L4610
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerHeaderExt
func NewLedgerHeaderExt(v int32, value interface{}) (result LedgerHeaderExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewLedgerHeaderExt(v int32, value interface{}) (result LedgerHeaderExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewLedgerHeaderExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerHeaderExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", "\n", "return", "\n", "}" ]
// NewLedgerHeaderExt creates a new LedgerHeaderExt.
[ "NewLedgerHeaderExt", "creates", "a", "new", "LedgerHeaderExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4671-L4678
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e LedgerUpgradeType) ValidEnum(v int32) bool { _, ok := ledgerUpgradeTypeMap[v] return ok }
go
func (e LedgerUpgradeType) ValidEnum(v int32) bool { _, ok := ledgerUpgradeTypeMap[v] return ok }
[ "func", "(", "e", "LedgerUpgradeType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "ledgerUpgradeTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for LedgerUpgradeType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "LedgerUpgradeType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4763-L4766
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u LedgerUpgrade) ArmForSwitch(sw int32) (string, bool) { switch LedgerUpgradeType(sw) { case LedgerUpgradeTypeLedgerUpgradeVersion: return "NewLedgerVersion", true case LedgerUpgradeTypeLedgerUpgradeBaseFee: return "NewBaseFee", true case LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize: return "NewMaxTxSetSize", true } return "-", false }
go
func (u LedgerUpgrade) ArmForSwitch(sw int32) (string, bool) { switch LedgerUpgradeType(sw) { case LedgerUpgradeTypeLedgerUpgradeVersion: return "NewLedgerVersion", true case LedgerUpgradeTypeLedgerUpgradeBaseFee: return "NewBaseFee", true case LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize: return "NewMaxTxSetSize", true } return "-", false }
[ "func", "(", "u", "LedgerUpgrade", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "LedgerUpgradeType", "(", "sw", ")", "{", "case", "LedgerUpgradeTypeLedgerUpgradeVersion", ":", "return", "\"NewLedgerVersion\"", ",", "true", "\n", "case", "LedgerUpgradeTypeLedgerUpgradeBaseFee", ":", "return", "\"NewBaseFee\"", ",", "true", "\n", "case", "LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize", ":", "return", "\"NewMaxTxSetSize\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of LedgerUpgrade
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "LedgerUpgrade" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4801-L4811
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerUpgrade
func NewLedgerUpgrade(aType LedgerUpgradeType, value interface{}) (result LedgerUpgrade, err error) { result.Type = aType switch LedgerUpgradeType(aType) { case LedgerUpgradeTypeLedgerUpgradeVersion: tv, ok := value.(Uint32) if !ok { err = fmt.Errorf("invalid value, must be Uint32") return } result.NewLedgerVersion = &tv case LedgerUpgradeTypeLedgerUpgradeBaseFee: tv, ok := value.(Uint32) if !ok { err = fmt.Errorf("invalid value, must be Uint32") return } result.NewBaseFee = &tv case LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize: tv, ok := value.(Uint32) if !ok { err = fmt.Errorf("invalid value, must be Uint32") return } result.NewMaxTxSetSize = &tv } return }
go
func NewLedgerUpgrade(aType LedgerUpgradeType, value interface{}) (result LedgerUpgrade, err error) { result.Type = aType switch LedgerUpgradeType(aType) { case LedgerUpgradeTypeLedgerUpgradeVersion: tv, ok := value.(Uint32) if !ok { err = fmt.Errorf("invalid value, must be Uint32") return } result.NewLedgerVersion = &tv case LedgerUpgradeTypeLedgerUpgradeBaseFee: tv, ok := value.(Uint32) if !ok { err = fmt.Errorf("invalid value, must be Uint32") return } result.NewBaseFee = &tv case LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize: tv, ok := value.(Uint32) if !ok { err = fmt.Errorf("invalid value, must be Uint32") return } result.NewMaxTxSetSize = &tv } return }
[ "func", "NewLedgerUpgrade", "(", "aType", "LedgerUpgradeType", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerUpgrade", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "LedgerUpgradeType", "(", "aType", ")", "{", "case", "LedgerUpgradeTypeLedgerUpgradeVersion", ":", "tv", ",", "ok", ":=", "value", ".", "(", "Uint32", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be Uint32\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "NewLedgerVersion", "=", "&", "tv", "\n", "case", "LedgerUpgradeTypeLedgerUpgradeBaseFee", ":", "tv", ",", "ok", ":=", "value", ".", "(", "Uint32", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be Uint32\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "NewBaseFee", "=", "&", "tv", "\n", "case", "LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize", ":", "tv", ",", "ok", ":=", "value", ".", "(", "Uint32", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be Uint32\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "NewMaxTxSetSize", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewLedgerUpgrade creates a new LedgerUpgrade.
[ "NewLedgerUpgrade", "creates", "a", "new", "LedgerUpgrade", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L4814-L4840
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustNewLedgerVersion
func (u LedgerUpgrade) MustNewLedgerVersion() Uint32 { val, ok := u.GetNewLedgerVersion() if !ok { panic("arm NewLedgerVersion is not set") } return val }
go
func (u LedgerUpgrade) MustNewLedgerVersion() Uint32 { val, ok := u.GetNewLedgerVersion() if !ok { panic("arm NewLedgerVersion is not set") } return val }
[ "func", "(", "u", "LedgerUpgrade", ")", "MustNewLedgerVersion", "(", ")", "Uint32", "{", "val", ",", "ok", ":=", "u", ".", "GetNewLedgerVersion", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm NewLedgerVersion is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustNewLedgerVersion retrieves the NewLedgerVersion value from the union, // panicing if the value is not set.
[ "MustNewLedgerVersion", "retrieves", "the", "NewLedgerVersion", "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#L4844-L4852
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetNewLedgerVersion
func (u LedgerUpgrade) GetNewLedgerVersion() (result Uint32, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "NewLedgerVersion" { result = *u.NewLedgerVersion ok = true } return }
go
func (u LedgerUpgrade) GetNewLedgerVersion() (result Uint32, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "NewLedgerVersion" { result = *u.NewLedgerVersion ok = true } return }
[ "func", "(", "u", "LedgerUpgrade", ")", "GetNewLedgerVersion", "(", ")", "(", "result", "Uint32", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"NewLedgerVersion\"", "{", "result", "=", "*", "u", ".", "NewLedgerVersion", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetNewLedgerVersion retrieves the NewLedgerVersion value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetNewLedgerVersion", "retrieves", "the", "NewLedgerVersion", "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#L4856-L4865
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustNewBaseFee
func (u LedgerUpgrade) MustNewBaseFee() Uint32 { val, ok := u.GetNewBaseFee() if !ok { panic("arm NewBaseFee is not set") } return val }
go
func (u LedgerUpgrade) MustNewBaseFee() Uint32 { val, ok := u.GetNewBaseFee() if !ok { panic("arm NewBaseFee is not set") } return val }
[ "func", "(", "u", "LedgerUpgrade", ")", "MustNewBaseFee", "(", ")", "Uint32", "{", "val", ",", "ok", ":=", "u", ".", "GetNewBaseFee", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm NewBaseFee is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustNewBaseFee retrieves the NewBaseFee value from the union, // panicing if the value is not set.
[ "MustNewBaseFee", "retrieves", "the", "NewBaseFee", "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#L4869-L4877
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetNewBaseFee
func (u LedgerUpgrade) GetNewBaseFee() (result Uint32, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "NewBaseFee" { result = *u.NewBaseFee ok = true } return }
go
func (u LedgerUpgrade) GetNewBaseFee() (result Uint32, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "NewBaseFee" { result = *u.NewBaseFee ok = true } return }
[ "func", "(", "u", "LedgerUpgrade", ")", "GetNewBaseFee", "(", ")", "(", "result", "Uint32", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"NewBaseFee\"", "{", "result", "=", "*", "u", ".", "NewBaseFee", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetNewBaseFee retrieves the NewBaseFee value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetNewBaseFee", "retrieves", "the", "NewBaseFee", "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#L4881-L4890
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustNewMaxTxSetSize
func (u LedgerUpgrade) MustNewMaxTxSetSize() Uint32 { val, ok := u.GetNewMaxTxSetSize() if !ok { panic("arm NewMaxTxSetSize is not set") } return val }
go
func (u LedgerUpgrade) MustNewMaxTxSetSize() Uint32 { val, ok := u.GetNewMaxTxSetSize() if !ok { panic("arm NewMaxTxSetSize is not set") } return val }
[ "func", "(", "u", "LedgerUpgrade", ")", "MustNewMaxTxSetSize", "(", ")", "Uint32", "{", "val", ",", "ok", ":=", "u", ".", "GetNewMaxTxSetSize", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm NewMaxTxSetSize is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustNewMaxTxSetSize retrieves the NewMaxTxSetSize value from the union, // panicing if the value is not set.
[ "MustNewMaxTxSetSize", "retrieves", "the", "NewMaxTxSetSize", "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#L4894-L4902
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetNewMaxTxSetSize
func (u LedgerUpgrade) GetNewMaxTxSetSize() (result Uint32, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "NewMaxTxSetSize" { result = *u.NewMaxTxSetSize ok = true } return }
go
func (u LedgerUpgrade) GetNewMaxTxSetSize() (result Uint32, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "NewMaxTxSetSize" { result = *u.NewMaxTxSetSize ok = true } return }
[ "func", "(", "u", "LedgerUpgrade", ")", "GetNewMaxTxSetSize", "(", ")", "(", "result", "Uint32", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"NewMaxTxSetSize\"", "{", "result", "=", "*", "u", ".", "NewMaxTxSetSize", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetNewMaxTxSetSize retrieves the NewMaxTxSetSize value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetNewMaxTxSetSize", "retrieves", "the", "NewMaxTxSetSize", "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#L4906-L4915
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u LedgerKey) ArmForSwitch(sw int32) (string, bool) { switch LedgerEntryType(sw) { case LedgerEntryTypeAccount: return "Account", true case LedgerEntryTypeTrustline: return "TrustLine", true case LedgerEntryTypeOffer: return "Offer", true case LedgerEntryTypeData: return "Data", true } return "-", false }
go
func (u LedgerKey) ArmForSwitch(sw int32) (string, bool) { switch LedgerEntryType(sw) { case LedgerEntryTypeAccount: return "Account", true case LedgerEntryTypeTrustline: return "TrustLine", true case LedgerEntryTypeOffer: return "Offer", true case LedgerEntryTypeData: return "Data", true } return "-", false }
[ "func", "(", "u", "LedgerKey", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "LedgerEntryType", "(", "sw", ")", "{", "case", "LedgerEntryTypeAccount", ":", "return", "\"Account\"", ",", "true", "\n", "case", "LedgerEntryTypeTrustline", ":", "return", "\"TrustLine\"", ",", "true", "\n", "case", "LedgerEntryTypeOffer", ":", "return", "\"Offer\"", ",", "true", "\n", "case", "LedgerEntryTypeData", ":", "return", "\"Data\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of LedgerKey
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "LedgerKey" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5015-L5027
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerKey
func NewLedgerKey(aType LedgerEntryType, value interface{}) (result LedgerKey, err error) { result.Type = aType switch LedgerEntryType(aType) { case LedgerEntryTypeAccount: tv, ok := value.(LedgerKeyAccount) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyAccount") return } result.Account = &tv case LedgerEntryTypeTrustline: tv, ok := value.(LedgerKeyTrustLine) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyTrustLine") return } result.TrustLine = &tv case LedgerEntryTypeOffer: tv, ok := value.(LedgerKeyOffer) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyOffer") return } result.Offer = &tv case LedgerEntryTypeData: tv, ok := value.(LedgerKeyData) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyData") return } result.Data = &tv } return }
go
func NewLedgerKey(aType LedgerEntryType, value interface{}) (result LedgerKey, err error) { result.Type = aType switch LedgerEntryType(aType) { case LedgerEntryTypeAccount: tv, ok := value.(LedgerKeyAccount) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyAccount") return } result.Account = &tv case LedgerEntryTypeTrustline: tv, ok := value.(LedgerKeyTrustLine) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyTrustLine") return } result.TrustLine = &tv case LedgerEntryTypeOffer: tv, ok := value.(LedgerKeyOffer) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyOffer") return } result.Offer = &tv case LedgerEntryTypeData: tv, ok := value.(LedgerKeyData) if !ok { err = fmt.Errorf("invalid value, must be LedgerKeyData") return } result.Data = &tv } return }
[ "func", "NewLedgerKey", "(", "aType", "LedgerEntryType", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerKey", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "LedgerEntryType", "(", "aType", ")", "{", "case", "LedgerEntryTypeAccount", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerKeyAccount", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerKeyAccount\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Account", "=", "&", "tv", "\n", "case", "LedgerEntryTypeTrustline", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerKeyTrustLine", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerKeyTrustLine\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "TrustLine", "=", "&", "tv", "\n", "case", "LedgerEntryTypeOffer", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerKeyOffer", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerKeyOffer\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Offer", "=", "&", "tv", "\n", "case", "LedgerEntryTypeData", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerKeyData", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerKeyData\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Data", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewLedgerKey creates a new LedgerKey.
[ "NewLedgerKey", "creates", "a", "new", "LedgerKey", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5030-L5063
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e BucketEntryType) ValidEnum(v int32) bool { _, ok := bucketEntryTypeMap[v] return ok }
go
func (e BucketEntryType) ValidEnum(v int32) bool { _, ok := bucketEntryTypeMap[v] return ok }
[ "func", "(", "e", "BucketEntryType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "bucketEntryTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for BucketEntryType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "BucketEntryType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5187-L5190
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u BucketEntry) ArmForSwitch(sw int32) (string, bool) { switch BucketEntryType(sw) { case BucketEntryTypeLiveentry: return "LiveEntry", true case BucketEntryTypeDeadentry: return "DeadEntry", true } return "-", false }
go
func (u BucketEntry) ArmForSwitch(sw int32) (string, bool) { switch BucketEntryType(sw) { case BucketEntryTypeLiveentry: return "LiveEntry", true case BucketEntryTypeDeadentry: return "DeadEntry", true } return "-", false }
[ "func", "(", "u", "BucketEntry", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "BucketEntryType", "(", "sw", ")", "{", "case", "BucketEntryTypeLiveentry", ":", "return", "\"LiveEntry\"", ",", "true", "\n", "case", "BucketEntryTypeDeadentry", ":", "return", "\"DeadEntry\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of BucketEntry
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "BucketEntry" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5223-L5231
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewBucketEntry
func NewBucketEntry(aType BucketEntryType, value interface{}) (result BucketEntry, err error) { result.Type = aType switch BucketEntryType(aType) { case BucketEntryTypeLiveentry: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.LiveEntry = &tv case BucketEntryTypeDeadentry: tv, ok := value.(LedgerKey) if !ok { err = fmt.Errorf("invalid value, must be LedgerKey") return } result.DeadEntry = &tv } return }
go
func NewBucketEntry(aType BucketEntryType, value interface{}) (result BucketEntry, err error) { result.Type = aType switch BucketEntryType(aType) { case BucketEntryTypeLiveentry: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.LiveEntry = &tv case BucketEntryTypeDeadentry: tv, ok := value.(LedgerKey) if !ok { err = fmt.Errorf("invalid value, must be LedgerKey") return } result.DeadEntry = &tv } return }
[ "func", "NewBucketEntry", "(", "aType", "BucketEntryType", ",", "value", "interface", "{", "}", ")", "(", "result", "BucketEntry", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "BucketEntryType", "(", "aType", ")", "{", "case", "BucketEntryTypeLiveentry", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerEntry", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerEntry\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "LiveEntry", "=", "&", "tv", "\n", "case", "BucketEntryTypeDeadentry", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerKey", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerKey\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "DeadEntry", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewBucketEntry creates a new BucketEntry.
[ "NewBucketEntry", "creates", "a", "new", "BucketEntry", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5234-L5253
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustLiveEntry
func (u BucketEntry) MustLiveEntry() LedgerEntry { val, ok := u.GetLiveEntry() if !ok { panic("arm LiveEntry is not set") } return val }
go
func (u BucketEntry) MustLiveEntry() LedgerEntry { val, ok := u.GetLiveEntry() if !ok { panic("arm LiveEntry is not set") } return val }
[ "func", "(", "u", "BucketEntry", ")", "MustLiveEntry", "(", ")", "LedgerEntry", "{", "val", ",", "ok", ":=", "u", ".", "GetLiveEntry", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm LiveEntry is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustLiveEntry retrieves the LiveEntry value from the union, // panicing if the value is not set.
[ "MustLiveEntry", "retrieves", "the", "LiveEntry", "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#L5257-L5265
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetLiveEntry
func (u BucketEntry) GetLiveEntry() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "LiveEntry" { result = *u.LiveEntry ok = true } return }
go
func (u BucketEntry) GetLiveEntry() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "LiveEntry" { result = *u.LiveEntry ok = true } return }
[ "func", "(", "u", "BucketEntry", ")", "GetLiveEntry", "(", ")", "(", "result", "LedgerEntry", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"LiveEntry\"", "{", "result", "=", "*", "u", ".", "LiveEntry", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetLiveEntry retrieves the LiveEntry value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetLiveEntry", "retrieves", "the", "LiveEntry", "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#L5269-L5278
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustDeadEntry
func (u BucketEntry) MustDeadEntry() LedgerKey { val, ok := u.GetDeadEntry() if !ok { panic("arm DeadEntry is not set") } return val }
go
func (u BucketEntry) MustDeadEntry() LedgerKey { val, ok := u.GetDeadEntry() if !ok { panic("arm DeadEntry is not set") } return val }
[ "func", "(", "u", "BucketEntry", ")", "MustDeadEntry", "(", ")", "LedgerKey", "{", "val", ",", "ok", ":=", "u", ".", "GetDeadEntry", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm DeadEntry is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustDeadEntry retrieves the DeadEntry value from the union, // panicing if the value is not set.
[ "MustDeadEntry", "retrieves", "the", "DeadEntry", "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#L5282-L5290
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetDeadEntry
func (u BucketEntry) GetDeadEntry() (result LedgerKey, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "DeadEntry" { result = *u.DeadEntry ok = true } return }
go
func (u BucketEntry) GetDeadEntry() (result LedgerKey, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "DeadEntry" { result = *u.DeadEntry ok = true } return }
[ "func", "(", "u", "BucketEntry", ")", "GetDeadEntry", "(", ")", "(", "result", "LedgerKey", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"DeadEntry\"", "{", "result", "=", "*", "u", ".", "DeadEntry", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetDeadEntry retrieves the DeadEntry value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetDeadEntry", "retrieves", "the", "DeadEntry", "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#L5294-L5303
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTransactionHistoryEntryExt
func NewTransactionHistoryEntryExt(v int32, value interface{}) (result TransactionHistoryEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewTransactionHistoryEntryExt(v int32, value interface{}) (result TransactionHistoryEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewTransactionHistoryEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "TransactionHistoryEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", "\n", "return", "\n", "}" ]
// NewTransactionHistoryEntryExt creates a new TransactionHistoryEntryExt.
[ "NewTransactionHistoryEntryExt", "creates", "a", "new", "TransactionHistoryEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5377-L5384
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u TransactionHistoryResultEntryExt) ArmForSwitch(sw int32) (string, bool) { switch int32(sw) { case 0: return "", true } return "-", false }
go
func (u TransactionHistoryResultEntryExt) ArmForSwitch(sw int32) (string, bool) { switch int32(sw) { case 0: return "", true } return "-", false }
[ "func", "(", "u", "TransactionHistoryResultEntryExt", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "int32", "(", "sw", ")", "{", "case", "0", ":", "return", "\"\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of TransactionHistoryResultEntryExt
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "TransactionHistoryResultEntryExt" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5428-L5434
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTransactionHistoryResultEntryExt
func NewTransactionHistoryResultEntryExt(v int32, value interface{}) (result TransactionHistoryResultEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewTransactionHistoryResultEntryExt(v int32, value interface{}) (result TransactionHistoryResultEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewTransactionHistoryResultEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "TransactionHistoryResultEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", "\n", "return", "\n", "}" ]
// NewTransactionHistoryResultEntryExt creates a new TransactionHistoryResultEntryExt.
[ "NewTransactionHistoryResultEntryExt", "creates", "a", "new", "TransactionHistoryResultEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5437-L5444
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerHeaderHistoryEntryExt
func NewLedgerHeaderHistoryEntryExt(v int32, value interface{}) (result LedgerHeaderHistoryEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
go
func NewLedgerHeaderHistoryEntryExt(v int32, value interface{}) (result LedgerHeaderHistoryEntryExt, err error) { result.V = v switch int32(v) { case 0: // void } return }
[ "func", "NewLedgerHeaderHistoryEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerHeaderHistoryEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "}", "\n", "return", "\n", "}" ]
// NewLedgerHeaderHistoryEntryExt creates a new LedgerHeaderHistoryEntryExt.
[ "NewLedgerHeaderHistoryEntryExt", "creates", "a", "new", "LedgerHeaderHistoryEntryExt", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5497-L5504
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewScpHistoryEntry
func NewScpHistoryEntry(v int32, value interface{}) (result ScpHistoryEntry, err error) { result.V = v switch int32(v) { case 0: tv, ok := value.(ScpHistoryEntryV0) if !ok { err = fmt.Errorf("invalid value, must be ScpHistoryEntryV0") return } result.V0 = &tv } return }
go
func NewScpHistoryEntry(v int32, value interface{}) (result ScpHistoryEntry, err error) { result.V = v switch int32(v) { case 0: tv, ok := value.(ScpHistoryEntryV0) if !ok { err = fmt.Errorf("invalid value, must be ScpHistoryEntryV0") return } result.V0 = &tv } return }
[ "func", "NewScpHistoryEntry", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "ScpHistoryEntry", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "tv", ",", "ok", ":=", "value", ".", "(", "ScpHistoryEntryV0", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be ScpHistoryEntryV0\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "V0", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewScpHistoryEntry creates a new ScpHistoryEntry.
[ "NewScpHistoryEntry", "creates", "a", "new", "ScpHistoryEntry", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5584-L5596
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e LedgerEntryChangeType) ValidEnum(v int32) bool { _, ok := ledgerEntryChangeTypeMap[v] return ok }
go
func (e LedgerEntryChangeType) ValidEnum(v int32) bool { _, ok := ledgerEntryChangeTypeMap[v] return ok }
[ "func", "(", "e", "LedgerEntryChangeType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "ledgerEntryChangeTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for LedgerEntryChangeType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "LedgerEntryChangeType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5651-L5654
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u LedgerEntryChange) ArmForSwitch(sw int32) (string, bool) { switch LedgerEntryChangeType(sw) { case LedgerEntryChangeTypeLedgerEntryCreated: return "Created", true case LedgerEntryChangeTypeLedgerEntryUpdated: return "Updated", true case LedgerEntryChangeTypeLedgerEntryRemoved: return "Removed", true case LedgerEntryChangeTypeLedgerEntryState: return "State", true } return "-", false }
go
func (u LedgerEntryChange) ArmForSwitch(sw int32) (string, bool) { switch LedgerEntryChangeType(sw) { case LedgerEntryChangeTypeLedgerEntryCreated: return "Created", true case LedgerEntryChangeTypeLedgerEntryUpdated: return "Updated", true case LedgerEntryChangeTypeLedgerEntryRemoved: return "Removed", true case LedgerEntryChangeTypeLedgerEntryState: return "State", true } return "-", false }
[ "func", "(", "u", "LedgerEntryChange", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "LedgerEntryChangeType", "(", "sw", ")", "{", "case", "LedgerEntryChangeTypeLedgerEntryCreated", ":", "return", "\"Created\"", ",", "true", "\n", "case", "LedgerEntryChangeTypeLedgerEntryUpdated", ":", "return", "\"Updated\"", ",", "true", "\n", "case", "LedgerEntryChangeTypeLedgerEntryRemoved", ":", "return", "\"Removed\"", ",", "true", "\n", "case", "LedgerEntryChangeTypeLedgerEntryState", ":", "return", "\"State\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of LedgerEntryChange
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "LedgerEntryChange" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5692-L5704
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewLedgerEntryChange
func NewLedgerEntryChange(aType LedgerEntryChangeType, value interface{}) (result LedgerEntryChange, err error) { result.Type = aType switch LedgerEntryChangeType(aType) { case LedgerEntryChangeTypeLedgerEntryCreated: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.Created = &tv case LedgerEntryChangeTypeLedgerEntryUpdated: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.Updated = &tv case LedgerEntryChangeTypeLedgerEntryRemoved: tv, ok := value.(LedgerKey) if !ok { err = fmt.Errorf("invalid value, must be LedgerKey") return } result.Removed = &tv case LedgerEntryChangeTypeLedgerEntryState: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.State = &tv } return }
go
func NewLedgerEntryChange(aType LedgerEntryChangeType, value interface{}) (result LedgerEntryChange, err error) { result.Type = aType switch LedgerEntryChangeType(aType) { case LedgerEntryChangeTypeLedgerEntryCreated: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.Created = &tv case LedgerEntryChangeTypeLedgerEntryUpdated: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.Updated = &tv case LedgerEntryChangeTypeLedgerEntryRemoved: tv, ok := value.(LedgerKey) if !ok { err = fmt.Errorf("invalid value, must be LedgerKey") return } result.Removed = &tv case LedgerEntryChangeTypeLedgerEntryState: tv, ok := value.(LedgerEntry) if !ok { err = fmt.Errorf("invalid value, must be LedgerEntry") return } result.State = &tv } return }
[ "func", "NewLedgerEntryChange", "(", "aType", "LedgerEntryChangeType", ",", "value", "interface", "{", "}", ")", "(", "result", "LedgerEntryChange", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "LedgerEntryChangeType", "(", "aType", ")", "{", "case", "LedgerEntryChangeTypeLedgerEntryCreated", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerEntry", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerEntry\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Created", "=", "&", "tv", "\n", "case", "LedgerEntryChangeTypeLedgerEntryUpdated", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerEntry", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerEntry\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Updated", "=", "&", "tv", "\n", "case", "LedgerEntryChangeTypeLedgerEntryRemoved", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerKey", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerKey\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Removed", "=", "&", "tv", "\n", "case", "LedgerEntryChangeTypeLedgerEntryState", ":", "tv", ",", "ok", ":=", "value", ".", "(", "LedgerEntry", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be LedgerEntry\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "State", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewLedgerEntryChange creates a new LedgerEntryChange.
[ "NewLedgerEntryChange", "creates", "a", "new", "LedgerEntryChange", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5707-L5740
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustCreated
func (u LedgerEntryChange) MustCreated() LedgerEntry { val, ok := u.GetCreated() if !ok { panic("arm Created is not set") } return val }
go
func (u LedgerEntryChange) MustCreated() LedgerEntry { val, ok := u.GetCreated() if !ok { panic("arm Created is not set") } return val }
[ "func", "(", "u", "LedgerEntryChange", ")", "MustCreated", "(", ")", "LedgerEntry", "{", "val", ",", "ok", ":=", "u", ".", "GetCreated", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Created is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustCreated retrieves the Created value from the union, // panicing if the value is not set.
[ "MustCreated", "retrieves", "the", "Created", "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#L5744-L5752
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetCreated
func (u LedgerEntryChange) GetCreated() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Created" { result = *u.Created ok = true } return }
go
func (u LedgerEntryChange) GetCreated() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Created" { result = *u.Created ok = true } return }
[ "func", "(", "u", "LedgerEntryChange", ")", "GetCreated", "(", ")", "(", "result", "LedgerEntry", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Created\"", "{", "result", "=", "*", "u", ".", "Created", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetCreated retrieves the Created value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetCreated", "retrieves", "the", "Created", "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#L5756-L5765
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustUpdated
func (u LedgerEntryChange) MustUpdated() LedgerEntry { val, ok := u.GetUpdated() if !ok { panic("arm Updated is not set") } return val }
go
func (u LedgerEntryChange) MustUpdated() LedgerEntry { val, ok := u.GetUpdated() if !ok { panic("arm Updated is not set") } return val }
[ "func", "(", "u", "LedgerEntryChange", ")", "MustUpdated", "(", ")", "LedgerEntry", "{", "val", ",", "ok", ":=", "u", ".", "GetUpdated", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Updated is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustUpdated retrieves the Updated value from the union, // panicing if the value is not set.
[ "MustUpdated", "retrieves", "the", "Updated", "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#L5769-L5777
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetUpdated
func (u LedgerEntryChange) GetUpdated() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Updated" { result = *u.Updated ok = true } return }
go
func (u LedgerEntryChange) GetUpdated() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Updated" { result = *u.Updated ok = true } return }
[ "func", "(", "u", "LedgerEntryChange", ")", "GetUpdated", "(", ")", "(", "result", "LedgerEntry", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Updated\"", "{", "result", "=", "*", "u", ".", "Updated", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetUpdated retrieves the Updated value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetUpdated", "retrieves", "the", "Updated", "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#L5781-L5790
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustRemoved
func (u LedgerEntryChange) MustRemoved() LedgerKey { val, ok := u.GetRemoved() if !ok { panic("arm Removed is not set") } return val }
go
func (u LedgerEntryChange) MustRemoved() LedgerKey { val, ok := u.GetRemoved() if !ok { panic("arm Removed is not set") } return val }
[ "func", "(", "u", "LedgerEntryChange", ")", "MustRemoved", "(", ")", "LedgerKey", "{", "val", ",", "ok", ":=", "u", ".", "GetRemoved", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Removed is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustRemoved retrieves the Removed value from the union, // panicing if the value is not set.
[ "MustRemoved", "retrieves", "the", "Removed", "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#L5794-L5802
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetRemoved
func (u LedgerEntryChange) GetRemoved() (result LedgerKey, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Removed" { result = *u.Removed ok = true } return }
go
func (u LedgerEntryChange) GetRemoved() (result LedgerKey, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Removed" { result = *u.Removed ok = true } return }
[ "func", "(", "u", "LedgerEntryChange", ")", "GetRemoved", "(", ")", "(", "result", "LedgerKey", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Removed\"", "{", "result", "=", "*", "u", ".", "Removed", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetRemoved retrieves the Removed value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetRemoved", "retrieves", "the", "Removed", "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#L5806-L5815
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustState
func (u LedgerEntryChange) MustState() LedgerEntry { val, ok := u.GetState() if !ok { panic("arm State is not set") } return val }
go
func (u LedgerEntryChange) MustState() LedgerEntry { val, ok := u.GetState() if !ok { panic("arm State is not set") } return val }
[ "func", "(", "u", "LedgerEntryChange", ")", "MustState", "(", ")", "LedgerEntry", "{", "val", ",", "ok", ":=", "u", ".", "GetState", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm State is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustState retrieves the State value from the union, // panicing if the value is not set.
[ "MustState", "retrieves", "the", "State", "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#L5819-L5827
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetState
func (u LedgerEntryChange) GetState() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "State" { result = *u.State ok = true } return }
go
func (u LedgerEntryChange) GetState() (result LedgerEntry, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "State" { result = *u.State ok = true } return }
[ "func", "(", "u", "LedgerEntryChange", ")", "GetState", "(", ")", "(", "result", "LedgerEntry", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"State\"", "{", "result", "=", "*", "u", ".", "State", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetState retrieves the State value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetState", "retrieves", "the", "State", "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#L5831-L5840
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewTransactionMeta
func NewTransactionMeta(v int32, value interface{}) (result TransactionMeta, err error) { result.V = v switch int32(v) { case 0: tv, ok := value.([]OperationMeta) if !ok { err = fmt.Errorf("invalid value, must be []OperationMeta") return } result.Operations = &tv } return }
go
func NewTransactionMeta(v int32, value interface{}) (result TransactionMeta, err error) { result.V = v switch int32(v) { case 0: tv, ok := value.([]OperationMeta) if !ok { err = fmt.Errorf("invalid value, must be []OperationMeta") return } result.Operations = &tv } return }
[ "func", "NewTransactionMeta", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "result", "TransactionMeta", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "tv", ",", "ok", ":=", "value", ".", "(", "[", "]", "OperationMeta", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be []OperationMeta\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Operations", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewTransactionMeta creates a new TransactionMeta.
[ "NewTransactionMeta", "creates", "a", "new", "TransactionMeta", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5889-L5901
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustOperations
func (u TransactionMeta) MustOperations() []OperationMeta { val, ok := u.GetOperations() if !ok { panic("arm Operations is not set") } return val }
go
func (u TransactionMeta) MustOperations() []OperationMeta { val, ok := u.GetOperations() if !ok { panic("arm Operations is not set") } return val }
[ "func", "(", "u", "TransactionMeta", ")", "MustOperations", "(", ")", "[", "]", "OperationMeta", "{", "val", ",", "ok", ":=", "u", ".", "GetOperations", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Operations is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustOperations retrieves the Operations value from the union, // panicing if the value is not set.
[ "MustOperations", "retrieves", "the", "Operations", "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#L5905-L5913
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetOperations
func (u TransactionMeta) GetOperations() (result []OperationMeta, ok bool) { armName, _ := u.ArmForSwitch(int32(u.V)) if armName == "Operations" { result = *u.Operations ok = true } return }
go
func (u TransactionMeta) GetOperations() (result []OperationMeta, ok bool) { armName, _ := u.ArmForSwitch(int32(u.V)) if armName == "Operations" { result = *u.Operations ok = true } return }
[ "func", "(", "u", "TransactionMeta", ")", "GetOperations", "(", ")", "(", "result", "[", "]", "OperationMeta", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "V", ")", ")", "\n", "if", "armName", "==", "\"Operations\"", "{", "result", "=", "*", "u", ".", "Operations", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetOperations retrieves the Operations value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetOperations", "retrieves", "the", "Operations", "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#L5917-L5926
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e ErrorCode) ValidEnum(v int32) bool { _, ok := errorCodeMap[v] return ok }
go
func (e ErrorCode) ValidEnum(v int32) bool { _, ok := errorCodeMap[v] return ok }
[ "func", "(", "e", "ErrorCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "errorCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for ErrorCode
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "ErrorCode" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L5959-L5962
test
stellar/go-stellar-base
xdr/xdr_generated.go
ValidEnum
func (e IpAddrType) ValidEnum(v int32) bool { _, ok := ipAddrTypeMap[v] return ok }
go
func (e IpAddrType) ValidEnum(v int32) bool { _, ok := ipAddrTypeMap[v] return ok }
[ "func", "(", "e", "IpAddrType", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "ok", ":=", "ipAddrTypeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
// ValidEnum validates a proposed value for this enum. Implements // the Enum interface for IpAddrType
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "IpAddrType" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L6060-L6063
test
stellar/go-stellar-base
xdr/xdr_generated.go
ArmForSwitch
func (u PeerAddressIp) ArmForSwitch(sw int32) (string, bool) { switch IpAddrType(sw) { case IpAddrTypeIPv4: return "Ipv4", true case IpAddrTypeIPv6: return "Ipv6", true } return "-", false }
go
func (u PeerAddressIp) ArmForSwitch(sw int32) (string, bool) { switch IpAddrType(sw) { case IpAddrTypeIPv4: return "Ipv4", true case IpAddrTypeIPv6: return "Ipv6", true } return "-", false }
[ "func", "(", "u", "PeerAddressIp", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "IpAddrType", "(", "sw", ")", "{", "case", "IpAddrTypeIPv4", ":", "return", "\"Ipv4\"", ",", "true", "\n", "case", "IpAddrTypeIPv6", ":", "return", "\"Ipv6\"", ",", "true", "\n", "}", "\n", "return", "\"-\"", ",", "false", "\n", "}" ]
// ArmForSwitch returns which field name should be used for storing // the value for an instance of PeerAddressIp
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "PeerAddressIp" ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L6095-L6103
test
stellar/go-stellar-base
xdr/xdr_generated.go
NewPeerAddressIp
func NewPeerAddressIp(aType IpAddrType, value interface{}) (result PeerAddressIp, err error) { result.Type = aType switch IpAddrType(aType) { case IpAddrTypeIPv4: tv, ok := value.([4]byte) if !ok { err = fmt.Errorf("invalid value, must be [4]byte") return } result.Ipv4 = &tv case IpAddrTypeIPv6: tv, ok := value.([16]byte) if !ok { err = fmt.Errorf("invalid value, must be [16]byte") return } result.Ipv6 = &tv } return }
go
func NewPeerAddressIp(aType IpAddrType, value interface{}) (result PeerAddressIp, err error) { result.Type = aType switch IpAddrType(aType) { case IpAddrTypeIPv4: tv, ok := value.([4]byte) if !ok { err = fmt.Errorf("invalid value, must be [4]byte") return } result.Ipv4 = &tv case IpAddrTypeIPv6: tv, ok := value.([16]byte) if !ok { err = fmt.Errorf("invalid value, must be [16]byte") return } result.Ipv6 = &tv } return }
[ "func", "NewPeerAddressIp", "(", "aType", "IpAddrType", ",", "value", "interface", "{", "}", ")", "(", "result", "PeerAddressIp", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "IpAddrType", "(", "aType", ")", "{", "case", "IpAddrTypeIPv4", ":", "tv", ",", "ok", ":=", "value", ".", "(", "[", "4", "]", "byte", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be [4]byte\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Ipv4", "=", "&", "tv", "\n", "case", "IpAddrTypeIPv6", ":", "tv", ",", "ok", ":=", "value", ".", "(", "[", "16", "]", "byte", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"invalid value, must be [16]byte\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "Ipv6", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
// NewPeerAddressIp creates a new PeerAddressIp.
[ "NewPeerAddressIp", "creates", "a", "new", "PeerAddressIp", "." ]
79c570612c0b461db178aa8949d9f13cafc2a7c9
https://github.com/stellar/go-stellar-base/blob/79c570612c0b461db178aa8949d9f13cafc2a7c9/xdr/xdr_generated.go#L6106-L6125
test
stellar/go-stellar-base
xdr/xdr_generated.go
MustIpv4
func (u PeerAddressIp) MustIpv4() [4]byte { val, ok := u.GetIpv4() if !ok { panic("arm Ipv4 is not set") } return val }
go
func (u PeerAddressIp) MustIpv4() [4]byte { val, ok := u.GetIpv4() if !ok { panic("arm Ipv4 is not set") } return val }
[ "func", "(", "u", "PeerAddressIp", ")", "MustIpv4", "(", ")", "[", "4", "]", "byte", "{", "val", ",", "ok", ":=", "u", ".", "GetIpv4", "(", ")", "\n", "if", "!", "ok", "{", "panic", "(", "\"arm Ipv4 is not set\"", ")", "\n", "}", "\n", "return", "val", "\n", "}" ]
// MustIpv4 retrieves the Ipv4 value from the union, // panicing if the value is not set.
[ "MustIpv4", "retrieves", "the", "Ipv4", "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#L6129-L6137
test
stellar/go-stellar-base
xdr/xdr_generated.go
GetIpv4
func (u PeerAddressIp) GetIpv4() (result [4]byte, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Ipv4" { result = *u.Ipv4 ok = true } return }
go
func (u PeerAddressIp) GetIpv4() (result [4]byte, ok bool) { armName, _ := u.ArmForSwitch(int32(u.Type)) if armName == "Ipv4" { result = *u.Ipv4 ok = true } return }
[ "func", "(", "u", "PeerAddressIp", ")", "GetIpv4", "(", ")", "(", "result", "[", "4", "]", "byte", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n", "if", "armName", "==", "\"Ipv4\"", "{", "result", "=", "*", "u", ".", "Ipv4", "\n", "ok", "=", "true", "\n", "}", "\n", "return", "\n", "}" ]
// GetIpv4 retrieves the Ipv4 value from the union, // returning ok if the union's switch indicated the value is valid.
[ "GetIpv4", "retrieves", "the", "Ipv4", "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#L6141-L6150
test