Skip to content

Commit

Permalink
state proof data api calls and encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
tkernell committed Nov 13, 2023
1 parent 2c9797b commit 82da371
Show file tree
Hide file tree
Showing 31,573 changed files with 5,043,670 additions and 1,135 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 4 additions & 1 deletion bridge/multistore_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,16 @@ func (s bridgeServer) MultistoreTree(ctx context.Context, req *QueryMultistoreRe
fmt.Println("Defaulting to nothing found")
}
}
log.Printf(fmt.Sprintf("mintStore %s", bytes.HexBytes(multistoreProof.Path[0].Prefix).String()))
// print whole multistoreProof.Path to see all the paths
// log.Printf(fmt.Sprintf("path0: %s", bytes.HexBytes(multistoreProof.GetPath()).String()))
logCtx := sdk.UnwrapSDKContext(ctx)
s.Logger(logCtx).Error(fmt.Sprintf("iavlProof %v", iavlProof))

return &QueryMultistoreResponse{
MutiStoreTree: MutiStoreTreeFields{
OracleIavlStateHash: bytes.HexBytes(multistoreProof.Value).String(),
MintStoreMerkleHash: bytes.HexBytes(multistoreProof.Path[0].Prefix).String(),
MintStoreMerkleHash: bytes.HexBytes(multistoreProof.Path[0].Prefix[1:]).String(),
IcacontrollerToIcahostMerkleHash: bytes.HexBytes(multistoreProof.Path[1].Prefix[1:]).String(),
FeegrantToIbcMerkleHash: bytes.HexBytes(multistoreProof.Path[2].Prefix[1:]).String(),
AccToEvidenceMerkleHash: bytes.HexBytes(multistoreProof.Path[3].Prefix[1:]).String(),
Expand Down
34 changes: 34 additions & 0 deletions bridge/tmsig.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,46 @@ func (s bridgeServer) TmSig(_ context.Context, req *QueryTmRequest) (*QueryTmRes
if err != nil {
panic(err)
}

return &QueryTmResponse{
TmSig: sigs,
Common: common,
}, nil
}

// func (s bridgeServer) TmSig(_ context.Context, req *QueryTmRequest) (*QueryTmResponse, error) {
// commit, err := s.getCommit(req.Height)
// if err != nil {
// panic(err)
// }
// sigs, common, err := GetSignaturesAndPrefix(&commit.SignedHeader)
// if err != nil {
// panic(err)
// }

// // Decode from Base64
// prefixData, err := base64.StdEncoding.DecodeString(string(common.SignedDataPrefix))
// if err != nil {
// panic(err)
// }
// suffixData, err := base64.StdEncoding.DecodeString(string(common.SignedDataSuffix))
// if err != nil {
// panic(err)
// }

// // Encode to hexadecimal
// hexPrefix := hex.EncodeToString(prefixData)
// hexSuffix := hex.EncodeToString(suffixData)

// return &QueryTmResponse{
// TmSig: sigs,
// Common: CommonEncodedVotePart{
// SignedDataPrefix: hexPrefix,
// SignedDataSuffix: hexSuffix,
// },
// }, nil
// }

// func fetchSig(clientCtx client.Context, height *int64) ([]byte, error) {
// node, err := clientCtx.GetNode()
// if err != nil {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/a021fcac040dcb2ae15223b1ea98f621.json"
}
Loading

0 comments on commit 82da371

Please sign in to comment.