forked from stellar/go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinflation_test.go
44 lines (35 loc) · 1013 Bytes
/
inflation_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package build
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/stellar/go/xdr"
)
var _ = Describe("InflationBuilder Mutators", func() {
var (
subject InflationBuilder
mut interface{}
address = "GAXEMCEXBERNSRXOEKD4JAIKVECIXQCENHEBRVSPX2TTYZPMNEDSQCNQ"
bad = "foo"
)
JustBeforeEach(func() {
subject = InflationBuilder{}
subject.Mutate(mut)
})
Describe("SourceAccount", func() {
Context("using a valid stellar address", func() {
BeforeEach(func() { mut = SourceAccount{address} })
It("succeeds", func() {
Expect(subject.Err).NotTo(HaveOccurred())
})
It("sets the destination to the correct xdr.AccountId", func() {
var aid xdr.AccountId
aid.SetAddress(address)
Expect(subject.O.SourceAccount.MustEd25519()).To(Equal(aid.MustEd25519()))
})
})
Context("using an invalid value", func() {
BeforeEach(func() { mut = SourceAccount{bad} })
It("failed", func() { Expect(subject.Err).To(HaveOccurred()) })
})
})
})