diff --git a/node/app/db_console.go b/node/app/db_console.go index 9b34ae1..eb6c549 100644 --- a/node/app/db_console.go +++ b/node/app/db_console.go @@ -650,12 +650,10 @@ func FetchTokenBalance(client protobufs.NodeServiceClient) (TokenBalance, error) return TokenBalance{}, errors.Wrap(err, "error getting token info") } - // owned := new(big.Int).SetBytes(info.OwnedTokens) - unconfirmedOwned := new(big.Int).SetBytes(info.UnconfirmedOwnedTokens) + owned := new(big.Int).SetBytes(info.OwnedTokens) return TokenBalance{ - // Owned: owned, - UnconfirmedOwned: unconfirmedOwned, + Owned: owned, }, nil } diff --git a/node/app/node.go b/node/app/node.go index d6e7f1b..7d2f039 100644 --- a/node/app/node.go +++ b/node/app/node.go @@ -20,6 +20,7 @@ type Node struct { logger *zap.Logger dataProofStore store.DataProofStore clockStore store.ClockStore + coinStore store.CoinStore keyManager keys.KeyManager pubSub p2p.PubSub execEngines map[string]execution.ExecutionEngine @@ -44,6 +45,7 @@ func newNode( logger *zap.Logger, dataProofStore store.DataProofStore, clockStore store.ClockStore, + coinStore store.CoinStore, keyManager keys.KeyManager, pubSub p2p.PubSub, // execution engines wire in here @@ -59,6 +61,7 @@ func newNode( logger, dataProofStore, clockStore, + coinStore, keyManager, pubSub, execEngines, @@ -172,6 +175,10 @@ func (n *Node) GetClockStore() store.ClockStore { return n.clockStore } +func (n *Node) GetCoinStore() store.CoinStore { + return n.coinStore +} + func (n *Node) GetDataProofStore() store.DataProofStore { return n.dataProofStore } diff --git a/node/app/wire_gen.go b/node/app/wire_gen.go index 2b38d08..c2386ac 100644 --- a/node/app/wire_gen.go +++ b/node/app/wire_gen.go @@ -40,6 +40,7 @@ func NewDebugNode(configConfig *config.Config, selfTestReport *protobufs.SelfTes pebbleDB := store.NewPebbleDB(dbConfig) pebbleDataProofStore := store.NewPebbleDataProofStore(pebbleDB, zapLogger) pebbleClockStore := store.NewPebbleClockStore(pebbleDB, zapLogger) + pebbleCoinStore := store.NewPebbleCoinStore(pebbleDB, zapLogger) keyConfig := configConfig.Key fileKeyManager := keys.NewFileKeyManager(keyConfig, zapLogger) p2PConfig := configConfig.P2P @@ -50,7 +51,7 @@ func NewDebugNode(configConfig *config.Config, selfTestReport *protobufs.SelfTes masterTimeReel := time.NewMasterTimeReel(zapLogger, pebbleClockStore, engineConfig, wesolowskiFrameProver) inMemoryPeerInfoManager := p2p.NewInMemoryPeerInfoManager(zapLogger) masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub, kzgInclusionProver, wesolowskiFrameProver, masterTimeReel, inMemoryPeerInfoManager, selfTestReport) - node, err := newNode(zapLogger, pebbleDataProofStore, pebbleClockStore, fileKeyManager, blossomSub, masterClockConsensusEngine) + node, err := newNode(zapLogger, pebbleDataProofStore, pebbleClockStore, pebbleCoinStore, fileKeyManager, blossomSub, masterClockConsensusEngine) if err != nil { return nil, err } @@ -63,6 +64,7 @@ func NewNode(configConfig *config.Config, selfTestReport *protobufs.SelfTestRepo pebbleDB := store.NewPebbleDB(dbConfig) pebbleDataProofStore := store.NewPebbleDataProofStore(pebbleDB, zapLogger) pebbleClockStore := store.NewPebbleClockStore(pebbleDB, zapLogger) + pebbleCoinStore := store.NewPebbleCoinStore(pebbleDB, zapLogger) keyConfig := configConfig.Key fileKeyManager := keys.NewFileKeyManager(keyConfig, zapLogger) p2PConfig := configConfig.P2P @@ -73,7 +75,7 @@ func NewNode(configConfig *config.Config, selfTestReport *protobufs.SelfTestRepo masterTimeReel := time.NewMasterTimeReel(zapLogger, pebbleClockStore, engineConfig, wesolowskiFrameProver) inMemoryPeerInfoManager := p2p.NewInMemoryPeerInfoManager(zapLogger) masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub, kzgInclusionProver, wesolowskiFrameProver, masterTimeReel, inMemoryPeerInfoManager, selfTestReport) - node, err := newNode(zapLogger, pebbleDataProofStore, pebbleClockStore, fileKeyManager, blossomSub, masterClockConsensusEngine) + node, err := newNode(zapLogger, pebbleDataProofStore, pebbleClockStore, pebbleCoinStore, fileKeyManager, blossomSub, masterClockConsensusEngine) if err != nil { return nil, err } diff --git a/node/config/version.go b/node/config/version.go index 41c5853..9df8989 100644 --- a/node/config/version.go +++ b/node/config/version.go @@ -36,5 +36,5 @@ func FormatVersion(version []byte) string { } func GetPatchNumber() byte { - return 0x02 + return 0x03 } diff --git a/node/main.go b/node/main.go index 5c5b543..f7bce49 100644 --- a/node/main.go +++ b/node/main.go @@ -424,6 +424,7 @@ func main() { node.GetLogger(), node.GetDataProofStore(), node.GetClockStore(), + node.GetCoinStore(), node.GetKeyManager(), node.GetPubSub(), node.GetMasterClock(), diff --git a/node/rpc/node_rpc_server.go b/node/rpc/node_rpc_server.go index c9e13a1..e934a54 100644 --- a/node/rpc/node_rpc_server.go +++ b/node/rpc/node_rpc_server.go @@ -336,6 +336,7 @@ func NewRPCServer( logger *zap.Logger, dataProofStore store.DataProofStore, clockStore store.ClockStore, + coinStore store.CoinStore, keyManager keys.KeyManager, pubSub p2p.PubSub, masterClock *master.MasterClockConsensusEngine, @@ -347,6 +348,7 @@ func NewRPCServer( logger: logger, dataProofStore: dataProofStore, clockStore: clockStore, + coinStore: coinStore, keyManager: keyManager, pubSub: pubSub, masterClock: masterClock,