Skip to content

Commit

Permalink
Fix TransactionService test
Browse files Browse the repository at this point in the history
And fix a bug in the way genesis templates are bootstrapped
  • Loading branch information
lrettig committed Nov 5, 2024
1 parent df9ac86 commit 6e7942f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (g *GenesisConfig) ToAccounts() []types.Account {
}
if g.Templates[addr] != nil {
acct.State = g.Templates[addr]
acct.TemplateAddress = &genesisAddr
}
rst = append(rst, acct)
}
Expand Down
8 changes: 7 additions & 1 deletion node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ import (
"github.com/spacemeshos/go-spacemesh/p2p"
"github.com/spacemeshos/go-spacemesh/signing"
"github.com/spacemeshos/go-spacemesh/timesync"
walletProgram "github.com/spacemeshos/go-spacemesh/vm/programs/wallet"
"github.com/spacemeshos/go-spacemesh/vm/sdk"
"github.com/spacemeshos/go-spacemesh/vm/sdk/wallet"
walletTemplate "github.com/spacemeshos/go-spacemesh/vm/templates/wallet"
)

const layersPerEpoch = 3
Expand Down Expand Up @@ -508,7 +510,11 @@ func TestSpacemeshApp_TransactionService(t *testing.T) {
app.Config.Genesis = config.GenesisConfig{
GenesisTime: time.Now().Add(20 * time.Second).Format(time.RFC3339),
Accounts: map[string]uint64{
address.String(): 100_000_000,
address.String(): 100_000_000,
walletTemplate.TemplateAddress.String(): 0,
},
Templates: map[string][]byte{
walletTemplate.TemplateAddress.String(): walletProgram.PROGRAM,
},
}

Expand Down

0 comments on commit 6e7942f

Please sign in to comment.