Skip to content

Commit eb50e6a

Browse files
author
Ivan Sukach
committed
fix warp RPC service
1 parent c7d8584 commit eb50e6a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

vm/vm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest
490490
}
491491
rpcClients := make(map[ids.NodeID]warp.Client)
492492
for id, nodeURI := range vm.config.AddressBook {
493-
nodeID, err := ids.ToNodeID([]byte(id))
493+
nodeID, err := ids.NodeIDFromString(id)
494494
if err != nil {
495495
return nil, fmt.Errorf("failed to parse node ID: %w", err)
496496
}
497-
rpcClient, err := warp.NewClient(fmt.Sprintf("%s/ext/bc/%s/rpc", nodeURI, string(req.ChainId)))
497+
rpcClient, err := warp.NewClient(fmt.Sprintf("%s/ext/bc/%s/rpc", nodeURI, chainID.String()))
498498
if err != nil {
499499
return nil, fmt.Errorf("failed to create warp client: %w", err)
500500
}

vm/warp_service.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ type ResultGetMessageSignature struct {
3939
Signature []byte `json:"signature"`
4040
}
4141

42+
type ResultGetBlockSignature struct {
43+
Signature []byte `json:"signature"`
44+
}
45+
4246
// API introduces snowman specific functionality to the evm
4347
type API struct {
4448
vm *LandslideVM
@@ -123,12 +127,12 @@ func (a *API) GetMessageAggregateSignature(ctx context.Context, messageID ids.ID
123127
}
124128

125129
// GetBlockSignature returns the BLS signature associated with a blockID.
126-
func (a *API) GetBlockSignature(ctx context.Context, blockID ids.ID) (tmbytes.HexBytes, error) {
130+
func (a *API) GetBlockSignature(ctx context.Context, blockID ids.ID) (*ResultGetBlockSignature, error) {
127131
signature, err := a.backend.GetBlockSignature(blockID)
128132
if err != nil {
129133
return nil, fmt.Errorf("failed to get signature for block %s with error %w", blockID, err)
130134
}
131-
return signature, nil
135+
return &ResultGetBlockSignature{Signature: signature}, nil
132136
}
133137

134138
// GetBlockAggregateSignature fetches the aggregate signature for the requested [blockID]

0 commit comments

Comments
 (0)