fix: Use fixed length hex for pointer at FwdCapabilityKey (#11737)
Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
parent
a8b3602c23
commit
dc98d7bf83
@ -39,7 +39,7 @@ func RevCapabilityKey(module, name string) []byte {
|
||||
// FwdCapabilityKey returns a forward lookup key for a given module and capability
|
||||
// reference.
|
||||
func FwdCapabilityKey(module string, cap *Capability) []byte {
|
||||
return []byte(fmt.Sprintf("%s/fwd/%p", module, cap))
|
||||
return []byte(fmt.Sprintf("%s/fwd/%#016p", module, cap))
|
||||
}
|
||||
|
||||
// IndexToKey returns bytes to be used as a key for a given capability index.
|
||||
|
||||
@ -16,7 +16,7 @@ func TestRevCapabilityKey(t *testing.T) {
|
||||
|
||||
func TestFwdCapabilityKey(t *testing.T) {
|
||||
cap := types.NewCapability(23)
|
||||
expected := []byte(fmt.Sprintf("bank/fwd/%p", cap))
|
||||
expected := []byte(fmt.Sprintf("bank/fwd/%#016p", cap))
|
||||
require.Equal(t, expected, types.FwdCapabilityKey("bank", cap))
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user