forked from stellar/go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genesis.go
31 lines (27 loc) · 789 Bytes
/
genesis.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
package ingest
import (
"github.com/pownieh/stellar_go/amount"
"github.com/pownieh/stellar_go/keypair"
"github.com/pownieh/stellar_go/xdr"
)
// GenesisChange returns the Change occurring at the genesis ledger (ledgerseq = 1)..
func GenesisChange(networkPassPhrase string) Change {
masterKeyPair := keypair.Master(networkPassPhrase)
masterAccountEntry := xdr.LedgerEntry{
LastModifiedLedgerSeq: 1,
Data: xdr.LedgerEntryData{
Type: xdr.LedgerEntryTypeAccount,
Account: &xdr.AccountEntry{
AccountId: xdr.MustAddress(masterKeyPair.Address()),
// 100B
Balance: amount.MustParse("100000000000"),
SeqNum: 0,
Thresholds: xdr.Thresholds{1, 0, 0, 0},
},
},
}
return Change{
Type: masterAccountEntry.Data.Type,
Post: &masterAccountEntry,
}
}