Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions address/address_special.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ const (

// RewardingProtocol is the rewarding protocol address
RewardingProtocol = "io154mvzs09vkgn0hw6gg3ayzw5w39jzp47f8py9v"

// PollProtocol is the poll protocol address
PollProtocol = "io1ze4hg0pvrftuj0pw90p7z6wj3wae7mdrwws6d5"

// RollDPoSProtocol is the Roll-DPoS protocol address
RollDPoSProtocol = "io1qsfhpcq2wywds8dpjx8suj2ytx4d4egwxzqsg3"
)

// 20-byte protocol address hash
var (
StakingProtocolAddrHash = hash160b([]byte("staking"))
RewardingProtocolAddrHash = hash160b([]byte("rewarding"))
PollProtocolAddrHash = hash160b([]byte("poll"))
RollDPoSProtocolAddrHash = hash160b([]byte("rolldpos"))
)

// hash160b returns 160-bit (20-byte) hash of input
Expand Down
19 changes: 19 additions & 0 deletions address/address_special_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package address

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestAddressSpecial(t *testing.T) {
r := require.New(t)

poll, err := FromBytes(PollProtocolAddrHash[:])
r.NoError(err)
r.Equal(PollProtocol, poll.String())

rolldpos, err := FromBytes(RollDPoSProtocolAddrHash[:])
r.NoError(err)
r.Equal(RollDPoSProtocol, rolldpos.String())
}