ipld-eth-server/integration_test/block_rewards_test.go
Matt K 605b0a96ae Add graphql server (#27)
* Add graphql server

* Update Makefile

* Update log_filters constraint

* Add GetLogFilter to repo

* Update travis (use Makefile, go fmt, go vet)

* Add logFilter schema and resolvers

* Add GetWatchedEvent to watched_events_repo

* Add watchedEventLog schema and resolvers
2018-02-08 10:12:08 -06:00

35 lines
842 B
Go

package integration
import (
"log"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
cfg "github.com/vulcanize/vulcanizedb/pkg/config"
"github.com/vulcanize/vulcanizedb/pkg/geth"
)
var _ = Describe("Rewards calculations", func() {
It("calculates a block reward for a real block", func() {
config, err := cfg.NewConfig("infura")
if err != nil {
log.Fatalln(err)
}
blockchain := geth.NewBlockchain(config.Client.IPCPath)
block := blockchain.GetBlockByNumber(1071819)
Expect(block.Reward).To(Equal(5.31355))
})
It("calculates an uncle reward for a real block", func() {
config, err := cfg.NewConfig("infura")
if err != nil {
log.Fatalln(err)
}
blockchain := geth.NewBlockchain(config.Client.IPCPath)
block := blockchain.GetBlockByNumber(1071819)
Expect(block.UnclesReward).To(Equal(6.875))
})
})