-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2007 from Sifchain/testnet
Merge testnet to master for 0.9.10
- Loading branch information
Showing
58 changed files
with
9,920 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: "[Token Registry] Add new ETH token to registry" | ||
about: "[Token Registry] Add a new ETH token to registry" | ||
title: '[Token Registry] Add ... ETH token on ...sifchain network' | ||
labels: 'Sifnode, Token Registry' | ||
assignees: '@sifnode' | ||
--- | ||
|
||
<!-- Please fill in issue title --> | ||
|
||
### Details? | ||
|
||
Sifchain Chain ID: | ||
Denom: | ||
Denom: | ||
Decimals: | ||
Display Name: | ||
Network: | ||
|
||
<!-- | ||
Example: | ||
Sifchain Chain ID: sifchain-devnet-1 | ||
Denom: ceth | ||
Decimals: 18 | ||
Display Name: ETH | ||
Network: Ethereum Mainnet | ||
--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: "[Token Registry] Add new IBC chain channel and token" | ||
about: "[Token Registry] Add a new IBC chain, channel and token" | ||
title: '[Token Registry] Add ... chain on ... sifchain network' | ||
labels: 'Sifnode, Token Registry' | ||
assignees: '@sifnode' | ||
|
||
--- | ||
|
||
<!-- Please fill in issue title --> | ||
|
||
### Details? | ||
|
||
Sifchain Chain ID: | ||
Counterparty Chain ID: | ||
Channel ID: | ||
Counterparty Channel ID: | ||
Base Denom: | ||
Decimals: | ||
Display Name: | ||
|
||
<!-- | ||
Example: | ||
Sifchain Chain ID: sifchain-devnet-1 | ||
Counterparty Chain ID: cosmoshub-4 | ||
Channel ID: channel-1 | ||
Counterparty Channel ID: channel-36 | ||
Base Denom: uatom | ||
Decimals: 6 | ||
Display Name: ATOM | ||
--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: "[Token Registry] Add new IBC token to existing chain channel" | ||
about: "[Token Registry] Add a new IBC token to existing channel" | ||
title: '[Token Registry] Add ... token to ... counterparty chain ... on ... sifchain network' | ||
labels: 'Sifnode, Token Registry' | ||
assignees: '@sifnode' | ||
--- | ||
|
||
<!-- Please fill in issue title --> | ||
|
||
### Details? | ||
|
||
Sifchain Chain ID: | ||
Counterparty Chain ID: | ||
Base Denom: | ||
Decimals: | ||
Display Name: | ||
|
||
<!-- | ||
Example: | ||
Sifchain Chain ID: sifchain-devnet-1 | ||
Counterparty Chain ID: cosmoshub-4 | ||
Counterparty Base Denom: uatom | ||
Decimals: 6 | ||
Display Name: ATOM | ||
--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Dispensation Multiple Types | ||
## Concepts | ||
|
||
- We need the ability to add and remove dispensation types.The present design uses an enum for the types . | ||
|
||
- The plan is to replace this enum with a register , which can be controlled by an admin account or through a governance proposal . | ||
|
||
|
||
## Changes | ||
|
||
- All are checks for claimtype are stateless, we do validations by matching the string to the enum value, this would need to be changed to statefull changes , therefore can only be processed in checkTx and deliverTx , and not ValidateBasic.This will change the User Experience a bit becuase the user might not get error responses immediatly , would need to be checked though `raw_log` or `events` . | ||
|
||
> Example : This function called from `dispensation/client/tx.go` | ||
```go= | ||
func GetDistributionTypeFromShortString(distributionType string) (DistributionType, bool) { | ||
switch distributionType { | ||
case "Airdrop": | ||
return DistributionType_DISTRIBUTION_TYPE_AIRDROP, true | ||
case "LiquidityMining": | ||
return DistributionType_DISTRIBUTION_TYPE_LIQUIDITY_MINING, true | ||
case "ValidatorSubsidy": | ||
return DistributionType_DISTRIBUTION_TYPE_VALIDATOR_SUBSIDY, true | ||
default: | ||
return DistributionType_DISTRIBUTION_TYPE_UNSPECIFIED, false | ||
} | ||
} | ||
``` | ||
|
||
> Will change and be called from `dispensation/keeper/msg_server.go` | ||
```go= | ||
(func (keeper) GetClaimByType (ctx sdk.Context,claimType string) ClaimType {}).IsClaimable | ||
``` | ||
|
||
|
||
|
||
- Changes in validation logic in msg_server for | ||
```go= | ||
func (srv msgServer) CreateUserClaim(ctx context.Context, | ||
claim *types.MsgCreateUserClaim) (*types.MsgCreateClaimResponse, error) | ||
func (srv msgServer) CreateDistribution(ctx context.Context, | ||
msg *types.MsgCreateDistribution) (*types.MsgCreateDistributionResponse, error) | ||
``` | ||
|
||
- Changes in | ||
```go= | ||
func (k Keeper) DistributeDrops(ctx sdk.Context, height int64, distributionName string, authorizedRunner string, distributionType types.DistributionType) (*types.DistributionRecords, error) { | ||
if record.DoesTypeSupportClaim() {} | ||
} | ||
``` | ||
|
||
## State | ||
|
||
```go= | ||
type ClaimType struct { | ||
Type : string , | ||
IsClaimable : bool , | ||
IsActive : bool , | ||
} | ||
``` | ||
|
||
## State Transitions | ||
|
||
```go= | ||
func (keeper) SetNewClaimType(ctx sdk.Context,c Claimtype){} { | ||
// Can only be called by admin | ||
} | ||
``` | ||
|
||
## Helpers | ||
|
||
```go= | ||
func (keeper) IsClaimTypeActive (ctx sdk.Context,c Claimtype) bool {} | ||
func (keeper) IsClaimTypeClaimabale (ctx sdk.Context,c Claimtype) bool {} | ||
``` | ||
|
||
## Queries | ||
|
||
```go= | ||
func (keeper) GetAllClaimTypes(ctx sdk.Context)[]ClaimType {} | ||
func (keeper) GetClaimByType(ctx sdk.Context,claimtype string)ClaimType {} | ||
``` | ||
|
||
|
||
## Migrations | ||
|
||
- Claimtypes for Existing Distribution records would need to be modified, to use `ClaimType` struct instead of the enum. | ||
- Set Claimtypes in InitGenesis | ||
|
||
## Misc Questions | ||
|
||
- We use the same type for Claims and Distributions . It was called distributionType earlier . I am using ClaimType in this doc , but the name is debatable . I would prefer to use a more generic name if possible , and any suggestions for be great . | ||
|
||
- Should we test and move Distribute Records back to block ender / beginner . It would save a lot of the logistics we are dealing with , using the whole run distribution . The mechanism is used in other places in the module , and if tested properly should be doable . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
SIFCHAIN_ID=sifchain-1 \ | ||
KEYRING_BACKEND=test \ | ||
SIF_NODE=https://rpc.sifchain.finance:443 ./template/deregister-all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
SIFCHAIN_ID=sifchain-devnet-1 \ | ||
KEYRING_BACKEND=test \ | ||
SIF_NODE=https://rpc-devnet.sifchain.finance:443 ./template/deregister-all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
SIFCHAIN_ID=sifchain-testnet-1 \ | ||
KEYRING_BACKEND=test \ | ||
SIF_NODE=https://rpc-testnet.sifchain.finance:443 ./template/deregister-all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
SIFCHAIN_ID=sifchain-1 ./template/generate-all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
SIFCHAIN_ID=sifchain-devnet-1 ./template/generate-all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
SIFCHAIN_ID=sifchain-testnet-1 ./template/generate-all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.