99 "bytes"
1010 "context"
1111 "encoding/json"
12+ "encoding/base64"
1213 "errors"
1314 "fmt"
1415 "math/big"
@@ -28,6 +29,7 @@ import (
2829 "github.com/cartesi/rollups-node/pkg/contracts/ierc20metadata"
2930 "github.com/cartesi/rollups-node/pkg/contracts/iquorum"
3031 "github.com/cartesi/rollups-node/pkg/ethutil"
32+ "github.com/davecgh/go-spew/spew"
3133 "github.com/ethereum/go-ethereum/accounts/abi"
3234 "github.com/ethereum/go-ethereum/accounts/abi/bind"
3335 "github.com/ethereum/go-ethereum/common"
@@ -580,7 +582,9 @@ func (s *WithdrawalLifecycleSuite) generateWithdrawalProofs(
580582 var replaySummary struct {
581583 MachineRoot string `json:"machine_root"`
582584 }
585+ fmt .Print ("1." , string (replayOut ))
583586 r .NoError (json .Unmarshal ([]byte (replayOut ), & replaySummary ), "parse machine replay summary" )
587+ spew .Dump (replaySummary )
584588 r .Equal (strings .ToLower (finalEpoch .MachineHash .Hex ()), strings .ToLower (replaySummary .MachineRoot ),
585589 "replayed machine root must match finalized epoch machine hash" )
586590
@@ -600,7 +604,9 @@ func (s *WithdrawalLifecycleSuite) generateWithdrawalProofs(
600604 AccountIndex string `json:"account_index"`
601605 MachineRoot string `json:"machine_root"`
602606 }
607+ fmt .Print ("2." , string (proveOut ))
603608 r .NoError (json .Unmarshal ([]byte (proveOut ), & proveSummary ), "parse accounts-drive proof summary" )
609+ spew .Dump (proveSummary )
604610 r .Equal (strings .ToLower (finalEpoch .MachineHash .Hex ()), strings .ToLower (proveSummary .MachineRoot ),
605611 "proof machine root must match finalized epoch machine hash" )
606612 r .NotEmpty (proveSummary .AccountIndex , "proof summary must include account index" )
@@ -827,3 +833,11 @@ func listWithdrawals(
827833 }
828834 return rpcResp .Result , nil
829835}
836+
837+ func base64ToHex (s string ) (string , error ) {
838+ raw , err := base64 .StdEncoding .DecodeString (s )
839+ if err != nil {
840+ return "" , fmt .Errorf ("expected %s to be a hash in base64. %w" , s , err )
841+ }
842+ return common .Hash (raw ).Hex (), nil
843+ }
0 commit comments