Skip to content

Commit

Permalink
unwrap contract address
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCherepovskyi committed Sep 3, 2024
1 parent aad5a9d commit 47d8f0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/rarimocore/crypto/pkg/op_passport_root_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/rarimo/rarimo-core/x/rarimocore/crypto/operation"
"github.com/rarimo/rarimo-core/x/rarimocore/types"
"math/big"
)

func GetPassportRootUpdate(operation types.Operation) (*types.PassportRootUpdate, error) {
Expand All @@ -19,8 +20,8 @@ func GetPassportRootUpdate(operation types.Operation) (*types.PassportRootUpdate

func GetPassportRootUpdateContent(op *types.PassportRootUpdate) (*operation.PassportRootUpdateContent, error) {
return &operation.PassportRootUpdateContent{
ContractAddress: operation.To32Bytes(hexutil.MustDecode(op.ContractAddress)),
ContractAddress: hexutil.MustDecode(op.ContractAddress),
Root: operation.To32Bytes(hexutil.MustDecode(op.Root)),
RootTimestamp: operation.IntTo32Bytes(int(op.Timestamp)),
RootTimestamp: operation.To32Bytes(new(big.Int).SetInt64(op.Timestamp).Bytes()),
}, nil
}

0 comments on commit 47d8f0f

Please sign in to comment.