Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: permission package type mismatch #558

Merged
merged 5 commits into from
Jan 11, 2024
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Bugfixes:
Chore:
* [#551](https://github.com/bnb-chain/greenfield/pull/551) chore: fix typo and update doc

## v1.2.2
This release introduces the Manchurian upgrade to the mainnet.

## v1.2.1
This release fixes the bugs within resource tags.

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Refer to the [docs](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfi

- [Interacting with the Node](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/interact-node)
- [Run Local Network](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/run-local-network)
- [Run Testnet Node](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/run-testnet-node)
- [Become Testnet Validator](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/become-testnet-validator)
- [Run Node](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node)
- [Become Validator](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/become-validator)

## Related Projects
- [Greenfield-Contract](https://github.com/bnb-chain/greenfield-contracts): the cross chain contract for Greenfield that deployed on BSC network.
Expand Down
7 changes: 3 additions & 4 deletions x/permission/types/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import (
)

func TestParsePolicyIdFromQueueKey(t *testing.T) {
policyIds := []math.Uint{math.NewUint(rand.Uint64()), math.NewUint(rand.Uint64()), math.NewUint(rand.Uint64())}

expiration := time.Now()
for _, policyId := range policyIds {
for i := 0; i < 100; i++ {
expiration := time.Now().Add(time.Duration(rand.Int63()))
policyId := math.NewUint(rand.Uint64())
key := PolicyPrefixQueue(&expiration, policyId.Bytes())
recoverId := ParsePolicyIdFromQueueKey(key)
if !recoverId.Equal(policyId) {
Expand Down
4 changes: 2 additions & 2 deletions x/storage/types/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const (
OperationUpdateGroupMember uint8 = 4

// permission operation types
OperationCreatePolicy uint8 = 1
OperationDeletePolicy uint8 = 2
OperationCreatePolicy uint8 = 2
OperationDeletePolicy uint8 = 3
)

func SafeBigInt(input *big.Int) *big.Int {
Expand Down
4 changes: 2 additions & 2 deletions x/storage/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ var (

// GetBucketKey return the bucket name store key
func GetBucketKey(bucketName string) []byte {
objectNameHash := sdk.Keccak256([]byte(bucketName))
return append(BucketInfoPrefix, objectNameHash...)
bucketNameHash := sdk.Keccak256([]byte(bucketName))
return append(BucketInfoPrefix, bucketNameHash...)
}

// GetObjectKey return the object name store key
Expand Down
Loading