mirror of
				https://github.com/0glabs/0g-chain.git
				synced 2025-11-04 09:17:28 +00:00 
			
		
		
		
	
						commit
						553d111f40
					
				@ -52,13 +52,16 @@ func TestAppAnteHandler_AuthorizedMempool(t *testing.T) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	tApp := app.TestApp{
 | 
						tApp := app.TestApp{
 | 
				
			||||||
		App: *app.NewApp(
 | 
							App: *app.NewApp(
 | 
				
			||||||
			log.NewNopLogger(),
 | 
					 | 
				
			||||||
			tmdb.NewMemDB(),
 | 
					 | 
				
			||||||
			chaincfg.DefaultNodeHome,
 | 
								chaincfg.DefaultNodeHome,
 | 
				
			||||||
			nil,
 | 
								nil,
 | 
				
			||||||
			encodingConfig,
 | 
								encodingConfig,
 | 
				
			||||||
			opts,
 | 
								opts,
 | 
				
			||||||
			baseapp.SetChainID(app.TestChainId),
 | 
								app.NewBaseApp(
 | 
				
			||||||
 | 
									log.NewNopLogger(),
 | 
				
			||||||
 | 
									tmdb.NewMemDB(),
 | 
				
			||||||
 | 
									encodingConfig,
 | 
				
			||||||
 | 
									baseapp.SetChainID(app.TestChainId),
 | 
				
			||||||
 | 
								),
 | 
				
			||||||
		),
 | 
							),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -267,7 +267,7 @@ type App struct {
 | 
				
			|||||||
	packetForwardKeeper   *packetforwardkeeper.Keeper
 | 
						packetForwardKeeper   *packetforwardkeeper.Keeper
 | 
				
			||||||
	evmKeeper             *evmkeeper.Keeper
 | 
						evmKeeper             *evmkeeper.Keeper
 | 
				
			||||||
	evmutilKeeper         evmutilkeeper.Keeper
 | 
						evmutilKeeper         evmutilkeeper.Keeper
 | 
				
			||||||
	feeMarketKeeper       feemarketkeeper.Keeper
 | 
						feeMarketKeeper       *feemarketkeeper.Keeper
 | 
				
			||||||
	upgradeKeeper         upgradekeeper.Keeper
 | 
						upgradeKeeper         upgradekeeper.Keeper
 | 
				
			||||||
	evidenceKeeper        evidencekeeper.Keeper
 | 
						evidenceKeeper        evidencekeeper.Keeper
 | 
				
			||||||
	transferKeeper        ibctransferkeeper.Keeper
 | 
						transferKeeper        ibctransferkeeper.Keeper
 | 
				
			||||||
@ -489,6 +489,7 @@ func NewApp(
 | 
				
			|||||||
		keys[feemarkettypes.StoreKey],
 | 
							keys[feemarkettypes.StoreKey],
 | 
				
			||||||
		tkeys[feemarkettypes.TransientKey],
 | 
							tkeys[feemarkettypes.TransientKey],
 | 
				
			||||||
		feemarketSubspace,
 | 
							feemarketSubspace,
 | 
				
			||||||
 | 
							bApp.Mempool(),
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	app.evmutilKeeper = evmutilkeeper.NewKeeper(
 | 
						app.evmutilKeeper = evmutilkeeper.NewKeeper(
 | 
				
			||||||
 | 
				
			|||||||
@ -28,19 +28,34 @@ import (
 | 
				
			|||||||
func TestNewApp(t *testing.T) {
 | 
					func TestNewApp(t *testing.T) {
 | 
				
			||||||
	chaincfg.SetSDKConfig()
 | 
						chaincfg.SetSDKConfig()
 | 
				
			||||||
	NewApp(
 | 
						NewApp(
 | 
				
			||||||
		log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
 | 
					 | 
				
			||||||
		db.NewMemDB(),
 | 
					 | 
				
			||||||
		chaincfg.DefaultNodeHome,
 | 
							chaincfg.DefaultNodeHome,
 | 
				
			||||||
		nil,
 | 
							nil,
 | 
				
			||||||
		MakeEncodingConfig(),
 | 
							MakeEncodingConfig(),
 | 
				
			||||||
		DefaultOptions,
 | 
							DefaultOptions,
 | 
				
			||||||
 | 
							NewBaseApp(
 | 
				
			||||||
 | 
								log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
 | 
				
			||||||
 | 
								db.NewMemDB(),
 | 
				
			||||||
 | 
								MakeEncodingConfig(),
 | 
				
			||||||
 | 
								baseapp.SetChainID(TestChainId),
 | 
				
			||||||
 | 
							),
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestExport(t *testing.T) {
 | 
					func TestExport(t *testing.T) {
 | 
				
			||||||
	chaincfg.SetSDKConfig()
 | 
						chaincfg.SetSDKConfig()
 | 
				
			||||||
	db := db.NewMemDB()
 | 
						db := db.NewMemDB()
 | 
				
			||||||
	app := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, chaincfg.DefaultNodeHome, nil, MakeEncodingConfig(), DefaultOptions, baseapp.SetChainID(TestChainId))
 | 
						app := NewApp(
 | 
				
			||||||
 | 
							chaincfg.DefaultNodeHome,
 | 
				
			||||||
 | 
							nil,
 | 
				
			||||||
 | 
							MakeEncodingConfig(),
 | 
				
			||||||
 | 
							DefaultOptions,
 | 
				
			||||||
 | 
							NewBaseApp(
 | 
				
			||||||
 | 
								log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
 | 
				
			||||||
 | 
								db,
 | 
				
			||||||
 | 
								MakeEncodingConfig(),
 | 
				
			||||||
 | 
								baseapp.SetChainID(TestChainId),
 | 
				
			||||||
 | 
							),
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	genesisState := GenesisStateWithSingleValidator(&TestApp{App: *app}, NewDefaultGenesisState())
 | 
						genesisState := GenesisStateWithSingleValidator(&TestApp{App: *app}, NewDefaultGenesisState())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -117,7 +117,7 @@ func (tApp TestApp) GetPriceFeedKeeper() pricefeedkeeper.Keeper     { return tAp
 | 
				
			|||||||
func (tApp TestApp) GetCommitteeKeeper() committeekeeper.Keeper     { return tApp.committeeKeeper }
 | 
					func (tApp TestApp) GetCommitteeKeeper() committeekeeper.Keeper     { return tApp.committeeKeeper }
 | 
				
			||||||
func (tApp TestApp) GetEvmutilKeeper() evmutilkeeper.Keeper         { return tApp.evmutilKeeper }
 | 
					func (tApp TestApp) GetEvmutilKeeper() evmutilkeeper.Keeper         { return tApp.evmutilKeeper }
 | 
				
			||||||
func (tApp TestApp) GetEvmKeeper() *evmkeeper.Keeper                { return tApp.evmKeeper }
 | 
					func (tApp TestApp) GetEvmKeeper() *evmkeeper.Keeper                { return tApp.evmKeeper }
 | 
				
			||||||
func (tApp TestApp) GetFeeMarketKeeper() feemarketkeeper.Keeper     { return tApp.feeMarketKeeper }
 | 
					func (tApp TestApp) GetFeeMarketKeeper() *feemarketkeeper.Keeper    { return tApp.feeMarketKeeper }
 | 
				
			||||||
func (tApp TestApp) GetDASignersKeeper() dasignerskeeper.Keeper     { return tApp.dasignersKeeper }
 | 
					func (tApp TestApp) GetDASignersKeeper() dasignerskeeper.Keeper     { return tApp.dasignersKeeper }
 | 
				
			||||||
func (tApp TestApp) GetPrecisebankKeeper() precisebankkeeper.Keeper { return tApp.precisebankKeeper }
 | 
					func (tApp TestApp) GetPrecisebankKeeper() precisebankkeeper.Keeper { return tApp.precisebankKeeper }
 | 
				
			||||||
func (tApp TestApp) GetWrappedA0GIBaseKeeper() wrappeda0gibasekeeper.Keeper {
 | 
					func (tApp TestApp) GetWrappedA0GIBaseKeeper() wrappeda0gibasekeeper.Keeper {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,434 +1 @@
 | 
				
			|||||||
package app_test
 | 
					package app_test
 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"strconv"
 | 
					 | 
				
			||||||
	"testing"
 | 
					 | 
				
			||||||
	"time"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	sdkmath "cosmossdk.io/math"
 | 
					 | 
				
			||||||
	"github.com/0glabs/0g-chain/app"
 | 
					 | 
				
			||||||
	evmutiltypes "github.com/0glabs/0g-chain/x/evmutil/types"
 | 
					 | 
				
			||||||
	precisebankkeeper "github.com/0glabs/0g-chain/x/precisebank/keeper"
 | 
					 | 
				
			||||||
	precisebanktypes "github.com/0glabs/0g-chain/x/precisebank/types"
 | 
					 | 
				
			||||||
	tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
 | 
					 | 
				
			||||||
	sdk "github.com/cosmos/cosmos-sdk/types"
 | 
					 | 
				
			||||||
	"github.com/stretchr/testify/require"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestMigrateEvmutilToPrecisebank(t *testing.T) {
 | 
					 | 
				
			||||||
	// Full test case with all components together
 | 
					 | 
				
			||||||
	tests := []struct {
 | 
					 | 
				
			||||||
		name               string
 | 
					 | 
				
			||||||
		initialReserve     sdkmath.Int
 | 
					 | 
				
			||||||
		fractionalBalances []sdkmath.Int
 | 
					 | 
				
			||||||
	}{
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"no fractional balances",
 | 
					 | 
				
			||||||
			sdkmath.NewInt(0),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"sufficient reserve, 0 remainder",
 | 
					 | 
				
			||||||
			// Accounts adding up to 2 int units, same as reserve
 | 
					 | 
				
			||||||
			sdkmath.NewInt(2),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"insufficient reserve, 0 remainder",
 | 
					 | 
				
			||||||
			// Accounts adding up to 2 int units, but only 1 int unit in reserve
 | 
					 | 
				
			||||||
			sdkmath.NewInt(1),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"excess reserve, 0 remainder",
 | 
					 | 
				
			||||||
			// Accounts adding up to 2 int units, but 3 int unit in reserve
 | 
					 | 
				
			||||||
			sdkmath.NewInt(3),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"sufficient reserve, non-zero remainder",
 | 
					 | 
				
			||||||
			// Accounts adding up to 1.5 int units, same as reserve
 | 
					 | 
				
			||||||
			sdkmath.NewInt(2),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"insufficient reserve, non-zero remainder",
 | 
					 | 
				
			||||||
			// Accounts adding up to 1.5 int units, less than reserve,
 | 
					 | 
				
			||||||
			// Reserve should be 2 and remainder 0.5
 | 
					 | 
				
			||||||
			sdkmath.NewInt(1),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"excess reserve, non-zero remainder",
 | 
					 | 
				
			||||||
			// Accounts adding up to 1.5 int units, 3 int units in reserve
 | 
					 | 
				
			||||||
			sdkmath.NewInt(3),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, tt := range tests {
 | 
					 | 
				
			||||||
		t.Run(tt.name, func(t *testing.T) {
 | 
					 | 
				
			||||||
			tApp := app.NewTestApp()
 | 
					 | 
				
			||||||
			tApp.InitializeFromGenesisStates()
 | 
					 | 
				
			||||||
			ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: time.Now()})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			ak := tApp.GetAccountKeeper()
 | 
					 | 
				
			||||||
			bk := tApp.GetBankKeeper()
 | 
					 | 
				
			||||||
			evmuk := tApp.GetEvmutilKeeper()
 | 
					 | 
				
			||||||
			pbk := tApp.GetPrecisebankKeeper()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			reserveCoin := sdk.NewCoin(precisebanktypes.IntegerCoinDenom, tt.initialReserve)
 | 
					 | 
				
			||||||
			err := bk.MintCoins(ctx, evmutiltypes.ModuleName, sdk.NewCoins(reserveCoin))
 | 
					 | 
				
			||||||
			require.NoError(t, err)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			oldReserveAddr := tApp.GetAccountKeeper().GetModuleAddress(evmutiltypes.ModuleName)
 | 
					 | 
				
			||||||
			newReserveAddr := tApp.GetAccountKeeper().GetModuleAddress(precisebanktypes.ModuleName)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Double check balances
 | 
					 | 
				
			||||||
			oldReserveBalance := bk.GetBalance(ctx, oldReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
			newReserveBalance := bk.GetBalance(ctx, newReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			require.Equal(t, tt.initialReserve, oldReserveBalance.Amount, "initial x/evmutil reserve balance")
 | 
					 | 
				
			||||||
			require.True(t, newReserveBalance.IsZero(), "empty initial new reserve")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Set accounts
 | 
					 | 
				
			||||||
			for i, balance := range tt.fractionalBalances {
 | 
					 | 
				
			||||||
				addr := sdk.AccAddress([]byte(strconv.Itoa(i)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				err := evmuk.SetBalance(ctx, addr, balance)
 | 
					 | 
				
			||||||
				require.NoError(t, err)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Run full x/evmutil -> x/precisebank migration
 | 
					 | 
				
			||||||
			err = app.MigrateEvmutilToPrecisebank(
 | 
					 | 
				
			||||||
				ctx,
 | 
					 | 
				
			||||||
				ak,
 | 
					 | 
				
			||||||
				bk,
 | 
					 | 
				
			||||||
				evmuk,
 | 
					 | 
				
			||||||
				pbk,
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
			require.NoError(t, err)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check old reserve is empty
 | 
					 | 
				
			||||||
			oldReserveBalanceAfter := bk.GetBalance(ctx, oldReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
			require.True(t, oldReserveBalanceAfter.IsZero(), "old reserve should be empty")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check new reserve fully backs fractional balances
 | 
					 | 
				
			||||||
			newReserveBalanceAfter := bk.GetBalance(ctx, newReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
			fractionalBalanceTotal := pbk.GetTotalSumFractionalBalances(ctx)
 | 
					 | 
				
			||||||
			remainder := pbk.GetRemainderAmount(ctx)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			expectedReserveBal := fractionalBalanceTotal.Add(remainder)
 | 
					 | 
				
			||||||
			require.Equal(
 | 
					 | 
				
			||||||
				t,
 | 
					 | 
				
			||||||
				expectedReserveBal,
 | 
					 | 
				
			||||||
				newReserveBalanceAfter.Amount.Mul(precisebanktypes.ConversionFactor()),
 | 
					 | 
				
			||||||
				"new reserve should equal total fractional balances",
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check balances are deleted in evmutil and migrated to precisebank
 | 
					 | 
				
			||||||
			for i := range tt.fractionalBalances {
 | 
					 | 
				
			||||||
				addr := sdk.AccAddress([]byte(strconv.Itoa(i)))
 | 
					 | 
				
			||||||
				acc := evmuk.GetAccount(ctx, addr)
 | 
					 | 
				
			||||||
				require.Nil(t, acc, "account should be deleted")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				balance := pbk.GetFractionalBalance(ctx, addr)
 | 
					 | 
				
			||||||
				require.Equal(t, tt.fractionalBalances[i], balance, "balance should be migrated")
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Checks balances valid and remainder
 | 
					 | 
				
			||||||
			res, stop := precisebankkeeper.AllInvariants(pbk)(ctx)
 | 
					 | 
				
			||||||
			require.Falsef(t, stop, "invariants should pass: %s", res)
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestTransferFractionalBalances(t *testing.T) {
 | 
					 | 
				
			||||||
	tests := []struct {
 | 
					 | 
				
			||||||
		name               string
 | 
					 | 
				
			||||||
		fractionalBalances []sdkmath.Int
 | 
					 | 
				
			||||||
	}{
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"no fractional balances",
 | 
					 | 
				
			||||||
			[]sdkmath.Int{},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"balanced fractional balances",
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 4 accounts
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"unbalanced balances",
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 3 accounts
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, tt := range tests {
 | 
					 | 
				
			||||||
		t.Run(tt.name, func(t *testing.T) {
 | 
					 | 
				
			||||||
			tApp := app.NewTestApp()
 | 
					 | 
				
			||||||
			tApp.InitializeFromGenesisStates()
 | 
					 | 
				
			||||||
			ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: time.Now()})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			evmutilk := tApp.GetEvmutilKeeper()
 | 
					 | 
				
			||||||
			pbk := tApp.GetPrecisebankKeeper()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			for i, balance := range tt.fractionalBalances {
 | 
					 | 
				
			||||||
				addr := sdk.AccAddress([]byte(strconv.Itoa(i)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				err := evmutilk.SetBalance(ctx, addr, balance)
 | 
					 | 
				
			||||||
				require.NoError(t, err)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Run balance transfer
 | 
					 | 
				
			||||||
			aggregateSum, err := app.TransferFractionalBalances(
 | 
					 | 
				
			||||||
				ctx,
 | 
					 | 
				
			||||||
				evmutilk,
 | 
					 | 
				
			||||||
				pbk,
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
			require.NoError(t, err)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check balances are deleted in evmutil and migrated to precisebank
 | 
					 | 
				
			||||||
			sum := sdkmath.ZeroInt()
 | 
					 | 
				
			||||||
			for i := range tt.fractionalBalances {
 | 
					 | 
				
			||||||
				sum = sum.Add(tt.fractionalBalances[i])
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				addr := sdk.AccAddress([]byte(strconv.Itoa(i)))
 | 
					 | 
				
			||||||
				acc := evmutilk.GetAccount(ctx, addr)
 | 
					 | 
				
			||||||
				require.Nil(t, acc, "account should be deleted")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				balance := pbk.GetFractionalBalance(ctx, addr)
 | 
					 | 
				
			||||||
				require.Equal(t, tt.fractionalBalances[i], balance, "balance should be migrated")
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			require.Equal(t, sum, aggregateSum, "aggregate sum should be correct")
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestInitializeRemainder(t *testing.T) {
 | 
					 | 
				
			||||||
	tests := []struct {
 | 
					 | 
				
			||||||
		name             string
 | 
					 | 
				
			||||||
		giveAggregateSum sdkmath.Int
 | 
					 | 
				
			||||||
		wantRemainder    sdkmath.Int
 | 
					 | 
				
			||||||
	}{
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"0 remainder, 1ukava",
 | 
					 | 
				
			||||||
			precisebanktypes.ConversionFactor(),
 | 
					 | 
				
			||||||
			sdkmath.NewInt(0),
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"0 remainder, multiple ukava",
 | 
					 | 
				
			||||||
			precisebanktypes.ConversionFactor().MulRaw(5),
 | 
					 | 
				
			||||||
			sdkmath.NewInt(0),
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"non-zero remainder, min",
 | 
					 | 
				
			||||||
			precisebanktypes.ConversionFactor().SubRaw(1),
 | 
					 | 
				
			||||||
			sdkmath.NewInt(1),
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"non-zero remainder, max",
 | 
					 | 
				
			||||||
			sdkmath.NewInt(1),
 | 
					 | 
				
			||||||
			precisebanktypes.ConversionFactor().SubRaw(1),
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"non-zero remainder, half",
 | 
					 | 
				
			||||||
			precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, tt := range tests {
 | 
					 | 
				
			||||||
		t.Run(tt.name, func(t *testing.T) {
 | 
					 | 
				
			||||||
			tApp := app.NewTestApp()
 | 
					 | 
				
			||||||
			tApp.InitializeFromGenesisStates()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			pbk := tApp.GetPrecisebankKeeper()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: time.Now()})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			remainder := app.InitializeRemainder(
 | 
					 | 
				
			||||||
				ctx,
 | 
					 | 
				
			||||||
				tApp.GetPrecisebankKeeper(),
 | 
					 | 
				
			||||||
				tt.giveAggregateSum,
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
			require.Equal(t, tt.wantRemainder, remainder)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check actual state
 | 
					 | 
				
			||||||
			remainderAfter := pbk.GetRemainderAmount(ctx)
 | 
					 | 
				
			||||||
			require.Equal(t, tt.wantRemainder, remainderAfter)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Not checking invariants here since it requires actual balance state
 | 
					 | 
				
			||||||
			aggregateSumWithRemainder := tt.giveAggregateSum.Add(remainder)
 | 
					 | 
				
			||||||
			require.True(
 | 
					 | 
				
			||||||
				t,
 | 
					 | 
				
			||||||
				aggregateSumWithRemainder.
 | 
					 | 
				
			||||||
					Mod(precisebanktypes.ConversionFactor()).
 | 
					 | 
				
			||||||
					IsZero(),
 | 
					 | 
				
			||||||
				"remainder + aggregate sum should be a multiple of the conversion factor",
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestTransferFractionalBalanceReserve(t *testing.T) {
 | 
					 | 
				
			||||||
	tests := []struct {
 | 
					 | 
				
			||||||
		name               string
 | 
					 | 
				
			||||||
		initialReserve     sdk.Coin
 | 
					 | 
				
			||||||
		fractionalBalances []sdkmath.Int
 | 
					 | 
				
			||||||
	}{
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"balanced reserve, no remainder",
 | 
					 | 
				
			||||||
			sdk.NewCoin(precisebanktypes.IntegerCoinDenom, sdk.NewInt(1)),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 2 accounts
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"insufficient reserve",
 | 
					 | 
				
			||||||
			sdk.NewCoin(precisebanktypes.IntegerCoinDenom, sdk.NewInt(1)),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 4 accounts, total 2 int units
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"extra reserve funds",
 | 
					 | 
				
			||||||
			sdk.NewCoin(precisebanktypes.IntegerCoinDenom, sdk.NewInt(2)),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 2 accounts, total 1 int units
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"insufficient reserve, with remainder",
 | 
					 | 
				
			||||||
			sdk.NewCoin(precisebanktypes.IntegerCoinDenom, sdk.NewInt(1)),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 5 accounts, total 2.5 int units
 | 
					 | 
				
			||||||
				// Expected 3 int units in reserve, 0.5 remainder
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"extra reserve funds, with remainder",
 | 
					 | 
				
			||||||
			sdk.NewCoin(precisebanktypes.IntegerCoinDenom, sdk.NewInt(3)),
 | 
					 | 
				
			||||||
			[]sdkmath.Int{
 | 
					 | 
				
			||||||
				// 3 accounts, total 1.5 int units.
 | 
					 | 
				
			||||||
				// Expected 2 int units in reserve, 0.5 remainder
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
				precisebanktypes.ConversionFactor().QuoRaw(2),
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, tt := range tests {
 | 
					 | 
				
			||||||
		t.Run(tt.name, func(t *testing.T) {
 | 
					 | 
				
			||||||
			tApp := app.NewTestApp()
 | 
					 | 
				
			||||||
			tApp.InitializeFromGenesisStates()
 | 
					 | 
				
			||||||
			ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: time.Now()})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			bk := tApp.GetBankKeeper()
 | 
					 | 
				
			||||||
			pbk := tApp.GetPrecisebankKeeper()
 | 
					 | 
				
			||||||
			err := bk.MintCoins(ctx, evmutiltypes.ModuleName, sdk.NewCoins(tt.initialReserve))
 | 
					 | 
				
			||||||
			require.NoError(t, err)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			oldReserveAddr := tApp.GetAccountKeeper().GetModuleAddress(evmutiltypes.ModuleName)
 | 
					 | 
				
			||||||
			newReserveAddr := tApp.GetAccountKeeper().GetModuleAddress(precisebanktypes.ModuleName)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Double check balances
 | 
					 | 
				
			||||||
			oldReserveBalance := bk.GetBalance(ctx, oldReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
			newReserveBalance := bk.GetBalance(ctx, newReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			require.Equal(t, tt.initialReserve, oldReserveBalance)
 | 
					 | 
				
			||||||
			require.True(t, newReserveBalance.IsZero(), "empty initial new reserve")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			for i, balance := range tt.fractionalBalances {
 | 
					 | 
				
			||||||
				addr := sdk.AccAddress([]byte{byte(i)})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				require.NotPanics(t, func() {
 | 
					 | 
				
			||||||
					pbk.SetFractionalBalance(ctx, addr, balance)
 | 
					 | 
				
			||||||
				}, "given fractional balances should be valid")
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Run reserve migration
 | 
					 | 
				
			||||||
			err = app.TransferFractionalBalanceReserve(
 | 
					 | 
				
			||||||
				ctx,
 | 
					 | 
				
			||||||
				tApp.GetAccountKeeper(),
 | 
					 | 
				
			||||||
				bk,
 | 
					 | 
				
			||||||
				tApp.GetPrecisebankKeeper(),
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
			require.NoError(t, err)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check old reserve is empty
 | 
					 | 
				
			||||||
			oldReserveBalanceAfter := bk.GetBalance(ctx, oldReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
			require.True(t, oldReserveBalanceAfter.IsZero(), "old reserve should be empty")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check new reserve fully backs fractional balances
 | 
					 | 
				
			||||||
			newReserveBalanceAfter := bk.GetBalance(ctx, newReserveAddr, precisebanktypes.IntegerCoinDenom)
 | 
					 | 
				
			||||||
			fractionalBalanceTotal := pbk.GetTotalSumFractionalBalances(ctx)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			expectedReserveBal := fractionalBalanceTotal.
 | 
					 | 
				
			||||||
				Quo(precisebanktypes.ConversionFactor())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Check if theres a remainder
 | 
					 | 
				
			||||||
			if fractionalBalanceTotal.Mod(precisebanktypes.ConversionFactor()).IsPositive() {
 | 
					 | 
				
			||||||
				expectedReserveBal = expectedReserveBal.Add(sdkmath.OneInt())
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			require.Equal(
 | 
					 | 
				
			||||||
				t,
 | 
					 | 
				
			||||||
				expectedReserveBal,
 | 
					 | 
				
			||||||
				newReserveBalanceAfter.Amount,
 | 
					 | 
				
			||||||
				"new reserve should equal total fractional balances + remainder",
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							@ -250,7 +250,7 @@ replace (
 | 
				
			|||||||
	// TODO: Tag before release
 | 
						// TODO: Tag before release
 | 
				
			||||||
	github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc2
 | 
						github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc2
 | 
				
			||||||
	// Use ethermint fork that respects min-gas-price with NoBaseFee true and london enabled, and includes eip712 support
 | 
						// Use ethermint fork that respects min-gas-price with NoBaseFee true and london enabled, and includes eip712 support
 | 
				
			||||||
	github.com/evmos/ethermint => github.com/0glabs/ethermint v0.21.0-0g.v3.1.9
 | 
						github.com/evmos/ethermint => github.com/0glabs/ethermint v0.21.0-0g.v3.1.12
 | 
				
			||||||
	// See https://github.com/cosmos/cosmos-sdk/pull/10401, https://github.com/cosmos/cosmos-sdk/commit/0592ba6158cd0bf49d894be1cef4faeec59e8320
 | 
						// See https://github.com/cosmos/cosmos-sdk/pull/10401, https://github.com/cosmos/cosmos-sdk/commit/0592ba6158cd0bf49d894be1cef4faeec59e8320
 | 
				
			||||||
	github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
 | 
						github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
 | 
				
			||||||
	// Downgraded to avoid bugs in following commits which causes "version does not exist" errors
 | 
						// Downgraded to avoid bugs in following commits which causes "version does not exist" errors
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								go.sum
									
									
									
									
									
								
							@ -213,8 +213,8 @@ github.com/0glabs/cometbft v0.37.9-0glabs.1 h1:KQJG17Y21suKP3QNICLto4b5Ak73XbSmK
 | 
				
			|||||||
github.com/0glabs/cometbft v0.37.9-0glabs.1/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I=
 | 
					github.com/0glabs/cometbft v0.37.9-0glabs.1/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I=
 | 
				
			||||||
github.com/0glabs/cosmos-sdk v0.47.10-0glabs.10 h1:NJp0RwczHBO4EvrQdDxxftHOgUDBtNh7M/vpaG7wFtQ=
 | 
					github.com/0glabs/cosmos-sdk v0.47.10-0glabs.10 h1:NJp0RwczHBO4EvrQdDxxftHOgUDBtNh7M/vpaG7wFtQ=
 | 
				
			||||||
github.com/0glabs/cosmos-sdk v0.47.10-0glabs.10/go.mod h1:KskIVnhXTFqrw7CDccMvx7To5KzUsOomIsQV7sPGOog=
 | 
					github.com/0glabs/cosmos-sdk v0.47.10-0glabs.10/go.mod h1:KskIVnhXTFqrw7CDccMvx7To5KzUsOomIsQV7sPGOog=
 | 
				
			||||||
github.com/0glabs/ethermint v0.21.0-0g.v3.1.9 h1:oTHp7tSAqoML7D/+RXsBzA9DsbZ80MX93VJYjR/Akh4=
 | 
					github.com/0glabs/ethermint v0.21.0-0g.v3.1.12 h1:IRVTFhDEH2J5w8ywQW7obXQxYhJYib70SNgKqLOXikU=
 | 
				
			||||||
github.com/0glabs/ethermint v0.21.0-0g.v3.1.9/go.mod h1:6e/gOcDLhvlDWK3JLJVBgki0gD6H4E1eG7l9byocgWA=
 | 
					github.com/0glabs/ethermint v0.21.0-0g.v3.1.12/go.mod h1:6e/gOcDLhvlDWK3JLJVBgki0gD6H4E1eG7l9byocgWA=
 | 
				
			||||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
 | 
					github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
 | 
				
			||||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
 | 
					github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
 | 
				
			||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
 | 
					github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,8 @@ pragma solidity >=0.8.0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
struct Supply {
 | 
					struct Supply {
 | 
				
			||||||
    uint256 cap;
 | 
					    uint256 cap;
 | 
				
			||||||
    uint256 total;
 | 
					    uint256 initialSupply;
 | 
				
			||||||
 | 
					    uint256 supply;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -23,12 +24,13 @@ interface IWrappedA0GIBase {
 | 
				
			|||||||
    function getWA0GI() external view returns (address);
 | 
					    function getWA0GI() external view returns (address);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @dev set the cap for a minter.
 | 
					     * @dev set the cap and initial supply for a minter.
 | 
				
			||||||
     * It is designed to be called by governance module only so it's not implemented at EVM precompile side.
 | 
					     * It is designed to be called by governance module only so it's not implemented at EVM precompile side.
 | 
				
			||||||
     * @param minter minter address
 | 
					     * @param minter minter address
 | 
				
			||||||
     * @param cap mint cap
 | 
					     * @param cap mint cap
 | 
				
			||||||
 | 
					     * @param initialSupply initial mint supply
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    // function setMinterCap(address minter, uint256 cap) external;
 | 
					    // function setMinterCap(address minter, uint256 cap, uint256 initialSupply) external;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @dev get the mint supply of given address
 | 
					     * @dev get the mint supply of given address
 | 
				
			||||||
 | 
				
			|||||||
@ -67,7 +67,12 @@
 | 
				
			|||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            "internalType": "uint256",
 | 
					            "internalType": "uint256",
 | 
				
			||||||
            "name": "total",
 | 
					            "name": "initialSupply",
 | 
				
			||||||
 | 
					            "type": "uint256"
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            "internalType": "uint256",
 | 
				
			||||||
 | 
					            "name": "supply",
 | 
				
			||||||
            "type": "uint256"
 | 
					            "type": "uint256"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
 | 
				
			|||||||
@ -30,7 +30,7 @@ var (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Wrappeda0gibaseMetaData contains all meta data concerning the Wrappeda0gibase contract.
 | 
					// Wrappeda0gibaseMetaData contains all meta data concerning the Wrappeda0gibase contract.
 | 
				
			||||||
var Wrappeda0gibaseMetaData = &bind.MetaData{
 | 
					var Wrappeda0gibaseMetaData = &bind.MetaData{
 | 
				
			||||||
	ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
 | 
						ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Wrappeda0gibaseABI is the input ABI used to generate the binding from.
 | 
					// Wrappeda0gibaseABI is the input ABI used to generate the binding from.
 | 
				
			||||||
@ -212,7 +212,7 @@ func (_Wrappeda0gibase *Wrappeda0gibaseCallerSession) GetWA0GI() (common.Address
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// MinterSupply is a free data retrieval call binding the contract method 0x95609212.
 | 
					// MinterSupply is a free data retrieval call binding the contract method 0x95609212.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Solidity: function minterSupply(address minter) view returns((uint256,uint256))
 | 
					// Solidity: function minterSupply(address minter) view returns((uint256,uint256,uint256))
 | 
				
			||||||
func (_Wrappeda0gibase *Wrappeda0gibaseCaller) MinterSupply(opts *bind.CallOpts, minter common.Address) (Supply, error) {
 | 
					func (_Wrappeda0gibase *Wrappeda0gibaseCaller) MinterSupply(opts *bind.CallOpts, minter common.Address) (Supply, error) {
 | 
				
			||||||
	var out []interface{}
 | 
						var out []interface{}
 | 
				
			||||||
	err := _Wrappeda0gibase.contract.Call(opts, &out, "minterSupply", minter)
 | 
						err := _Wrappeda0gibase.contract.Call(opts, &out, "minterSupply", minter)
 | 
				
			||||||
@ -229,14 +229,14 @@ func (_Wrappeda0gibase *Wrappeda0gibaseCaller) MinterSupply(opts *bind.CallOpts,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// MinterSupply is a free data retrieval call binding the contract method 0x95609212.
 | 
					// MinterSupply is a free data retrieval call binding the contract method 0x95609212.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Solidity: function minterSupply(address minter) view returns((uint256,uint256))
 | 
					// Solidity: function minterSupply(address minter) view returns((uint256,uint256,uint256))
 | 
				
			||||||
func (_Wrappeda0gibase *Wrappeda0gibaseSession) MinterSupply(minter common.Address) (Supply, error) {
 | 
					func (_Wrappeda0gibase *Wrappeda0gibaseSession) MinterSupply(minter common.Address) (Supply, error) {
 | 
				
			||||||
	return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter)
 | 
						return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// MinterSupply is a free data retrieval call binding the contract method 0x95609212.
 | 
					// MinterSupply is a free data retrieval call binding the contract method 0x95609212.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Solidity: function minterSupply(address minter) view returns((uint256,uint256))
 | 
					// Solidity: function minterSupply(address minter) view returns((uint256,uint256,uint256))
 | 
				
			||||||
func (_Wrappeda0gibase *Wrappeda0gibaseCallerSession) MinterSupply(minter common.Address) (Supply, error) {
 | 
					func (_Wrappeda0gibase *Wrappeda0gibaseCallerSession) MinterSupply(minter common.Address) (Supply, error) {
 | 
				
			||||||
	return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter)
 | 
						return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -31,8 +31,9 @@ func (w *WrappedA0giBasePrecompile) MinterSupply(ctx sdk.Context, _ *vm.EVM, met
 | 
				
			|||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	supply := Supply{
 | 
						supply := Supply{
 | 
				
			||||||
		Cap:   new(big.Int).SetBytes(response.Cap),
 | 
							Cap:           new(big.Int).SetBytes(response.Supply.Cap),
 | 
				
			||||||
		Total: new(big.Int).SetBytes(response.Supply),
 | 
							InitialSupply: new(big.Int).SetBytes(response.Supply.InitialSupply),
 | 
				
			||||||
 | 
							Supply:        new(big.Int).SetBytes(response.Supply.Supply),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return method.Outputs.Pack(supply)
 | 
						return method.Outputs.Pack(supply)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -85,9 +85,10 @@ func (s *WrappedA0giBaseTestSuite) TestMinterSupply() {
 | 
				
			|||||||
			func(data []byte) {
 | 
								func(data []byte) {
 | 
				
			||||||
				out, err := s.abi.Methods[method].Outputs.Unpack(data)
 | 
									out, err := s.abi.Methods[method].Outputs.Unpack(data)
 | 
				
			||||||
				s.Require().NoError(err, "failed to unpack output")
 | 
									s.Require().NoError(err, "failed to unpack output")
 | 
				
			||||||
				wa0gi := out[0].(wrappeda0gibaseprecompile.Supply)
 | 
									supply := out[0].(wrappeda0gibaseprecompile.Supply)
 | 
				
			||||||
				s.Require().Equal(wa0gi.Cap, big.NewInt(8e18))
 | 
									s.Require().Equal(supply.Cap, big.NewInt(8e18))
 | 
				
			||||||
				s.Require().Equal(wa0gi.Total, big.NewInt(1e18))
 | 
									s.Require().Equal(supply.InitialSupply, big.NewInt(4e18))
 | 
				
			||||||
 | 
									s.Require().Equal(supply.Supply, big.NewInt(4e18+1e18))
 | 
				
			||||||
				// fmt.Println(wa0gi)
 | 
									// fmt.Println(wa0gi)
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			100000,
 | 
								100000,
 | 
				
			||||||
@ -108,7 +109,8 @@ func (s *WrappedA0giBaseTestSuite) TestMinterSupply() {
 | 
				
			|||||||
				s.Require().NoError(err, "failed to unpack output")
 | 
									s.Require().NoError(err, "failed to unpack output")
 | 
				
			||||||
				supply := out[0].(wrappeda0gibaseprecompile.Supply)
 | 
									supply := out[0].(wrappeda0gibaseprecompile.Supply)
 | 
				
			||||||
				s.Require().Equal(supply.Cap.Bytes(), big.NewInt(0).Bytes())
 | 
									s.Require().Equal(supply.Cap.Bytes(), big.NewInt(0).Bytes())
 | 
				
			||||||
				s.Require().Equal(supply.Total.Bytes(), big.NewInt(0).Bytes())
 | 
									s.Require().Equal(supply.InitialSupply.Bytes(), big.NewInt(0).Bytes())
 | 
				
			||||||
 | 
									s.Require().Equal(supply.Supply.Bytes(), big.NewInt(0).Bytes())
 | 
				
			||||||
				// fmt.Println(wa0gi)
 | 
									// fmt.Println(wa0gi)
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			100000,
 | 
								100000,
 | 
				
			||||||
@ -122,9 +124,10 @@ func (s *WrappedA0giBaseTestSuite) TestMinterSupply() {
 | 
				
			|||||||
			s.SetupTest()
 | 
								s.SetupTest()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			s.wa0gibasekeeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
								s.wa0gibasekeeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
				Authority: govAccAddr,
 | 
									Authority:     govAccAddr,
 | 
				
			||||||
				Minter:    s.signerOne.Addr.Bytes(),
 | 
									Minter:        s.signerOne.Addr.Bytes(),
 | 
				
			||||||
				Cap:       big.NewInt(8e18).Bytes(),
 | 
									Cap:           big.NewInt(8e18).Bytes(),
 | 
				
			||||||
 | 
									InitialSupply: big.NewInt(4e18).Bytes(),
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			s.wa0gibasekeeper.Mint(sdk.WrapSDKContext(s.Ctx), &types.MsgMint{
 | 
								s.wa0gibasekeeper.Mint(sdk.WrapSDKContext(s.Ctx), &types.MsgMint{
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,6 @@
 | 
				
			|||||||
package wrappeda0gibase_test
 | 
					package wrappeda0gibase_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
	"math/big"
 | 
						"math/big"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wrappeda0gibaseprecompile "github.com/0glabs/0g-chain/precompiles/wrapped-a0gi-base"
 | 
						wrappeda0gibaseprecompile "github.com/0glabs/0g-chain/precompiles/wrapped-a0gi-base"
 | 
				
			||||||
@ -38,8 +37,9 @@ func (s *WrappedA0giBaseTestSuite) TestMint() {
 | 
				
			|||||||
					Address: s.signerOne.Addr.Bytes(),
 | 
										Address: s.signerOne.Addr.Bytes(),
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				s.Assert().NoError(err)
 | 
									s.Assert().NoError(err)
 | 
				
			||||||
				s.Require().Equal(supply.Cap, big.NewInt(8e18).Bytes())
 | 
									s.Require().Equal(supply.Supply.Cap, big.NewInt(8e18).Bytes())
 | 
				
			||||||
				s.Require().Equal(supply.Supply, big.NewInt(1e18).Bytes())
 | 
									s.Require().Equal(supply.Supply.InitialSupply, big.NewInt(4e18).Bytes())
 | 
				
			||||||
 | 
									s.Require().Equal(supply.Supply.Supply, big.NewInt(4e18+1e18).Bytes())
 | 
				
			||||||
				// fmt.Println(wa0gi)
 | 
									// fmt.Println(wa0gi)
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			100000,
 | 
								100000,
 | 
				
			||||||
@ -85,12 +85,12 @@ func (s *WrappedA0giBaseTestSuite) TestMint() {
 | 
				
			|||||||
		s.Run(tc.name, func() {
 | 
							s.Run(tc.name, func() {
 | 
				
			||||||
			s.SetupTest()
 | 
								s.SetupTest()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			fmt.Println(s.signerOne.Addr)
 | 
					 | 
				
			||||||
			s.wa0gibasekeeper.SetWA0GIAddress(s.Ctx, s.signerOne.Addr)
 | 
								s.wa0gibasekeeper.SetWA0GIAddress(s.Ctx, s.signerOne.Addr)
 | 
				
			||||||
			s.wa0gibasekeeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
								s.wa0gibasekeeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
				Authority: govAccAddr,
 | 
									Authority:     govAccAddr,
 | 
				
			||||||
				Minter:    s.signerOne.Addr.Bytes(),
 | 
									Minter:        s.signerOne.Addr.Bytes(),
 | 
				
			||||||
				Cap:       big.NewInt(8e18).Bytes(),
 | 
									Cap:           big.NewInt(8e18).Bytes(),
 | 
				
			||||||
 | 
									InitialSupply: big.NewInt(4e18).Bytes(),
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			var err error
 | 
								var err error
 | 
				
			||||||
@ -140,8 +140,9 @@ func (s *WrappedA0giBaseTestSuite) TestBurn() {
 | 
				
			|||||||
					Address: s.signerOne.Addr.Bytes(),
 | 
										Address: s.signerOne.Addr.Bytes(),
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				s.Assert().NoError(err)
 | 
									s.Assert().NoError(err)
 | 
				
			||||||
				s.Require().Equal(supply.Cap, big.NewInt(8e18).Bytes())
 | 
									s.Require().Equal(supply.Supply.Cap, big.NewInt(8e18).Bytes())
 | 
				
			||||||
				s.Require().Equal(supply.Supply, big.NewInt(3e18).Bytes())
 | 
									s.Require().Equal(supply.Supply.InitialSupply, big.NewInt(4e18).Bytes())
 | 
				
			||||||
 | 
									s.Require().Equal(supply.Supply.Supply, big.NewInt(3e18).Bytes())
 | 
				
			||||||
				// fmt.Println(wa0gi)
 | 
									// fmt.Println(wa0gi)
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			100000,
 | 
								100000,
 | 
				
			||||||
@ -187,16 +188,12 @@ func (s *WrappedA0giBaseTestSuite) TestBurn() {
 | 
				
			|||||||
		s.Run(tc.name, func() {
 | 
							s.Run(tc.name, func() {
 | 
				
			||||||
			s.SetupTest()
 | 
								s.SetupTest()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			fmt.Println(s.signerOne.Addr)
 | 
					 | 
				
			||||||
			s.wa0gibasekeeper.SetWA0GIAddress(s.Ctx, s.signerOne.Addr)
 | 
								s.wa0gibasekeeper.SetWA0GIAddress(s.Ctx, s.signerOne.Addr)
 | 
				
			||||||
			s.wa0gibasekeeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
								s.wa0gibasekeeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
				Authority: govAccAddr,
 | 
									Authority:     govAccAddr,
 | 
				
			||||||
				Minter:    s.signerOne.Addr.Bytes(),
 | 
									Minter:        s.signerOne.Addr.Bytes(),
 | 
				
			||||||
				Cap:       big.NewInt(8e18).Bytes(),
 | 
									Cap:           big.NewInt(8e18).Bytes(),
 | 
				
			||||||
			})
 | 
									InitialSupply: big.NewInt(4e18).Bytes(),
 | 
				
			||||||
			s.wa0gibasekeeper.Mint(sdk.WrapSDKContext(s.Ctx), &types.MsgMint{
 | 
					 | 
				
			||||||
				Minter: s.signerOne.Addr.Bytes(),
 | 
					 | 
				
			||||||
				Amount: big.NewInt(4e18).Bytes(),
 | 
					 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			var err error
 | 
								var err error
 | 
				
			||||||
 | 
				
			|||||||
@ -10,8 +10,9 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type Supply = struct {
 | 
					type Supply = struct {
 | 
				
			||||||
	Cap   *big.Int "json:\"cap\""
 | 
						Cap           *big.Int "json:\"cap\""
 | 
				
			||||||
	Total *big.Int "json:\"total\""
 | 
						InitialSupply *big.Int "json:\"initialSupply\""
 | 
				
			||||||
 | 
						Supply        *big.Int "json:\"supply\""
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewGetW0GIRequest(args []interface{}) (*types.GetWA0GIRequest, error) {
 | 
					func NewGetW0GIRequest(args []interface{}) (*types.GetWA0GIRequest, error) {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
syntax = "proto3";
 | 
					syntax = "proto3";
 | 
				
			||||||
package zgc.wrappeda0gibase;
 | 
					package zgc.wrappeda0gibase.v1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "cosmos_proto/cosmos.proto";
 | 
					import "cosmos_proto/cosmos.proto";
 | 
				
			||||||
import "gogoproto/gogo.proto";
 | 
					import "gogoproto/gogo.proto";
 | 
				
			||||||
@ -1,11 +1,12 @@
 | 
				
			|||||||
syntax = "proto3";
 | 
					syntax = "proto3";
 | 
				
			||||||
package zgc.wrappeda0gibase;
 | 
					package zgc.wrappeda0gibase.v1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "cosmos_proto/cosmos.proto";
 | 
					import "cosmos_proto/cosmos.proto";
 | 
				
			||||||
import "gogoproto/gogo.proto";
 | 
					import "gogoproto/gogo.proto";
 | 
				
			||||||
import "google/api/annotations.proto";
 | 
					import "google/api/annotations.proto";
 | 
				
			||||||
import "google/protobuf/any.proto";
 | 
					import "google/protobuf/any.proto";
 | 
				
			||||||
import "google/protobuf/timestamp.proto";
 | 
					import "google/protobuf/timestamp.proto";
 | 
				
			||||||
 | 
					import "zgc/wrappeda0gibase/v1/wrappeda0gibase.proto";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option go_package = "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types";
 | 
					option go_package = "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types";
 | 
				
			||||||
option (gogoproto.goproto_getters_all) = false;
 | 
					option (gogoproto.goproto_getters_all) = false;
 | 
				
			||||||
@ -31,6 +32,5 @@ message MinterSupplyRequest {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
message MinterSupplyResponse {
 | 
					message MinterSupplyResponse {
 | 
				
			||||||
  bytes cap = 1; // big endian
 | 
					  Supply supply = 1;
 | 
				
			||||||
  bytes supply = 2; // big endian
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
syntax = "proto3";
 | 
					syntax = "proto3";
 | 
				
			||||||
package zgc.wrappeda0gibase;
 | 
					package zgc.wrappeda0gibase.v1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "cosmos_proto/cosmos.proto";
 | 
					import "cosmos_proto/cosmos.proto";
 | 
				
			||||||
import "gogoproto/gogo.proto";
 | 
					import "gogoproto/gogo.proto";
 | 
				
			||||||
@ -27,6 +27,7 @@ message MsgSetMinterCap {
 | 
				
			|||||||
  string authority = 1;
 | 
					  string authority = 1;
 | 
				
			||||||
  bytes minter = 2;
 | 
					  bytes minter = 2;
 | 
				
			||||||
  bytes cap = 3; // big endian
 | 
					  bytes cap = 3; // big endian
 | 
				
			||||||
 | 
					  bytes initialSupply = 4; // big endian
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
message MsgSetMinterCapResponse {}
 | 
					message MsgSetMinterCapResponse {}
 | 
				
			||||||
							
								
								
									
										17
									
								
								proto/zgc/wrappeda0gibase/v1/wrappeda0gibase.proto
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								proto/zgc/wrappeda0gibase/v1/wrappeda0gibase.proto
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					syntax = "proto3";
 | 
				
			||||||
 | 
					package zgc.wrappeda0gibase.v1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "cosmos_proto/cosmos.proto";
 | 
				
			||||||
 | 
					import "gogoproto/gogo.proto";
 | 
				
			||||||
 | 
					import "google/api/annotations.proto";
 | 
				
			||||||
 | 
					import "google/protobuf/any.proto";
 | 
				
			||||||
 | 
					import "google/protobuf/timestamp.proto";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					option go_package = "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types";
 | 
				
			||||||
 | 
					option (gogoproto.goproto_getters_all) = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					message Supply {
 | 
				
			||||||
 | 
					  bytes cap = 1; // big endian
 | 
				
			||||||
 | 
					  bytes initialSupply = 2; // big endian
 | 
				
			||||||
 | 
					  bytes supply = 3; // big endian
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -14,17 +14,12 @@ var _ types.QueryServer = Keeper{}
 | 
				
			|||||||
func (k Keeper) MinterSupply(c context.Context, request *types.MinterSupplyRequest) (*types.MinterSupplyResponse, error) {
 | 
					func (k Keeper) MinterSupply(c context.Context, request *types.MinterSupplyRequest) (*types.MinterSupplyResponse, error) {
 | 
				
			||||||
	ctx := sdk.UnwrapSDKContext(c)
 | 
						ctx := sdk.UnwrapSDKContext(c)
 | 
				
			||||||
	account := common.BytesToAddress(request.Address)
 | 
						account := common.BytesToAddress(request.Address)
 | 
				
			||||||
	cap, err := k.getMinterCap(ctx, account)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		return nil, err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	supply, err := k.getMinterSupply(ctx, account)
 | 
						supply, err := k.getMinterSupply(ctx, account)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return &types.MinterSupplyResponse{
 | 
						return &types.MinterSupplyResponse{
 | 
				
			||||||
		Cap:    cap.Bytes(),
 | 
							Supply: &supply,
 | 
				
			||||||
		Supply: supply.Bytes(),
 | 
					 | 
				
			||||||
	}, nil
 | 
						}, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -46,26 +46,24 @@ func (k Keeper) GetWA0GIAddress(ctx sdk.Context) []byte {
 | 
				
			|||||||
	return bz
 | 
						return bz
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (k Keeper) setMinterCap(ctx sdk.Context, account common.Address, cap *big.Int) error {
 | 
					func (k Keeper) setMinterSupply(ctx sdk.Context, account common.Address, supply types.Supply) error {
 | 
				
			||||||
	store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MinterCapKeyPrefix)
 | 
						store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MinterSupplyKeyPrefix)
 | 
				
			||||||
	store.Set(account.Bytes(), cap.Bytes())
 | 
						bz := k.cdc.MustMarshal(&supply)
 | 
				
			||||||
 | 
						store.Set(account.Bytes(), bz)
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (k Keeper) getMinterCap(ctx sdk.Context, account common.Address) (*big.Int, error) {
 | 
					func (k Keeper) getMinterSupply(ctx sdk.Context, account common.Address) (types.Supply, error) {
 | 
				
			||||||
	store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MinterCapKeyPrefix)
 | 
					 | 
				
			||||||
	bz := store.Get(account.Bytes())
 | 
					 | 
				
			||||||
	return new(big.Int).SetBytes(bz), nil
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func (k Keeper) setMinterSupply(ctx sdk.Context, account common.Address, supply *big.Int) error {
 | 
					 | 
				
			||||||
	store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MinterSupplyKeyPrefix)
 | 
					 | 
				
			||||||
	store.Set(account.Bytes(), supply.Bytes())
 | 
					 | 
				
			||||||
	return nil
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func (k Keeper) getMinterSupply(ctx sdk.Context, account common.Address) (*big.Int, error) {
 | 
					 | 
				
			||||||
	store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MinterSupplyKeyPrefix)
 | 
						store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MinterSupplyKeyPrefix)
 | 
				
			||||||
	bz := store.Get(account.Bytes())
 | 
						bz := store.Get(account.Bytes())
 | 
				
			||||||
	return new(big.Int).SetBytes(bz), nil
 | 
						if bz == nil {
 | 
				
			||||||
 | 
							return types.Supply{
 | 
				
			||||||
 | 
								Cap:           big.NewInt(0).Bytes(),
 | 
				
			||||||
 | 
								InitialSupply: big.NewInt(0).Bytes(),
 | 
				
			||||||
 | 
								Supply:        big.NewInt(0).Bytes(),
 | 
				
			||||||
 | 
							}, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						var supply types.Supply
 | 
				
			||||||
 | 
						k.cdc.MustUnmarshal(bz, &supply)
 | 
				
			||||||
 | 
						return supply, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -18,22 +18,30 @@ var _ types.MsgServer = &Keeper{}
 | 
				
			|||||||
func (k Keeper) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) {
 | 
					func (k Keeper) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) {
 | 
				
			||||||
	ctx := sdk.UnwrapSDKContext(goCtx)
 | 
						ctx := sdk.UnwrapSDKContext(goCtx)
 | 
				
			||||||
	minter := common.BytesToAddress(msg.Minter)
 | 
						minter := common.BytesToAddress(msg.Minter)
 | 
				
			||||||
	supply, err := k.getMinterSupply(ctx, minter)
 | 
						s, err := k.getMinterSupply(ctx, minter)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						supply := new(big.Int).SetBytes(s.Supply)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	amount := new(big.Int).SetBytes(msg.Amount)
 | 
						amount := new(big.Int).SetBytes(msg.Amount)
 | 
				
			||||||
	// check & update mint supply
 | 
						// check & update mint supply
 | 
				
			||||||
	supply.Sub(supply, amount)
 | 
						supply.Sub(supply, amount)
 | 
				
			||||||
	if supply.Cmp(big.NewInt(0)) < 0 {
 | 
						if supply.Cmp(big.NewInt(0)) < 0 {
 | 
				
			||||||
		return nil, types.ErrInsufficientMintSupply
 | 
							return nil, types.ErrInsufficientMintSupply
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// burn
 | 
						// transfer from wa0gi contract address & burn
 | 
				
			||||||
	c := sdk.NewCoin(precisebanktypes.ExtendedCoinDenom, sdk.NewIntFromBigInt(amount))
 | 
						c := sdk.NewCoin(precisebanktypes.ExtendedCoinDenom, sdk.NewIntFromBigInt(amount))
 | 
				
			||||||
 | 
						wa0gi := sdk.AccAddress(k.GetWA0GIAddress(ctx))
 | 
				
			||||||
 | 
						if err = k.pbkeeper.SendCoinsFromAccountToModule(ctx, wa0gi, types.ModuleName, sdk.NewCoins(c)); err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if err = k.pbkeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(c)); err != nil {
 | 
						if err = k.pbkeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(c)); err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if err = k.setMinterSupply(ctx, minter, supply); err != nil {
 | 
						// update supply
 | 
				
			||||||
 | 
						s.Supply = supply.Bytes()
 | 
				
			||||||
 | 
						if err = k.setMinterSupply(ctx, minter, s); err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return &types.MsgBurnResponse{}, nil
 | 
						return &types.MsgBurnResponse{}, nil
 | 
				
			||||||
@ -43,26 +51,31 @@ func (k Keeper) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnR
 | 
				
			|||||||
func (k Keeper) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) {
 | 
					func (k Keeper) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) {
 | 
				
			||||||
	ctx := sdk.UnwrapSDKContext(goCtx)
 | 
						ctx := sdk.UnwrapSDKContext(goCtx)
 | 
				
			||||||
	minter := common.BytesToAddress(msg.Minter)
 | 
						minter := common.BytesToAddress(msg.Minter)
 | 
				
			||||||
	cap, err := k.getMinterCap(ctx, minter)
 | 
						s, err := k.getMinterSupply(ctx, minter)
 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		return nil, err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	supply, err := k.getMinterSupply(ctx, minter)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						supply := new(big.Int).SetBytes(s.Supply)
 | 
				
			||||||
 | 
						cap := new(big.Int).SetBytes(s.Cap)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	amount := new(big.Int).SetBytes(msg.Amount)
 | 
						amount := new(big.Int).SetBytes(msg.Amount)
 | 
				
			||||||
	// check & update mint supply
 | 
						// check & update mint supply
 | 
				
			||||||
	supply.Add(supply, amount)
 | 
						supply.Add(supply, amount)
 | 
				
			||||||
	if supply.Cmp(cap) > 0 {
 | 
						if supply.Cmp(cap) > 0 {
 | 
				
			||||||
		return nil, types.ErrInsufficientMintCap
 | 
							return nil, types.ErrInsufficientMintCap
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// mint
 | 
						// mint & transfer to wa0gi contract address
 | 
				
			||||||
	c := sdk.NewCoin(precisebanktypes.ExtendedCoinDenom, sdk.NewIntFromBigInt(amount))
 | 
						c := sdk.NewCoin(precisebanktypes.ExtendedCoinDenom, sdk.NewIntFromBigInt(amount))
 | 
				
			||||||
	if err = k.pbkeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(c)); err != nil {
 | 
						if err = k.pbkeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(c)); err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if err = k.setMinterSupply(ctx, minter, supply); err != nil {
 | 
						wa0gi := sdk.AccAddress(k.GetWA0GIAddress(ctx))
 | 
				
			||||||
 | 
						if err = k.pbkeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, wa0gi, sdk.NewCoins(c)); err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						// update supply
 | 
				
			||||||
 | 
						s.Supply = supply.Bytes()
 | 
				
			||||||
 | 
						if err = k.setMinterSupply(ctx, minter, s); err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return &types.MsgMintResponse{}, nil
 | 
						return &types.MsgMintResponse{}, nil
 | 
				
			||||||
@ -76,8 +89,26 @@ func (k Keeper) SetMinterCap(goCtx context.Context, msg *types.MsgSetMinterCap)
 | 
				
			|||||||
	if k.authority != msg.Authority {
 | 
						if k.authority != msg.Authority {
 | 
				
			||||||
		return nil, errorsmod.Wrapf(gov.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority)
 | 
							return nil, errorsmod.Wrapf(gov.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// update minter cap
 | 
						// get previous minter supply
 | 
				
			||||||
	if err := k.setMinterCap(ctx, minter, new(big.Int).SetBytes(msg.Cap)); err != nil {
 | 
						s, err := k.getMinterSupply(ctx, minter)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						supply := new(big.Int).SetBytes(s.Supply)
 | 
				
			||||||
 | 
						currentInitialSupply := new(big.Int).SetBytes(s.InitialSupply)
 | 
				
			||||||
 | 
						newInitialSupply := new(big.Int).SetBytes(msg.InitialSupply)
 | 
				
			||||||
 | 
						difference := new(big.Int).Sub(newInitialSupply, currentInitialSupply)
 | 
				
			||||||
 | 
						supply.Add(supply, difference)
 | 
				
			||||||
 | 
						if supply.Cmp(big.NewInt(0)) < 0 {
 | 
				
			||||||
 | 
							supply = big.NewInt(0)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						s.Cap = msg.Cap
 | 
				
			||||||
 | 
						s.InitialSupply = msg.InitialSupply
 | 
				
			||||||
 | 
						s.Supply = supply.Bytes()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// update minter supply
 | 
				
			||||||
 | 
						if err := k.setMinterSupply(ctx, minter, s); err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return &types.MsgSetMinterCapResponse{}, nil
 | 
						return &types.MsgSetMinterCapResponse{}, nil
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,6 @@
 | 
				
			|||||||
package keeper_test
 | 
					package keeper_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
	"math/big"
 | 
						"math/big"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -63,43 +62,52 @@ func (s *MsgServerTestSuite) TestSetMinterCap() {
 | 
				
			|||||||
	testCases := []struct {
 | 
						testCases := []struct {
 | 
				
			||||||
		name string
 | 
							name string
 | 
				
			||||||
		caps []struct {
 | 
							caps []struct {
 | 
				
			||||||
			account common.Address
 | 
								account       common.Address
 | 
				
			||||||
			cap     *big.Int
 | 
								cap           *big.Int
 | 
				
			||||||
 | 
								initialSupply *big.Int
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}{
 | 
						}{
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			name: "success",
 | 
								name: "success",
 | 
				
			||||||
			caps: []struct {
 | 
								caps: []struct {
 | 
				
			||||||
				account common.Address
 | 
									account       common.Address
 | 
				
			||||||
				cap     *big.Int
 | 
									cap           *big.Int
 | 
				
			||||||
 | 
									initialSupply *big.Int
 | 
				
			||||||
			}{
 | 
								}{
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000000"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000000"),
 | 
				
			||||||
					cap:     big.NewInt(100000),
 | 
										cap:           big.NewInt(100000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(50000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000001"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000001"),
 | 
				
			||||||
					cap:     big.NewInt(200000),
 | 
										cap:           big.NewInt(200000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(100000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000002"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000002"),
 | 
				
			||||||
					cap:     big.NewInt(300000),
 | 
										cap:           big.NewInt(300000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(150000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000003"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000003"),
 | 
				
			||||||
					cap:     big.NewInt(400000),
 | 
										cap:           big.NewInt(400000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(200000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000002"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000002"),
 | 
				
			||||||
					cap:     big.NewInt(500000),
 | 
										cap:           big.NewInt(500000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(250000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000001"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000001"),
 | 
				
			||||||
					cap:     big.NewInt(600000),
 | 
										cap:           big.NewInt(600000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(300000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					account: common.HexToAddress("0x0000000000000000000000000000000000000000"),
 | 
										account:       common.HexToAddress("0x0000000000000000000000000000000000000000"),
 | 
				
			||||||
					cap:     big.NewInt(700000),
 | 
										cap:           big.NewInt(700000),
 | 
				
			||||||
 | 
										initialSupply: big.NewInt(350000),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
@ -107,9 +115,10 @@ func (s *MsgServerTestSuite) TestSetMinterCap() {
 | 
				
			|||||||
	s.Run("invalid authority", func() {
 | 
						s.Run("invalid authority", func() {
 | 
				
			||||||
		s.SetupTest()
 | 
							s.SetupTest()
 | 
				
			||||||
		_, err := s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
							_, err := s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
			Authority: s.Addresses[0].String(),
 | 
								Authority:     s.Addresses[0].String(),
 | 
				
			||||||
			Minter:    common.HexToAddress("0x0000000000000000000000000000000000000000").Bytes(),
 | 
								Minter:        common.HexToAddress("0x0000000000000000000000000000000000000000").Bytes(),
 | 
				
			||||||
			Cap:       big.NewInt(600000).Bytes(),
 | 
								Cap:           big.NewInt(600000).Bytes(),
 | 
				
			||||||
 | 
								InitialSupply: big.NewInt(300000).Bytes(),
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
		s.Require().Error(err)
 | 
							s.Require().Error(err)
 | 
				
			||||||
		s.Require().Contains(err.Error(), "expected gov account as only signer for proposal message")
 | 
							s.Require().Contains(err.Error(), "expected gov account as only signer for proposal message")
 | 
				
			||||||
@ -119,27 +128,41 @@ func (s *MsgServerTestSuite) TestSetMinterCap() {
 | 
				
			|||||||
		s.Run(tc.name, func() {
 | 
							s.Run(tc.name, func() {
 | 
				
			||||||
			s.SetupTest()
 | 
								s.SetupTest()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			c := make(map[common.Address]*big.Int)
 | 
								c := make(map[common.Address]struct {
 | 
				
			||||||
 | 
									Cap           *big.Int
 | 
				
			||||||
 | 
									InitialSupply *big.Int
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
			for _, cap := range tc.caps {
 | 
								for _, cap := range tc.caps {
 | 
				
			||||||
				_, err := s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
									_, err := s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
					Authority: govAccAddr,
 | 
										Authority:     govAccAddr,
 | 
				
			||||||
					Minter:    cap.account.Bytes(),
 | 
										Minter:        cap.account.Bytes(),
 | 
				
			||||||
					Cap:       cap.cap.Bytes(),
 | 
										Cap:           cap.cap.Bytes(),
 | 
				
			||||||
 | 
										InitialSupply: cap.initialSupply.Bytes(),
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				s.Require().NoError(err)
 | 
									s.Require().NoError(err)
 | 
				
			||||||
				response, err := s.Keeper.MinterSupply(s.Ctx, &types.MinterSupplyRequest{
 | 
									response, err := s.Keeper.MinterSupply(s.Ctx, &types.MinterSupplyRequest{
 | 
				
			||||||
					Address: cap.account.Bytes(),
 | 
										Address: cap.account.Bytes(),
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				s.Require().NoError(err)
 | 
									s.Require().NoError(err)
 | 
				
			||||||
				s.Require().Equal(new(big.Int).SetBytes(response.Cap), cap.cap)
 | 
									s.Require().Equal(new(big.Int).SetBytes(response.Supply.Cap), cap.cap)
 | 
				
			||||||
				c[cap.account] = cap.cap
 | 
									s.Require().Equal(new(big.Int).SetBytes(response.Supply.InitialSupply), cap.initialSupply)
 | 
				
			||||||
 | 
									s.Require().Equal(new(big.Int).SetBytes(response.Supply.Supply), cap.initialSupply)
 | 
				
			||||||
 | 
									c[cap.account] = struct {
 | 
				
			||||||
 | 
										Cap           *big.Int
 | 
				
			||||||
 | 
										InitialSupply *big.Int
 | 
				
			||||||
 | 
									}{
 | 
				
			||||||
 | 
										Cap:           cap.cap,
 | 
				
			||||||
 | 
										InitialSupply: cap.initialSupply,
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			for account, cap := range c {
 | 
								for account, cap := range c {
 | 
				
			||||||
				response, err := s.Keeper.MinterSupply(s.Ctx, &types.MinterSupplyRequest{
 | 
									response, err := s.Keeper.MinterSupply(s.Ctx, &types.MinterSupplyRequest{
 | 
				
			||||||
					Address: account.Bytes(),
 | 
										Address: account.Bytes(),
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				s.Require().NoError(err)
 | 
									s.Require().NoError(err)
 | 
				
			||||||
				s.Require().Equal(new(big.Int).SetBytes(response.Cap), cap)
 | 
									s.Require().Equal(new(big.Int).SetBytes(response.Supply.Cap), cap.Cap)
 | 
				
			||||||
 | 
									s.Require().Equal(new(big.Int).SetBytes(response.Supply.InitialSupply), cap.InitialSupply)
 | 
				
			||||||
 | 
									s.Require().Equal(new(big.Int).SetBytes(response.Supply.Supply), cap.InitialSupply)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -154,8 +177,8 @@ type MintBurn struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (s *MsgServerTestSuite) TestSetMintBurn() {
 | 
					func (s *MsgServerTestSuite) TestSetMintBurn() {
 | 
				
			||||||
	precisebankKeeper := s.App.GetPrecisebankKeeper()
 | 
						precisebankKeeper := s.App.GetPrecisebankKeeper()
 | 
				
			||||||
	accountKeeper := s.App.GetAccountKeeper()
 | 
						// accountKeeper := s.App.GetAccountKeeper()
 | 
				
			||||||
	moduleAcc := accountKeeper.GetModuleAccount(s.Ctx, types.ModuleName).GetAddress()
 | 
						// moduleAcc := accountKeeper.GetModuleAccount(s.Ctx, types.ModuleName).GetAddress()
 | 
				
			||||||
	govAccAddr := s.GovKeeper.GetGovernanceAccount(s.Ctx).GetAddress().String()
 | 
						govAccAddr := s.GovKeeper.GetGovernanceAccount(s.Ctx).GetAddress().String()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	minter1 := common.HexToAddress("0x0000000000000000000000000000000000000001")
 | 
						minter1 := common.HexToAddress("0x0000000000000000000000000000000000000001")
 | 
				
			||||||
@ -163,16 +186,18 @@ func (s *MsgServerTestSuite) TestSetMintBurn() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// set mint cap of minter 1 to 8 a0gi
 | 
						// set mint cap of minter 1 to 8 a0gi
 | 
				
			||||||
	_, err := s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
						_, err := s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
		Authority: govAccAddr,
 | 
							Authority:     govAccAddr,
 | 
				
			||||||
		Minter:    minter1.Bytes(),
 | 
							Minter:        minter1.Bytes(),
 | 
				
			||||||
		Cap:       big.NewInt(8e18).Bytes(),
 | 
							Cap:           big.NewInt(8e18).Bytes(),
 | 
				
			||||||
 | 
							InitialSupply: big.NewInt(0).Bytes(),
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	s.Require().NoError(err)
 | 
						s.Require().NoError(err)
 | 
				
			||||||
	// set mint cap of minter 2 to 5 a0gi
 | 
						// set mint cap of minter 2 to 5 a0gi
 | 
				
			||||||
	_, err = s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
						_, err = s.Keeper.SetMinterCap(sdk.WrapSDKContext(s.Ctx), &types.MsgSetMinterCap{
 | 
				
			||||||
		Authority: govAccAddr,
 | 
							Authority:     govAccAddr,
 | 
				
			||||||
		Minter:    minter2.Bytes(),
 | 
							Minter:        minter2.Bytes(),
 | 
				
			||||||
		Cap:       big.NewInt(5e18).Bytes(),
 | 
							Cap:           big.NewInt(5e18).Bytes(),
 | 
				
			||||||
 | 
							InitialSupply: big.NewInt(0).Bytes(),
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	s.Require().NoError(err)
 | 
						s.Require().NoError(err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -236,8 +261,7 @@ func (s *MsgServerTestSuite) TestSetMintBurn() {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	minted := big.NewInt(0)
 | 
						minted := big.NewInt(0)
 | 
				
			||||||
	supplied := make(map[common.Address]*big.Int)
 | 
						supplied := make(map[common.Address]*big.Int)
 | 
				
			||||||
	for id, c := range testCases {
 | 
						for _, c := range testCases {
 | 
				
			||||||
		fmt.Println(id)
 | 
					 | 
				
			||||||
		if c.IsMint {
 | 
							if c.IsMint {
 | 
				
			||||||
			_, err = s.Keeper.Mint(sdk.WrapSDKContext(s.Ctx), &types.MsgMint{
 | 
								_, err = s.Keeper.Mint(sdk.WrapSDKContext(s.Ctx), &types.MsgMint{
 | 
				
			||||||
				Minter: c.Minter.Bytes(),
 | 
									Minter: c.Minter.Bytes(),
 | 
				
			||||||
@ -270,11 +294,12 @@ func (s *MsgServerTestSuite) TestSetMintBurn() {
 | 
				
			|||||||
				Address: c.Minter.Bytes(),
 | 
									Address: c.Minter.Bytes(),
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
			s.Require().NoError(err)
 | 
								s.Require().NoError(err)
 | 
				
			||||||
			s.Require().Equal(supplied[c.Minter].Bytes(), response.Supply)
 | 
								s.Require().Equal(supplied[c.Minter].Bytes(), response.Supply.Supply)
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			s.Require().Error(err)
 | 
								s.Require().Error(err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		coins := precisebankKeeper.GetBalance(s.Ctx, moduleAcc, precisebanktypes.ExtendedCoinDenom)
 | 
							wa0gi := sdk.AccAddress(s.Keeper.GetWA0GIAddress(s.Ctx))
 | 
				
			||||||
 | 
							coins := precisebankKeeper.GetBalance(s.Ctx, wa0gi, precisebanktypes.ExtendedCoinDenom)
 | 
				
			||||||
		s.Require().Equal(coins.Amount.BigInt(), minted)
 | 
							s.Require().Equal(coins.Amount.BigInt(), minted)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
					// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
				
			||||||
// source: zgc/wrappeda0gibase/genesis.proto
 | 
					// source: zgc/wrappeda0gibase/v1/genesis.proto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package types
 | 
					package types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -36,7 +36,7 @@ func (m *GenesisState) Reset()         { *m = GenesisState{} }
 | 
				
			|||||||
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
 | 
					func (m *GenesisState) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*GenesisState) ProtoMessage()    {}
 | 
					func (*GenesisState) ProtoMessage()    {}
 | 
				
			||||||
func (*GenesisState) Descriptor() ([]byte, []int) {
 | 
					func (*GenesisState) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_7e056019f61fd820, []int{0}
 | 
						return fileDescriptor_779563aa2ca23b26, []int{0}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
 | 
					func (m *GenesisState) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -73,29 +73,31 @@ func (m *GenesisState) GetWrappedA0GiAddress() []byte {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	proto.RegisterType((*GenesisState)(nil), "zgc.wrappeda0gibase.GenesisState")
 | 
						proto.RegisterType((*GenesisState)(nil), "zgc.wrappeda0gibase.v1.GenesisState")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() { proto.RegisterFile("zgc/wrappeda0gibase/genesis.proto", fileDescriptor_7e056019f61fd820) }
 | 
					func init() {
 | 
				
			||||||
 | 
						proto.RegisterFile("zgc/wrappeda0gibase/v1/genesis.proto", fileDescriptor_779563aa2ca23b26)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var fileDescriptor_7e056019f61fd820 = []byte{
 | 
					var fileDescriptor_779563aa2ca23b26 = []byte{
 | 
				
			||||||
	// 246 bytes of a gzipped FileDescriptorProto
 | 
						// 253 bytes of a gzipped FileDescriptorProto
 | 
				
			||||||
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xbd, 0x4e, 0xc3, 0x30,
 | 
						0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xb1, 0x4e, 0xc3, 0x30,
 | 
				
			||||||
	0x10, 0x80, 0xe3, 0x85, 0x21, 0xea, 0x14, 0x3a, 0xd0, 0x0e, 0xe6, 0x67, 0x62, 0x49, 0x6c, 0x09,
 | 
						0x10, 0x86, 0xeb, 0x85, 0x21, 0xea, 0x14, 0x55, 0x88, 0x76, 0x30, 0x08, 0x31, 0xb0, 0x24, 0x76,
 | 
				
			||||||
	0x1e, 0x80, 0xb2, 0xb0, 0x31, 0xc0, 0xc6, 0x12, 0xd9, 0x8e, 0xb9, 0x5a, 0x6a, 0x72, 0x56, 0xce,
 | 
						0x05, 0x0f, 0x40, 0x59, 0xd8, 0x18, 0x60, 0x63, 0x89, 0x6c, 0xc7, 0x5c, 0x2d, 0x35, 0x39, 0x2b,
 | 
				
			||||||
	0x15, 0xb4, 0x4f, 0xc1, 0x63, 0x31, 0x76, 0x64, 0x44, 0xc9, 0x8b, 0xa0, 0xc4, 0x61, 0xc9, 0xe6,
 | 
						0xe7, 0x16, 0xda, 0xa7, 0xe0, 0xb1, 0x18, 0x3b, 0x32, 0xa2, 0xe4, 0x45, 0x50, 0xe2, 0xb0, 0x74,
 | 
				
			||||||
	0xbb, 0xef, 0x93, 0xfc, 0xe9, 0xd2, 0xeb, 0x23, 0x18, 0xf1, 0xd1, 0x2a, 0xef, 0x6d, 0xa5, 0x24,
 | 
						0xf3, 0xdd, 0xf7, 0x5b, 0xf7, 0xe9, 0x4f, 0x6e, 0x0e, 0x60, 0xc4, 0x47, 0xa3, 0xbc, 0xb7, 0xa5,
 | 
				
			||||||
	0x38, 0xad, 0xc8, 0x0a, 0xb0, 0x8d, 0x25, 0x47, 0x85, 0x6f, 0x31, 0x60, 0x76, 0x7e, 0x04, 0x53,
 | 
						0x92, 0xe0, 0xb4, 0x22, 0x2b, 0x76, 0x4b, 0x01, 0xb6, 0xb6, 0xe4, 0x28, 0xf7, 0x0d, 0x06, 0x4c,
 | 
				
			||||||
	0xcc, 0x94, 0xf5, 0xca, 0x20, 0xd5, 0x48, 0xe5, 0xa8, 0x88, 0x38, 0x44, 0x7f, 0xbd, 0x04, 0x04,
 | 
						0xcf, 0x0f, 0x60, 0xf2, 0x93, 0x54, 0xbe, 0x5b, 0x2e, 0xe6, 0x06, 0xa9, 0x42, 0x2a, 0x86, 0x94,
 | 
				
			||||||
	0x8c, 0xfb, 0xe1, 0x35, 0x6d, 0x57, 0x80, 0x08, 0x3b, 0x2b, 0xc6, 0x49, 0xef, 0xdf, 0x85, 0x6a,
 | 
						0x88, 0x43, 0xfc, 0xb2, 0x98, 0x01, 0x02, 0xc6, 0x7d, 0xff, 0x1a, 0xb7, 0x73, 0x40, 0x84, 0x8d,
 | 
				
			||||||
	0x0e, 0x13, 0xba, 0x9c, 0xa3, 0xe0, 0x6a, 0x4b, 0x41, 0xd5, 0x3e, 0x0a, 0x37, 0x0f, 0xe9, 0xe2,
 | 
						0x15, 0xc3, 0xa4, 0xb7, 0xef, 0x42, 0xd5, 0xfb, 0x11, 0x5d, 0x9e, 0xa2, 0xe0, 0x2a, 0x4b, 0x41,
 | 
				
			||||||
	0x29, 0x26, 0xbd, 0x06, 0x15, 0x6c, 0x26, 0xd3, 0xe5, 0xd4, 0x53, 0x0e, 0x41, 0xa5, 0xaa, 0xaa,
 | 
						0x55, 0x3e, 0x06, 0xae, 0x1f, 0x92, 0xe9, 0x53, 0xb4, 0x7a, 0x0d, 0x2a, 0xd8, 0x54, 0x26, 0xb3,
 | 
				
			||||||
	0xd6, 0x12, 0x5d, 0xb0, 0x2b, 0x76, 0xbb, 0x78, 0xc9, 0x26, 0xb6, 0x91, 0xe0, 0x36, 0x91, 0x3c,
 | 
						0x51, 0xa9, 0xe8, 0x9d, 0x0a, 0x55, 0x96, 0x8d, 0x25, 0xba, 0x60, 0x57, 0xec, 0x76, 0xfa, 0x92,
 | 
				
			||||||
	0x3e, 0x7f, 0x77, 0x9c, 0x9d, 0x3a, 0xce, 0x7e, 0x3b, 0xce, 0xbe, 0x7a, 0x9e, 0x9c, 0x7a, 0x9e,
 | 
						0x8e, 0x6c, 0x25, 0xc1, 0xad, 0x22, 0x79, 0x7c, 0xfe, 0x6e, 0x39, 0x3b, 0xb6, 0x9c, 0xfd, 0xb6,
 | 
				
			||||||
	0xfc, 0xf4, 0x3c, 0x79, 0xbb, 0x07, 0x17, 0xb6, 0x7b, 0x5d, 0x18, 0xac, 0x85, 0x84, 0x9d, 0xd2,
 | 
						0x9c, 0x7d, 0x75, 0x7c, 0x72, 0xec, 0xf8, 0xe4, 0xa7, 0xe3, 0x93, 0xb7, 0x7b, 0x70, 0x61, 0xbd,
 | 
				
			||||||
	0x24, 0x24, 0xe4, 0x66, 0xab, 0x5c, 0x23, 0x3e, 0xff, 0x2f, 0x93, 0x0f, 0xdf, 0xe4, 0xe3, 0x6d,
 | 
						0xd5, 0xb9, 0xc1, 0x4a, 0x48, 0xd8, 0x28, 0x4d, 0x42, 0x42, 0x66, 0xd6, 0xca, 0xd5, 0xe2, 0xf3,
 | 
				
			||||||
	0xc2, 0xc1, 0x5b, 0xd2, 0x67, 0x63, 0xd8, 0xdd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x50,
 | 
						0xbf, 0x9f, 0xac, 0x3f, 0x93, 0x0d, 0x0d, 0x85, 0xbd, 0xb7, 0xa4, 0xcf, 0x06, 0xb1, 0xbb, 0xbf,
 | 
				
			||||||
	0x04, 0x4c, 0x3f, 0x01, 0x00, 0x00,
 | 
						0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x49, 0x21, 0xfe, 0x45, 0x01, 0x00, 0x00,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
 | 
					func (m *GenesisState) Marshal() (dAtA []byte, err error) {
 | 
				
			||||||
 | 
				
			|||||||
@ -15,7 +15,6 @@ const (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	// prefix
 | 
						// prefix
 | 
				
			||||||
	MinterCapKeyPrefix    = []byte{0x00}
 | 
					 | 
				
			||||||
	MinterSupplyKeyPrefix = []byte{0x01}
 | 
						MinterSupplyKeyPrefix = []byte{0x01}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// keys
 | 
						// keys
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
					// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
				
			||||||
// source: zgc/wrappeda0gibase/query.proto
 | 
					// source: zgc/wrappeda0gibase/v1/query.proto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package types
 | 
					package types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -39,7 +39,7 @@ func (m *GetWA0GIRequest) Reset()         { *m = GetWA0GIRequest{} }
 | 
				
			|||||||
func (m *GetWA0GIRequest) String() string { return proto.CompactTextString(m) }
 | 
					func (m *GetWA0GIRequest) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*GetWA0GIRequest) ProtoMessage()    {}
 | 
					func (*GetWA0GIRequest) ProtoMessage()    {}
 | 
				
			||||||
func (*GetWA0GIRequest) Descriptor() ([]byte, []int) {
 | 
					func (*GetWA0GIRequest) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_19911faa2ec12c75, []int{0}
 | 
						return fileDescriptor_55673b89eaf499d1, []int{0}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *GetWA0GIRequest) XXX_Unmarshal(b []byte) error {
 | 
					func (m *GetWA0GIRequest) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -76,7 +76,7 @@ func (m *GetWA0GIResponse) Reset()         { *m = GetWA0GIResponse{} }
 | 
				
			|||||||
func (m *GetWA0GIResponse) String() string { return proto.CompactTextString(m) }
 | 
					func (m *GetWA0GIResponse) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*GetWA0GIResponse) ProtoMessage()    {}
 | 
					func (*GetWA0GIResponse) ProtoMessage()    {}
 | 
				
			||||||
func (*GetWA0GIResponse) Descriptor() ([]byte, []int) {
 | 
					func (*GetWA0GIResponse) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_19911faa2ec12c75, []int{1}
 | 
						return fileDescriptor_55673b89eaf499d1, []int{1}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *GetWA0GIResponse) XXX_Unmarshal(b []byte) error {
 | 
					func (m *GetWA0GIResponse) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -113,7 +113,7 @@ func (m *MinterSupplyRequest) Reset()         { *m = MinterSupplyRequest{} }
 | 
				
			|||||||
func (m *MinterSupplyRequest) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MinterSupplyRequest) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MinterSupplyRequest) ProtoMessage()    {}
 | 
					func (*MinterSupplyRequest) ProtoMessage()    {}
 | 
				
			||||||
func (*MinterSupplyRequest) Descriptor() ([]byte, []int) {
 | 
					func (*MinterSupplyRequest) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_19911faa2ec12c75, []int{2}
 | 
						return fileDescriptor_55673b89eaf499d1, []int{2}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MinterSupplyRequest) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MinterSupplyRequest) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -143,15 +143,14 @@ func (m *MinterSupplyRequest) XXX_DiscardUnknown() {
 | 
				
			|||||||
var xxx_messageInfo_MinterSupplyRequest proto.InternalMessageInfo
 | 
					var xxx_messageInfo_MinterSupplyRequest proto.InternalMessageInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type MinterSupplyResponse struct {
 | 
					type MinterSupplyResponse struct {
 | 
				
			||||||
	Cap    []byte `protobuf:"bytes,1,opt,name=cap,proto3" json:"cap,omitempty"`
 | 
						Supply *Supply `protobuf:"bytes,1,opt,name=supply,proto3" json:"supply,omitempty"`
 | 
				
			||||||
	Supply []byte `protobuf:"bytes,2,opt,name=supply,proto3" json:"supply,omitempty"`
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (m *MinterSupplyResponse) Reset()         { *m = MinterSupplyResponse{} }
 | 
					func (m *MinterSupplyResponse) Reset()         { *m = MinterSupplyResponse{} }
 | 
				
			||||||
func (m *MinterSupplyResponse) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MinterSupplyResponse) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MinterSupplyResponse) ProtoMessage()    {}
 | 
					func (*MinterSupplyResponse) ProtoMessage()    {}
 | 
				
			||||||
func (*MinterSupplyResponse) Descriptor() ([]byte, []int) {
 | 
					func (*MinterSupplyResponse) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_19911faa2ec12c75, []int{3}
 | 
						return fileDescriptor_55673b89eaf499d1, []int{3}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MinterSupplyResponse) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MinterSupplyResponse) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -181,42 +180,45 @@ func (m *MinterSupplyResponse) XXX_DiscardUnknown() {
 | 
				
			|||||||
var xxx_messageInfo_MinterSupplyResponse proto.InternalMessageInfo
 | 
					var xxx_messageInfo_MinterSupplyResponse proto.InternalMessageInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	proto.RegisterType((*GetWA0GIRequest)(nil), "zgc.wrappeda0gibase.GetWA0GIRequest")
 | 
						proto.RegisterType((*GetWA0GIRequest)(nil), "zgc.wrappeda0gibase.v1.GetWA0GIRequest")
 | 
				
			||||||
	proto.RegisterType((*GetWA0GIResponse)(nil), "zgc.wrappeda0gibase.GetWA0GIResponse")
 | 
						proto.RegisterType((*GetWA0GIResponse)(nil), "zgc.wrappeda0gibase.v1.GetWA0GIResponse")
 | 
				
			||||||
	proto.RegisterType((*MinterSupplyRequest)(nil), "zgc.wrappeda0gibase.MinterSupplyRequest")
 | 
						proto.RegisterType((*MinterSupplyRequest)(nil), "zgc.wrappeda0gibase.v1.MinterSupplyRequest")
 | 
				
			||||||
	proto.RegisterType((*MinterSupplyResponse)(nil), "zgc.wrappeda0gibase.MinterSupplyResponse")
 | 
						proto.RegisterType((*MinterSupplyResponse)(nil), "zgc.wrappeda0gibase.v1.MinterSupplyResponse")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() { proto.RegisterFile("zgc/wrappeda0gibase/query.proto", fileDescriptor_19911faa2ec12c75) }
 | 
					func init() {
 | 
				
			||||||
 | 
						proto.RegisterFile("zgc/wrappeda0gibase/v1/query.proto", fileDescriptor_55673b89eaf499d1)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var fileDescriptor_19911faa2ec12c75 = []byte{
 | 
					var fileDescriptor_55673b89eaf499d1 = []byte{
 | 
				
			||||||
	// 410 bytes of a gzipped FileDescriptorProto
 | 
						// 418 bytes of a gzipped FileDescriptorProto
 | 
				
			||||||
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6e, 0xd3, 0x30,
 | 
						0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0xcb, 0xd3, 0x30,
 | 
				
			||||||
	0x18, 0xc7, 0x93, 0x22, 0x0a, 0xb2, 0x2a, 0x51, 0xdc, 0x0a, 0xb5, 0x11, 0x4a, 0x21, 0x50, 0x51,
 | 
						0x18, 0xc7, 0xdb, 0x17, 0x7c, 0x95, 0xf8, 0x82, 0x1a, 0x5f, 0x64, 0x2b, 0x92, 0x69, 0x45, 0x36,
 | 
				
			||||||
	0x04, 0x89, 0x23, 0xe0, 0x01, 0x80, 0x4b, 0xc5, 0x81, 0x03, 0xe5, 0x80, 0xc4, 0x05, 0x39, 0xa9,
 | 
						0xd8, 0xda, 0x74, 0x53, 0xbc, 0xeb, 0x65, 0x78, 0x50, 0x70, 0x1e, 0x04, 0x2f, 0x92, 0x76, 0x31,
 | 
				
			||||||
	0x71, 0x23, 0x35, 0xb1, 0x1b, 0x3b, 0xea, 0xda, 0xd3, 0xb4, 0x27, 0xa8, 0xb4, 0xf3, 0xde, 0xa7,
 | 
						0x2b, 0xac, 0x4d, 0xd6, 0xa4, 0x9b, 0xdb, 0xd1, 0x83, 0x67, 0x41, 0xf0, 0x3b, 0xf8, 0x4d, 0x76,
 | 
				
			||||||
	0xc7, 0x4a, 0xbb, 0xec, 0xb8, 0xb5, 0x7b, 0x90, 0x29, 0x8e, 0xa3, 0x6d, 0x55, 0xb4, 0xed, 0xe6,
 | 
						0x1c, 0x78, 0xf1, 0xa8, 0x9b, 0x1f, 0x44, 0x9a, 0xa6, 0xa8, 0xa5, 0xd3, 0xf7, 0xd6, 0xe7, 0xc9,
 | 
				
			||||||
	0xff, 0xe7, 0xdf, 0xe7, 0xef, 0xef, 0xbf, 0x0d, 0x7a, 0x4b, 0x1a, 0xa2, 0x79, 0x8a, 0x39, 0x27,
 | 
						0xff, 0x97, 0xe7, 0xff, 0xfc, 0x1b, 0xe0, 0x6e, 0x58, 0x84, 0x57, 0x19, 0x11, 0x82, 0x4e, 0x49,
 | 
				
			||||||
	0x63, 0xec, 0xd3, 0x28, 0xc0, 0x82, 0xa0, 0x59, 0x46, 0xd2, 0x85, 0xc7, 0x53, 0x26, 0x19, 0x6c,
 | 
						0xc0, 0xe2, 0x90, 0x48, 0x8a, 0x97, 0x43, 0xbc, 0xc8, 0x69, 0xb6, 0xf6, 0x45, 0xc6, 0x15, 0x87,
 | 
				
			||||||
	0x2d, 0x69, 0xe8, 0xed, 0x01, 0x56, 0x37, 0x64, 0x22, 0x66, 0xe2, 0x9f, 0x42, 0x50, 0x21, 0x0a,
 | 
						0xb7, 0x36, 0x2c, 0xf2, 0x6b, 0x1a, 0x7f, 0x39, 0x74, 0xda, 0x11, 0x97, 0x09, 0x97, 0x6f, 0xb4,
 | 
				
			||||||
	0xde, 0x6a, 0x53, 0x46, 0x59, 0x51, 0xcf, 0x57, 0xba, 0xfa, 0x92, 0x32, 0x46, 0xa7, 0x04, 0x61,
 | 
						0x0a, 0x97, 0x45, 0x89, 0x38, 0xe7, 0x8c, 0x33, 0x5e, 0xf6, 0x8b, 0x2f, 0xd3, 0xbd, 0xcd, 0x38,
 | 
				
			||||||
	0x1e, 0x21, 0x9c, 0x24, 0x4c, 0x62, 0x19, 0xb1, 0xa4, 0xec, 0xe9, 0xea, 0x5d, 0xa5, 0x82, 0xec,
 | 
						0x67, 0x73, 0x8a, 0x89, 0x88, 0x31, 0x49, 0x53, 0xae, 0x88, 0x8a, 0x79, 0x5a, 0x31, 0x6d, 0x73,
 | 
				
			||||||
	0x3f, 0xc2, 0x89, 0x1e, 0x6f, 0xf5, 0xf6, 0xb7, 0x64, 0x14, 0x13, 0x21, 0x71, 0xcc, 0x0b, 0xc0,
 | 
						0xaa, 0xab, 0x30, 0x7f, 0x8b, 0x49, 0x6a, 0x1c, 0x38, 0x9d, 0xfa, 0x91, 0x8a, 0x13, 0x2a, 0x15,
 | 
				
			||||||
	0x79, 0x0e, 0x9e, 0x0d, 0x89, 0xfc, 0xf3, 0xcd, 0x1f, 0xfe, 0x18, 0x91, 0x59, 0x46, 0x84, 0x74,
 | 
						0x49, 0x84, 0x11, 0x0c, 0x8e, 0xac, 0x51, 0x77, 0xad, 0xd5, 0xee, 0x0d, 0x70, 0x6d, 0x4c, 0xd5,
 | 
				
			||||||
	0x3e, 0x82, 0xe6, 0x75, 0x49, 0x70, 0x96, 0x08, 0x02, 0x3b, 0xe0, 0x09, 0x1e, 0x8f, 0x53, 0x22,
 | 
						0xab, 0xc7, 0xc1, 0xf8, 0xe9, 0x84, 0x2e, 0x72, 0x2a, 0x95, 0x3b, 0x00, 0xd7, 0x7f, 0xb7, 0xa4,
 | 
				
			||||||
	0x44, 0xc7, 0x7c, 0x65, 0x0e, 0x1a, 0xa3, 0x52, 0x3a, 0x08, 0xb4, 0x7e, 0x46, 0x89, 0x24, 0xe9,
 | 
						0xe0, 0xa9, 0xa4, 0xb0, 0x05, 0x2e, 0x93, 0xe9, 0x34, 0xa3, 0x52, 0xb6, 0xec, 0x3b, 0x76, 0xef,
 | 
				
			||||||
	0xef, 0x8c, 0xf3, 0xe9, 0x42, 0x1f, 0x72, 0x47, 0xc3, 0x57, 0xd0, 0xbe, 0xdd, 0xa0, 0x47, 0x34,
 | 
						0x6c, 0x52, 0x95, 0x2e, 0x06, 0x37, 0x9f, 0xc5, 0xa9, 0xa2, 0xd9, 0xcb, 0x5c, 0x88, 0xf9, 0xda,
 | 
				
			||||||
	0xc1, 0xa3, 0x10, 0x73, 0x4d, 0xe7, 0x4b, 0xf8, 0x02, 0xd4, 0x85, 0x62, 0x3a, 0x35, 0x55, 0xd4,
 | 
						0x5c, 0xf2, 0x0f, 0xe0, 0x39, 0x38, 0xff, 0x1b, 0x30, 0x23, 0x1e, 0x81, 0x53, 0xa9, 0x3b, 0x1a,
 | 
				
			||||||
	0xea, 0xd3, 0x49, 0x0d, 0x3c, 0xfe, 0x95, 0x67, 0x0c, 0x0f, 0x4d, 0xf0, 0xb4, 0xf4, 0x0a, 0xdf,
 | 
						0xb8, 0x3a, 0x42, 0x7e, 0x73, 0xd6, 0xbe, 0xe1, 0x8c, 0x7a, 0xf4, 0xe5, 0x04, 0x5c, 0x7a, 0x51,
 | 
				
			||||||
	0x7a, 0x15, 0x59, 0x7b, 0x7b, 0xb7, 0xb3, 0xfa, 0xf7, 0x50, 0x85, 0x1b, 0xe7, 0xdd, 0xd1, 0xe9,
 | 
						0xfc, 0x22, 0xf8, 0xc1, 0x06, 0x57, 0x2a, 0xe7, 0xb0, 0x7b, 0x0c, 0xaf, 0xad, 0xeb, 0xf4, 0xfe,
 | 
				
			||||||
	0xe5, 0x71, 0xed, 0x35, 0xec, 0x21, 0x9f, 0x96, 0x0f, 0xec, 0xe6, 0xb8, 0xab, 0x9e, 0x98, 0x12,
 | 
						0x2f, 0x2c, 0x1d, 0xba, 0xdd, 0xf7, 0x5f, 0x7f, 0x7e, 0x3a, 0xb9, 0x0b, 0x3b, 0x38, 0x60, 0x55,
 | 
				
			||||||
	0xe9, 0xce, 0x73, 0x09, 0x57, 0x26, 0x68, 0xdc, 0xbc, 0x0f, 0x1c, 0x54, 0x0e, 0xa8, 0xc8, 0xc8,
 | 
						0x9c, 0x5e, 0x41, 0x78, 0x3a, 0x63, 0x46, 0x95, 0xb7, 0x2a, 0x4a, 0xf8, 0xd9, 0x06, 0x67, 0x7f,
 | 
				
			||||||
	0x7a, 0xff, 0x00, 0x52, 0xdb, 0xf9, 0xa0, 0xec, 0xf4, 0xe1, 0x9b, 0x6a, 0x3b, 0xb1, 0xea, 0x71,
 | 
						0xee, 0x08, 0xfb, 0xc7, 0x66, 0x34, 0x44, 0xe7, 0x0c, 0x2e, 0x26, 0x36, 0xa6, 0xfa, 0xda, 0xd4,
 | 
				
			||||||
	0x8b, 0x7c, 0xbe, 0x8f, 0xd6, 0x17, 0xb6, 0xb1, 0xde, 0xda, 0xe6, 0x66, 0x6b, 0x9b, 0xe7, 0x5b,
 | 
						0x7d, 0x78, 0xaf, 0xd9, 0x54, 0xa2, 0x19, 0xaf, 0xcc, 0xea, 0xc9, 0x64, 0xfb, 0x03, 0x59, 0xdb,
 | 
				
			||||||
	0xdb, 0x5c, 0xed, 0x6c, 0x63, 0xb3, 0xb3, 0x8d, 0xb3, 0x9d, 0x6d, 0xfc, 0xfd, 0x42, 0x23, 0x39,
 | 
						0x3d, 0xb2, 0x77, 0x7b, 0x64, 0x7f, 0xdf, 0x23, 0xfb, 0xe3, 0x01, 0x59, 0xbb, 0x03, 0xb2, 0xbe,
 | 
				
			||||||
	0xc9, 0x02, 0x2f, 0x64, 0x31, 0xf2, 0xe9, 0x14, 0x07, 0x02, 0xf9, 0xd4, 0x0d, 0x27, 0x38, 0x4a,
 | 
						0x1d, 0x90, 0xf5, 0xfa, 0x21, 0x8b, 0xd5, 0x2c, 0x0f, 0xfd, 0x88, 0x27, 0x38, 0x60, 0x73, 0x12,
 | 
				
			||||||
	0xd0, 0x41, 0xc5, 0xd9, 0x72, 0xc1, 0x89, 0x08, 0xea, 0xea, 0xbb, 0x7c, 0xbe, 0x0a, 0x00, 0x00,
 | 
						0x4a, 0x1c, 0x30, 0x2f, 0x9a, 0x91, 0x38, 0xc5, 0xef, 0x1a, 0xee, 0x56, 0x6b, 0x41, 0x65, 0x78,
 | 
				
			||||||
	0xff, 0xff, 0x14, 0xfb, 0x91, 0x88, 0xf1, 0x02, 0x00, 0x00,
 | 
						0xaa, 0x1f, 0xd2, 0x83, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x94, 0xc8, 0xa7, 0x60, 0x3f, 0x03,
 | 
				
			||||||
 | 
						0x00, 0x00,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Reference imports to suppress errors if they are not otherwise used.
 | 
					// Reference imports to suppress errors if they are not otherwise used.
 | 
				
			||||||
@ -245,7 +247,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *queryClient) GetWA0GI(ctx context.Context, in *GetWA0GIRequest, opts ...grpc.CallOption) (*GetWA0GIResponse, error) {
 | 
					func (c *queryClient) GetWA0GI(ctx context.Context, in *GetWA0GIRequest, opts ...grpc.CallOption) (*GetWA0GIResponse, error) {
 | 
				
			||||||
	out := new(GetWA0GIResponse)
 | 
						out := new(GetWA0GIResponse)
 | 
				
			||||||
	err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Query/GetWA0GI", in, out, opts...)
 | 
						err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.v1.Query/GetWA0GI", in, out, opts...)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -254,7 +256,7 @@ func (c *queryClient) GetWA0GI(ctx context.Context, in *GetWA0GIRequest, opts ..
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *queryClient) MinterSupply(ctx context.Context, in *MinterSupplyRequest, opts ...grpc.CallOption) (*MinterSupplyResponse, error) {
 | 
					func (c *queryClient) MinterSupply(ctx context.Context, in *MinterSupplyRequest, opts ...grpc.CallOption) (*MinterSupplyResponse, error) {
 | 
				
			||||||
	out := new(MinterSupplyResponse)
 | 
						out := new(MinterSupplyResponse)
 | 
				
			||||||
	err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Query/MinterSupply", in, out, opts...)
 | 
						err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.v1.Query/MinterSupply", in, out, opts...)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -292,7 +294,7 @@ func _Query_GetWA0GI_Handler(srv interface{}, ctx context.Context, dec func(inte
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	info := &grpc.UnaryServerInfo{
 | 
						info := &grpc.UnaryServerInfo{
 | 
				
			||||||
		Server:     srv,
 | 
							Server:     srv,
 | 
				
			||||||
		FullMethod: "/zgc.wrappeda0gibase.Query/GetWA0GI",
 | 
							FullMethod: "/zgc.wrappeda0gibase.v1.Query/GetWA0GI",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
				
			||||||
		return srv.(QueryServer).GetWA0GI(ctx, req.(*GetWA0GIRequest))
 | 
							return srv.(QueryServer).GetWA0GI(ctx, req.(*GetWA0GIRequest))
 | 
				
			||||||
@ -310,7 +312,7 @@ func _Query_MinterSupply_Handler(srv interface{}, ctx context.Context, dec func(
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	info := &grpc.UnaryServerInfo{
 | 
						info := &grpc.UnaryServerInfo{
 | 
				
			||||||
		Server:     srv,
 | 
							Server:     srv,
 | 
				
			||||||
		FullMethod: "/zgc.wrappeda0gibase.Query/MinterSupply",
 | 
							FullMethod: "/zgc.wrappeda0gibase.v1.Query/MinterSupply",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
				
			||||||
		return srv.(QueryServer).MinterSupply(ctx, req.(*MinterSupplyRequest))
 | 
							return srv.(QueryServer).MinterSupply(ctx, req.(*MinterSupplyRequest))
 | 
				
			||||||
@ -319,7 +321,7 @@ func _Query_MinterSupply_Handler(srv interface{}, ctx context.Context, dec func(
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var _Query_serviceDesc = grpc.ServiceDesc{
 | 
					var _Query_serviceDesc = grpc.ServiceDesc{
 | 
				
			||||||
	ServiceName: "zgc.wrappeda0gibase.Query",
 | 
						ServiceName: "zgc.wrappeda0gibase.v1.Query",
 | 
				
			||||||
	HandlerType: (*QueryServer)(nil),
 | 
						HandlerType: (*QueryServer)(nil),
 | 
				
			||||||
	Methods: []grpc.MethodDesc{
 | 
						Methods: []grpc.MethodDesc{
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@ -332,7 +334,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{
 | 
				
			|||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	Streams:  []grpc.StreamDesc{},
 | 
						Streams:  []grpc.StreamDesc{},
 | 
				
			||||||
	Metadata: "zgc/wrappeda0gibase/query.proto",
 | 
						Metadata: "zgc/wrappeda0gibase/v1/query.proto",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (m *GetWA0GIRequest) Marshal() (dAtA []byte, err error) {
 | 
					func (m *GetWA0GIRequest) Marshal() (dAtA []byte, err error) {
 | 
				
			||||||
@ -438,17 +440,15 @@ func (m *MinterSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 | 
				
			|||||||
	_ = i
 | 
						_ = i
 | 
				
			||||||
	var l int
 | 
						var l int
 | 
				
			||||||
	_ = l
 | 
						_ = l
 | 
				
			||||||
	if len(m.Supply) > 0 {
 | 
						if m.Supply != nil {
 | 
				
			||||||
		i -= len(m.Supply)
 | 
							{
 | 
				
			||||||
		copy(dAtA[i:], m.Supply)
 | 
								size, err := m.Supply.MarshalToSizedBuffer(dAtA[:i])
 | 
				
			||||||
		i = encodeVarintQuery(dAtA, i, uint64(len(m.Supply)))
 | 
								if err != nil {
 | 
				
			||||||
		i--
 | 
									return 0, err
 | 
				
			||||||
		dAtA[i] = 0x12
 | 
								}
 | 
				
			||||||
	}
 | 
								i -= size
 | 
				
			||||||
	if len(m.Cap) > 0 {
 | 
								i = encodeVarintQuery(dAtA, i, uint64(size))
 | 
				
			||||||
		i -= len(m.Cap)
 | 
							}
 | 
				
			||||||
		copy(dAtA[i:], m.Cap)
 | 
					 | 
				
			||||||
		i = encodeVarintQuery(dAtA, i, uint64(len(m.Cap)))
 | 
					 | 
				
			||||||
		i--
 | 
							i--
 | 
				
			||||||
		dAtA[i] = 0xa
 | 
							dAtA[i] = 0xa
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -507,12 +507,8 @@ func (m *MinterSupplyResponse) Size() (n int) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	var l int
 | 
						var l int
 | 
				
			||||||
	_ = l
 | 
						_ = l
 | 
				
			||||||
	l = len(m.Cap)
 | 
						if m.Supply != nil {
 | 
				
			||||||
	if l > 0 {
 | 
							l = m.Supply.Size()
 | 
				
			||||||
		n += 1 + l + sovQuery(uint64(l))
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	l = len(m.Supply)
 | 
					 | 
				
			||||||
	if l > 0 {
 | 
					 | 
				
			||||||
		n += 1 + l + sovQuery(uint64(l))
 | 
							n += 1 + l + sovQuery(uint64(l))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return n
 | 
						return n
 | 
				
			||||||
@ -772,44 +768,10 @@ func (m *MinterSupplyResponse) Unmarshal(dAtA []byte) error {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		switch fieldNum {
 | 
							switch fieldNum {
 | 
				
			||||||
		case 1:
 | 
							case 1:
 | 
				
			||||||
			if wireType != 2 {
 | 
					 | 
				
			||||||
				return fmt.Errorf("proto: wrong wireType = %d for field Cap", wireType)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			var byteLen int
 | 
					 | 
				
			||||||
			for shift := uint(0); ; shift += 7 {
 | 
					 | 
				
			||||||
				if shift >= 64 {
 | 
					 | 
				
			||||||
					return ErrIntOverflowQuery
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				if iNdEx >= l {
 | 
					 | 
				
			||||||
					return io.ErrUnexpectedEOF
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				b := dAtA[iNdEx]
 | 
					 | 
				
			||||||
				iNdEx++
 | 
					 | 
				
			||||||
				byteLen |= int(b&0x7F) << shift
 | 
					 | 
				
			||||||
				if b < 0x80 {
 | 
					 | 
				
			||||||
					break
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if byteLen < 0 {
 | 
					 | 
				
			||||||
				return ErrInvalidLengthQuery
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			postIndex := iNdEx + byteLen
 | 
					 | 
				
			||||||
			if postIndex < 0 {
 | 
					 | 
				
			||||||
				return ErrInvalidLengthQuery
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if postIndex > l {
 | 
					 | 
				
			||||||
				return io.ErrUnexpectedEOF
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			m.Cap = append(m.Cap[:0], dAtA[iNdEx:postIndex]...)
 | 
					 | 
				
			||||||
			if m.Cap == nil {
 | 
					 | 
				
			||||||
				m.Cap = []byte{}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			iNdEx = postIndex
 | 
					 | 
				
			||||||
		case 2:
 | 
					 | 
				
			||||||
			if wireType != 2 {
 | 
								if wireType != 2 {
 | 
				
			||||||
				return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType)
 | 
									return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			var byteLen int
 | 
								var msglen int
 | 
				
			||||||
			for shift := uint(0); ; shift += 7 {
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
				if shift >= 64 {
 | 
									if shift >= 64 {
 | 
				
			||||||
					return ErrIntOverflowQuery
 | 
										return ErrIntOverflowQuery
 | 
				
			||||||
@ -819,24 +781,26 @@ func (m *MinterSupplyResponse) Unmarshal(dAtA []byte) error {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
				b := dAtA[iNdEx]
 | 
									b := dAtA[iNdEx]
 | 
				
			||||||
				iNdEx++
 | 
									iNdEx++
 | 
				
			||||||
				byteLen |= int(b&0x7F) << shift
 | 
									msglen |= int(b&0x7F) << shift
 | 
				
			||||||
				if b < 0x80 {
 | 
									if b < 0x80 {
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if byteLen < 0 {
 | 
								if msglen < 0 {
 | 
				
			||||||
				return ErrInvalidLengthQuery
 | 
									return ErrInvalidLengthQuery
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			postIndex := iNdEx + byteLen
 | 
								postIndex := iNdEx + msglen
 | 
				
			||||||
			if postIndex < 0 {
 | 
								if postIndex < 0 {
 | 
				
			||||||
				return ErrInvalidLengthQuery
 | 
									return ErrInvalidLengthQuery
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if postIndex > l {
 | 
								if postIndex > l {
 | 
				
			||||||
				return io.ErrUnexpectedEOF
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			m.Supply = append(m.Supply[:0], dAtA[iNdEx:postIndex]...)
 | 
					 | 
				
			||||||
			if m.Supply == nil {
 | 
								if m.Supply == nil {
 | 
				
			||||||
				m.Supply = []byte{}
 | 
									m.Supply = &Supply{}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			iNdEx = postIndex
 | 
								iNdEx = postIndex
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
 | 
					// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
 | 
				
			||||||
// source: zgc/wrappeda0gibase/query.proto
 | 
					// source: zgc/wrappeda0gibase/v1/query.proto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
Package types is a reverse proxy.
 | 
					Package types is a reverse proxy.
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
					// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
				
			||||||
// source: zgc/wrappeda0gibase/tx.proto
 | 
					// source: zgc/wrappeda0gibase/v1/tx.proto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package types
 | 
					package types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -39,7 +39,7 @@ func (m *MsgSetWA0GI) Reset()         { *m = MsgSetWA0GI{} }
 | 
				
			|||||||
func (m *MsgSetWA0GI) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgSetWA0GI) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgSetWA0GI) ProtoMessage()    {}
 | 
					func (*MsgSetWA0GI) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgSetWA0GI) Descriptor() ([]byte, []int) {
 | 
					func (*MsgSetWA0GI) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{0}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{0}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgSetWA0GI) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgSetWA0GI) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -75,7 +75,7 @@ func (m *MsgSetWA0GIResponse) Reset()         { *m = MsgSetWA0GIResponse{} }
 | 
				
			|||||||
func (m *MsgSetWA0GIResponse) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgSetWA0GIResponse) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgSetWA0GIResponse) ProtoMessage()    {}
 | 
					func (*MsgSetWA0GIResponse) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgSetWA0GIResponse) Descriptor() ([]byte, []int) {
 | 
					func (*MsgSetWA0GIResponse) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{1}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{1}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgSetWA0GIResponse) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgSetWA0GIResponse) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -105,16 +105,17 @@ func (m *MsgSetWA0GIResponse) XXX_DiscardUnknown() {
 | 
				
			|||||||
var xxx_messageInfo_MsgSetWA0GIResponse proto.InternalMessageInfo
 | 
					var xxx_messageInfo_MsgSetWA0GIResponse proto.InternalMessageInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type MsgSetMinterCap struct {
 | 
					type MsgSetMinterCap struct {
 | 
				
			||||||
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
 | 
						Authority     string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
 | 
				
			||||||
	Minter    []byte `protobuf:"bytes,2,opt,name=minter,proto3" json:"minter,omitempty"`
 | 
						Minter        []byte `protobuf:"bytes,2,opt,name=minter,proto3" json:"minter,omitempty"`
 | 
				
			||||||
	Cap       []byte `protobuf:"bytes,3,opt,name=cap,proto3" json:"cap,omitempty"`
 | 
						Cap           []byte `protobuf:"bytes,3,opt,name=cap,proto3" json:"cap,omitempty"`
 | 
				
			||||||
 | 
						InitialSupply []byte `protobuf:"bytes,4,opt,name=initialSupply,proto3" json:"initialSupply,omitempty"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (m *MsgSetMinterCap) Reset()         { *m = MsgSetMinterCap{} }
 | 
					func (m *MsgSetMinterCap) Reset()         { *m = MsgSetMinterCap{} }
 | 
				
			||||||
func (m *MsgSetMinterCap) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgSetMinterCap) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgSetMinterCap) ProtoMessage()    {}
 | 
					func (*MsgSetMinterCap) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgSetMinterCap) Descriptor() ([]byte, []int) {
 | 
					func (*MsgSetMinterCap) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{2}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{2}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgSetMinterCap) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgSetMinterCap) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -150,7 +151,7 @@ func (m *MsgSetMinterCapResponse) Reset()         { *m = MsgSetMinterCapResponse
 | 
				
			|||||||
func (m *MsgSetMinterCapResponse) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgSetMinterCapResponse) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgSetMinterCapResponse) ProtoMessage()    {}
 | 
					func (*MsgSetMinterCapResponse) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgSetMinterCapResponse) Descriptor() ([]byte, []int) {
 | 
					func (*MsgSetMinterCapResponse) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{3}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{3}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgSetMinterCapResponse) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgSetMinterCapResponse) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -188,7 +189,7 @@ func (m *MsgMint) Reset()         { *m = MsgMint{} }
 | 
				
			|||||||
func (m *MsgMint) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgMint) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgMint) ProtoMessage()    {}
 | 
					func (*MsgMint) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgMint) Descriptor() ([]byte, []int) {
 | 
					func (*MsgMint) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{4}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{4}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgMint) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgMint) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -224,7 +225,7 @@ func (m *MsgMintResponse) Reset()         { *m = MsgMintResponse{} }
 | 
				
			|||||||
func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgMintResponse) ProtoMessage()    {}
 | 
					func (*MsgMintResponse) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgMintResponse) Descriptor() ([]byte, []int) {
 | 
					func (*MsgMintResponse) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{5}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{5}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -262,7 +263,7 @@ func (m *MsgBurn) Reset()         { *m = MsgBurn{} }
 | 
				
			|||||||
func (m *MsgBurn) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgBurn) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgBurn) ProtoMessage()    {}
 | 
					func (*MsgBurn) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgBurn) Descriptor() ([]byte, []int) {
 | 
					func (*MsgBurn) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{6}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{6}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgBurn) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgBurn) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -298,7 +299,7 @@ func (m *MsgBurnResponse) Reset()         { *m = MsgBurnResponse{} }
 | 
				
			|||||||
func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) }
 | 
					func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
func (*MsgBurnResponse) ProtoMessage()    {}
 | 
					func (*MsgBurnResponse) ProtoMessage()    {}
 | 
				
			||||||
func (*MsgBurnResponse) Descriptor() ([]byte, []int) {
 | 
					func (*MsgBurnResponse) Descriptor() ([]byte, []int) {
 | 
				
			||||||
	return fileDescriptor_f80bf93a1fc022d3, []int{7}
 | 
						return fileDescriptor_8ad0b49b2e65b5cc, []int{7}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error {
 | 
					func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
	return m.Unmarshal(b)
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
@ -328,47 +329,49 @@ func (m *MsgBurnResponse) XXX_DiscardUnknown() {
 | 
				
			|||||||
var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo
 | 
					var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	proto.RegisterType((*MsgSetWA0GI)(nil), "zgc.wrappeda0gibase.MsgSetWA0GI")
 | 
						proto.RegisterType((*MsgSetWA0GI)(nil), "zgc.wrappeda0gibase.v1.MsgSetWA0GI")
 | 
				
			||||||
	proto.RegisterType((*MsgSetWA0GIResponse)(nil), "zgc.wrappeda0gibase.MsgSetWA0GIResponse")
 | 
						proto.RegisterType((*MsgSetWA0GIResponse)(nil), "zgc.wrappeda0gibase.v1.MsgSetWA0GIResponse")
 | 
				
			||||||
	proto.RegisterType((*MsgSetMinterCap)(nil), "zgc.wrappeda0gibase.MsgSetMinterCap")
 | 
						proto.RegisterType((*MsgSetMinterCap)(nil), "zgc.wrappeda0gibase.v1.MsgSetMinterCap")
 | 
				
			||||||
	proto.RegisterType((*MsgSetMinterCapResponse)(nil), "zgc.wrappeda0gibase.MsgSetMinterCapResponse")
 | 
						proto.RegisterType((*MsgSetMinterCapResponse)(nil), "zgc.wrappeda0gibase.v1.MsgSetMinterCapResponse")
 | 
				
			||||||
	proto.RegisterType((*MsgMint)(nil), "zgc.wrappeda0gibase.MsgMint")
 | 
						proto.RegisterType((*MsgMint)(nil), "zgc.wrappeda0gibase.v1.MsgMint")
 | 
				
			||||||
	proto.RegisterType((*MsgMintResponse)(nil), "zgc.wrappeda0gibase.MsgMintResponse")
 | 
						proto.RegisterType((*MsgMintResponse)(nil), "zgc.wrappeda0gibase.v1.MsgMintResponse")
 | 
				
			||||||
	proto.RegisterType((*MsgBurn)(nil), "zgc.wrappeda0gibase.MsgBurn")
 | 
						proto.RegisterType((*MsgBurn)(nil), "zgc.wrappeda0gibase.v1.MsgBurn")
 | 
				
			||||||
	proto.RegisterType((*MsgBurnResponse)(nil), "zgc.wrappeda0gibase.MsgBurnResponse")
 | 
						proto.RegisterType((*MsgBurnResponse)(nil), "zgc.wrappeda0gibase.v1.MsgBurnResponse")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() { proto.RegisterFile("zgc/wrappeda0gibase/tx.proto", fileDescriptor_f80bf93a1fc022d3) }
 | 
					func init() { proto.RegisterFile("zgc/wrappeda0gibase/v1/tx.proto", fileDescriptor_8ad0b49b2e65b5cc) }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var fileDescriptor_f80bf93a1fc022d3 = []byte{
 | 
					var fileDescriptor_8ad0b49b2e65b5cc = []byte{
 | 
				
			||||||
	// 419 bytes of a gzipped FileDescriptorProto
 | 
						// 450 bytes of a gzipped FileDescriptorProto
 | 
				
			||||||
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xc1, 0xae, 0xd2, 0x40,
 | 
						0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x4f, 0x6f, 0xd3, 0x30,
 | 
				
			||||||
	0x14, 0x86, 0x5b, 0x30, 0x20, 0x23, 0x89, 0x5a, 0x14, 0x4b, 0x43, 0x1a, 0xd2, 0xb0, 0x60, 0x21,
 | 
						0x14, 0x6f, 0xd6, 0xa9, 0x63, 0x8f, 0x21, 0x20, 0x40, 0x49, 0x23, 0x94, 0x4d, 0x01, 0x69, 0x93,
 | 
				
			||||||
	0x9d, 0x46, 0xdd, 0xb8, 0x14, 0x63, 0x8c, 0x26, 0xdd, 0xd4, 0x44, 0xa3, 0x1b, 0x33, 0x2d, 0xe3,
 | 
						0x50, 0xe3, 0x0e, 0xb8, 0x70, 0x64, 0x08, 0x21, 0x0e, 0x95, 0x50, 0x77, 0x40, 0x42, 0x48, 0xc8,
 | 
				
			||||||
	0xd0, 0x84, 0x76, 0x9a, 0xce, 0x34, 0x02, 0x4f, 0xe1, 0x63, 0xb1, 0x64, 0xa9, 0x3b, 0x2f, 0xbc,
 | 
						0x49, 0x8d, 0x6b, 0x29, 0x89, 0xad, 0xd8, 0x19, 0xcb, 0x2e, 0x7c, 0x05, 0x3e, 0xd6, 0x8e, 0x3b,
 | 
				
			||||||
	0xc8, 0xcd, 0x4c, 0x69, 0x6f, 0x21, 0x17, 0xb8, 0xb9, 0xbb, 0x39, 0xff, 0xf9, 0xcf, 0x77, 0x9a,
 | 
						0x72, 0x84, 0xf6, 0x13, 0xf0, 0x0d, 0x90, 0x9d, 0x26, 0xa4, 0x15, 0xca, 0x2a, 0x6e, 0x7e, 0x3f,
 | 
				
			||||||
	0xbf, 0x39, 0xa0, 0xbf, 0x22, 0x01, 0xfc, 0x9d, 0xa2, 0x24, 0xc1, 0x53, 0xe4, 0x90, 0xd0, 0x47,
 | 
						0xff, 0xfe, 0xbc, 0x3c, 0xe7, 0xc1, 0xfe, 0x05, 0x8d, 0xd0, 0xd7, 0x0c, 0x0b, 0x41, 0xa6, 0x78,
 | 
				
			||||||
	0x0c, 0x43, 0xbe, 0xb0, 0x93, 0x94, 0x72, 0xaa, 0x75, 0x56, 0x24, 0xb0, 0x8f, 0xba, 0x46, 0x2f,
 | 
						0x44, 0x59, 0x88, 0x25, 0x41, 0x67, 0xc7, 0x48, 0x9d, 0x07, 0x22, 0xe3, 0x8a, 0xdb, 0xfd, 0x0b,
 | 
				
			||||||
	0xa0, 0x2c, 0xa2, 0xec, 0xa7, 0xb4, 0xc0, 0xbc, 0xc8, 0xfd, 0xc6, 0x33, 0x42, 0x09, 0xcd, 0x75,
 | 
						0x1a, 0x05, 0x6b, 0x84, 0xe0, 0xec, 0xd8, 0x1d, 0x44, 0x5c, 0x26, 0x5c, 0x7e, 0x36, 0x2c, 0x54,
 | 
				
			||||||
	0xf1, 0xda, 0xab, 0x3d, 0x42, 0x29, 0x99, 0x63, 0x28, 0x2b, 0x3f, 0xfb, 0x05, 0x51, 0xbc, 0xcc,
 | 
						0x16, 0xa5, 0xc4, 0xbd, 0x4f, 0x39, 0xe5, 0x25, 0xae, 0x4f, 0x4b, 0x74, 0x40, 0x39, 0xa7, 0x31,
 | 
				
			||||||
	0x5b, 0xd6, 0x07, 0xf0, 0xc8, 0x65, 0xe4, 0x0b, 0xe6, 0xdf, 0xde, 0x39, 0x1f, 0x3f, 0x69, 0x7d,
 | 
						0x41, 0xa6, 0x0a, 0xf3, 0x2f, 0x08, 0xa7, 0x45, 0x79, 0xe5, 0xbf, 0x81, 0x9b, 0x63, 0x49, 0x4f,
 | 
				
			||||||
	0xd0, 0x42, 0x19, 0x9f, 0xd1, 0x34, 0xe4, 0x4b, 0x5d, 0x1d, 0xa8, 0xa3, 0x96, 0x77, 0x23, 0x68,
 | 
						0x89, 0xfa, 0xf0, 0x6a, 0xf4, 0xf6, 0x9d, 0xfd, 0x08, 0x76, 0x71, 0xae, 0x66, 0x3c, 0x63, 0xaa,
 | 
				
			||||||
	0x3a, 0x68, 0xa2, 0xe9, 0x34, 0xc5, 0x8c, 0xe9, 0xb5, 0x81, 0x3a, 0x6a, 0x7b, 0x45, 0x69, 0x3d,
 | 
						0x70, 0xac, 0x03, 0xeb, 0x68, 0x77, 0xf2, 0x17, 0xb0, 0x1d, 0xd8, 0xc1, 0xd3, 0x69, 0x46, 0xa4,
 | 
				
			||||||
	0x07, 0x9d, 0x0a, 0xc6, 0xc3, 0x2c, 0xa1, 0x31, 0xc3, 0xd6, 0x77, 0xf0, 0x38, 0x97, 0xdd, 0x30,
 | 
						0x74, 0xb6, 0x0e, 0xac, 0xa3, 0xbd, 0x49, 0x55, 0xfa, 0x0f, 0xe0, 0x5e, 0xc3, 0x66, 0x42, 0xa4,
 | 
				
			||||||
	0xe6, 0x38, 0x7d, 0x8f, 0x92, 0x0b, 0x1b, 0xba, 0xa0, 0x11, 0x49, 0xeb, 0x7e, 0xc1, 0xbe, 0xd2,
 | 
						0xe0, 0xa9, 0x24, 0xfe, 0x37, 0xb8, 0x5d, 0xc2, 0x63, 0x96, 0x2a, 0x92, 0xbd, 0xc6, 0xe2, 0x9a,
 | 
				
			||||||
	0x9e, 0x80, 0x7a, 0x80, 0x12, 0xbd, 0x2e, 0x45, 0xf1, 0xb4, 0x7a, 0xe0, 0xc5, 0x11, 0xba, 0xdc,
 | 
						0x84, 0x3e, 0xf4, 0x12, 0x43, 0x5d, 0x06, 0x2c, 0x2b, 0xfb, 0x0e, 0x74, 0x23, 0x2c, 0x9c, 0xae,
 | 
				
			||||||
	0xfa, 0x16, 0x34, 0x5d, 0x46, 0x84, 0x5e, 0xe1, 0xa9, 0x07, 0xbc, 0x2e, 0x68, 0xa0, 0x88, 0x66,
 | 
						0x01, 0xf5, 0xd1, 0x7e, 0x02, 0xb7, 0x58, 0xca, 0x14, 0xc3, 0xf1, 0x69, 0x2e, 0x44, 0x5c, 0x38,
 | 
				
			||||||
	0x31, 0x2f, 0xf6, 0xe4, 0x95, 0xf5, 0x54, 0x7e, 0xb0, 0x18, 0x3d, 0xa2, 0x4d, 0xb2, 0x34, 0xbe,
 | 
						0xdb, 0xe6, 0x6e, 0x15, 0xf4, 0x07, 0xf0, 0x70, 0xad, 0x81, 0xba, 0xb7, 0x97, 0xb0, 0x33, 0x96,
 | 
				
			||||||
	0x27, 0x4d, 0x8c, 0x16, 0xb4, 0x57, 0xff, 0x6a, 0xa0, 0xee, 0x32, 0xa2, 0x7d, 0x05, 0x0f, 0xcb,
 | 
						0x54, 0xe3, 0x8d, 0x54, 0x6b, 0x25, 0xb5, 0x0f, 0x3d, 0x9c, 0xf0, 0x3c, 0x55, 0x55, 0x37, 0x65,
 | 
				
			||||||
	0xd0, 0x07, 0xf6, 0x2d, 0x7f, 0xd9, 0xae, 0xe4, 0x69, 0x8c, 0x2e, 0x39, 0x0a, 0xbe, 0xe6, 0x83,
 | 
						0xe5, 0xdf, 0x35, 0x9f, 0xa5, 0xa5, 0x6b, 0x6e, 0x27, 0x79, 0x96, 0xfe, 0xa7, 0x9b, 0x96, 0x56,
 | 
				
			||||||
	0xf6, 0x41, 0xdc, 0xc3, 0x33, 0x93, 0xa5, 0xcb, 0x78, 0x79, 0x17, 0x57, 0xb9, 0xe3, 0x33, 0x78,
 | 
						0x6e, 0xcf, 0x7e, 0x6f, 0x41, 0x77, 0x2c, 0xa9, 0xfd, 0x09, 0x6e, 0xd4, 0x4f, 0xf3, 0x38, 0xf8,
 | 
				
			||||||
	0x20, 0xc3, 0xed, 0x9f, 0x9a, 0x12, 0x5d, 0x63, 0x78, 0xae, 0x5b, 0x65, 0xc9, 0x68, 0x4f, 0xb2,
 | 
						0xf7, 0xef, 0x10, 0x34, 0x06, 0xef, 0x3e, 0xdd, 0x80, 0x54, 0xa5, 0xd8, 0x33, 0xd8, 0x5b, 0x79,
 | 
				
			||||||
	0x44, 0xf7, 0x34, 0xab, 0x9a, 0xed, 0xc4, 0x5b, 0x5f, 0x99, 0xca, 0x7a, 0x6b, 0xaa, 0x9b, 0xad,
 | 
						0x9a, 0xc3, 0x76, 0x71, 0x4d, 0x74, 0xd1, 0x86, 0xc4, 0x3a, 0xe9, 0x3d, 0x6c, 0x9b, 0x41, 0xef,
 | 
				
			||||||
	0xa9, 0xfe, 0xdf, 0x9a, 0xea, 0x9f, 0x9d, 0xa9, 0x6c, 0x76, 0xa6, 0xf2, 0x77, 0x67, 0x2a, 0x3f,
 | 
						0xb7, 0x08, 0x35, 0xc1, 0x3d, 0xbc, 0x86, 0xd0, 0x74, 0x34, 0xc3, 0x6e, 0x73, 0xd4, 0x84, 0x56,
 | 
				
			||||||
	0xde, 0x90, 0x90, 0xcf, 0x32, 0xdf, 0x0e, 0x68, 0x04, 0x1d, 0x32, 0x47, 0x3e, 0x83, 0x0e, 0x19,
 | 
						0xc7, 0xe6, 0xcc, 0x4f, 0x26, 0x97, 0xbf, 0xbc, 0xce, 0xe5, 0xdc, 0xb3, 0xae, 0xe6, 0x9e, 0xf5,
 | 
				
			||||||
	0x07, 0x33, 0x14, 0xc6, 0x70, 0x51, 0x5c, 0xe0, 0x58, 0xc0, 0xc7, 0xf9, 0x0d, 0x2e, 0x13, 0xcc,
 | 
						0x73, 0xee, 0x59, 0xdf, 0x17, 0x5e, 0xe7, 0x6a, 0xe1, 0x75, 0x7e, 0x2c, 0xbc, 0xce, 0xc7, 0x17,
 | 
				
			||||||
	0xfc, 0x86, 0x3c, 0x93, 0xd7, 0xd7, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x07, 0x50, 0x07, 0xa7,
 | 
						0x94, 0xa9, 0x59, 0x1e, 0x06, 0x11, 0x4f, 0xd0, 0x88, 0xc6, 0x38, 0x94, 0x68, 0x44, 0x87, 0xd1,
 | 
				
			||||||
	0x03, 0x00, 0x00,
 | 
						0x0c, 0xb3, 0x14, 0x9d, 0x57, 0x5b, 0x3c, 0xd4, 0xfe, 0x43, 0xb3, 0xc7, 0xaa, 0x10, 0x44, 0x86,
 | 
				
			||||||
 | 
						0x3d, 0xb3, 0x64, 0xcf, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x6b, 0x2f, 0x78, 0xeb, 0x03,
 | 
				
			||||||
 | 
						0x00, 0x00,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Reference imports to suppress errors if they are not otherwise used.
 | 
					// Reference imports to suppress errors if they are not otherwise used.
 | 
				
			||||||
@ -399,7 +402,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *msgClient) SetWA0GI(ctx context.Context, in *MsgSetWA0GI, opts ...grpc.CallOption) (*MsgSetWA0GIResponse, error) {
 | 
					func (c *msgClient) SetWA0GI(ctx context.Context, in *MsgSetWA0GI, opts ...grpc.CallOption) (*MsgSetWA0GIResponse, error) {
 | 
				
			||||||
	out := new(MsgSetWA0GIResponse)
 | 
						out := new(MsgSetWA0GIResponse)
 | 
				
			||||||
	err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/SetWA0GI", in, out, opts...)
 | 
						err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.v1.Msg/SetWA0GI", in, out, opts...)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -408,7 +411,7 @@ func (c *msgClient) SetWA0GI(ctx context.Context, in *MsgSetWA0GI, opts ...grpc.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *msgClient) SetMinterCap(ctx context.Context, in *MsgSetMinterCap, opts ...grpc.CallOption) (*MsgSetMinterCapResponse, error) {
 | 
					func (c *msgClient) SetMinterCap(ctx context.Context, in *MsgSetMinterCap, opts ...grpc.CallOption) (*MsgSetMinterCapResponse, error) {
 | 
				
			||||||
	out := new(MsgSetMinterCapResponse)
 | 
						out := new(MsgSetMinterCapResponse)
 | 
				
			||||||
	err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/SetMinterCap", in, out, opts...)
 | 
						err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.v1.Msg/SetMinterCap", in, out, opts...)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -417,7 +420,7 @@ func (c *msgClient) SetMinterCap(ctx context.Context, in *MsgSetMinterCap, opts
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) {
 | 
					func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) {
 | 
				
			||||||
	out := new(MsgMintResponse)
 | 
						out := new(MsgMintResponse)
 | 
				
			||||||
	err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/Mint", in, out, opts...)
 | 
						err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.v1.Msg/Mint", in, out, opts...)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -426,7 +429,7 @@ func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOpti
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) {
 | 
					func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) {
 | 
				
			||||||
	out := new(MsgBurnResponse)
 | 
						out := new(MsgBurnResponse)
 | 
				
			||||||
	err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/Burn", in, out, opts...)
 | 
						err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.v1.Msg/Burn", in, out, opts...)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -472,7 +475,7 @@ func _Msg_SetWA0GI_Handler(srv interface{}, ctx context.Context, dec func(interf
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	info := &grpc.UnaryServerInfo{
 | 
						info := &grpc.UnaryServerInfo{
 | 
				
			||||||
		Server:     srv,
 | 
							Server:     srv,
 | 
				
			||||||
		FullMethod: "/zgc.wrappeda0gibase.Msg/SetWA0GI",
 | 
							FullMethod: "/zgc.wrappeda0gibase.v1.Msg/SetWA0GI",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
				
			||||||
		return srv.(MsgServer).SetWA0GI(ctx, req.(*MsgSetWA0GI))
 | 
							return srv.(MsgServer).SetWA0GI(ctx, req.(*MsgSetWA0GI))
 | 
				
			||||||
@ -490,7 +493,7 @@ func _Msg_SetMinterCap_Handler(srv interface{}, ctx context.Context, dec func(in
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	info := &grpc.UnaryServerInfo{
 | 
						info := &grpc.UnaryServerInfo{
 | 
				
			||||||
		Server:     srv,
 | 
							Server:     srv,
 | 
				
			||||||
		FullMethod: "/zgc.wrappeda0gibase.Msg/SetMinterCap",
 | 
							FullMethod: "/zgc.wrappeda0gibase.v1.Msg/SetMinterCap",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
				
			||||||
		return srv.(MsgServer).SetMinterCap(ctx, req.(*MsgSetMinterCap))
 | 
							return srv.(MsgServer).SetMinterCap(ctx, req.(*MsgSetMinterCap))
 | 
				
			||||||
@ -508,7 +511,7 @@ func _Msg_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	info := &grpc.UnaryServerInfo{
 | 
						info := &grpc.UnaryServerInfo{
 | 
				
			||||||
		Server:     srv,
 | 
							Server:     srv,
 | 
				
			||||||
		FullMethod: "/zgc.wrappeda0gibase.Msg/Mint",
 | 
							FullMethod: "/zgc.wrappeda0gibase.v1.Msg/Mint",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
				
			||||||
		return srv.(MsgServer).Mint(ctx, req.(*MsgMint))
 | 
							return srv.(MsgServer).Mint(ctx, req.(*MsgMint))
 | 
				
			||||||
@ -526,7 +529,7 @@ func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	info := &grpc.UnaryServerInfo{
 | 
						info := &grpc.UnaryServerInfo{
 | 
				
			||||||
		Server:     srv,
 | 
							Server:     srv,
 | 
				
			||||||
		FullMethod: "/zgc.wrappeda0gibase.Msg/Burn",
 | 
							FullMethod: "/zgc.wrappeda0gibase.v1.Msg/Burn",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
				
			||||||
		return srv.(MsgServer).Burn(ctx, req.(*MsgBurn))
 | 
							return srv.(MsgServer).Burn(ctx, req.(*MsgBurn))
 | 
				
			||||||
@ -535,7 +538,7 @@ func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var _Msg_serviceDesc = grpc.ServiceDesc{
 | 
					var _Msg_serviceDesc = grpc.ServiceDesc{
 | 
				
			||||||
	ServiceName: "zgc.wrappeda0gibase.Msg",
 | 
						ServiceName: "zgc.wrappeda0gibase.v1.Msg",
 | 
				
			||||||
	HandlerType: (*MsgServer)(nil),
 | 
						HandlerType: (*MsgServer)(nil),
 | 
				
			||||||
	Methods: []grpc.MethodDesc{
 | 
						Methods: []grpc.MethodDesc{
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@ -556,7 +559,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
 | 
				
			|||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	Streams:  []grpc.StreamDesc{},
 | 
						Streams:  []grpc.StreamDesc{},
 | 
				
			||||||
	Metadata: "zgc/wrappeda0gibase/tx.proto",
 | 
						Metadata: "zgc/wrappeda0gibase/v1/tx.proto",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (m *MsgSetWA0GI) Marshal() (dAtA []byte, err error) {
 | 
					func (m *MsgSetWA0GI) Marshal() (dAtA []byte, err error) {
 | 
				
			||||||
@ -639,6 +642,13 @@ func (m *MsgSetMinterCap) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 | 
				
			|||||||
	_ = i
 | 
						_ = i
 | 
				
			||||||
	var l int
 | 
						var l int
 | 
				
			||||||
	_ = l
 | 
						_ = l
 | 
				
			||||||
 | 
						if len(m.InitialSupply) > 0 {
 | 
				
			||||||
 | 
							i -= len(m.InitialSupply)
 | 
				
			||||||
 | 
							copy(dAtA[i:], m.InitialSupply)
 | 
				
			||||||
 | 
							i = encodeVarintTx(dAtA, i, uint64(len(m.InitialSupply)))
 | 
				
			||||||
 | 
							i--
 | 
				
			||||||
 | 
							dAtA[i] = 0x22
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if len(m.Cap) > 0 {
 | 
						if len(m.Cap) > 0 {
 | 
				
			||||||
		i -= len(m.Cap)
 | 
							i -= len(m.Cap)
 | 
				
			||||||
		copy(dAtA[i:], m.Cap)
 | 
							copy(dAtA[i:], m.Cap)
 | 
				
			||||||
@ -861,6 +871,10 @@ func (m *MsgSetMinterCap) Size() (n int) {
 | 
				
			|||||||
	if l > 0 {
 | 
						if l > 0 {
 | 
				
			||||||
		n += 1 + l + sovTx(uint64(l))
 | 
							n += 1 + l + sovTx(uint64(l))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						l = len(m.InitialSupply)
 | 
				
			||||||
 | 
						if l > 0 {
 | 
				
			||||||
 | 
							n += 1 + l + sovTx(uint64(l))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return n
 | 
						return n
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1226,6 +1240,40 @@ func (m *MsgSetMinterCap) Unmarshal(dAtA []byte) error {
 | 
				
			|||||||
				m.Cap = []byte{}
 | 
									m.Cap = []byte{}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			iNdEx = postIndex
 | 
								iNdEx = postIndex
 | 
				
			||||||
 | 
							case 4:
 | 
				
			||||||
 | 
								if wireType != 2 {
 | 
				
			||||||
 | 
									return fmt.Errorf("proto: wrong wireType = %d for field InitialSupply", wireType)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								var byteLen int
 | 
				
			||||||
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
									if shift >= 64 {
 | 
				
			||||||
 | 
										return ErrIntOverflowTx
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if iNdEx >= l {
 | 
				
			||||||
 | 
										return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									b := dAtA[iNdEx]
 | 
				
			||||||
 | 
									iNdEx++
 | 
				
			||||||
 | 
									byteLen |= int(b&0x7F) << shift
 | 
				
			||||||
 | 
									if b < 0x80 {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if byteLen < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthTx
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								postIndex := iNdEx + byteLen
 | 
				
			||||||
 | 
								if postIndex < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthTx
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if postIndex > l {
 | 
				
			||||||
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								m.InitialSupply = append(m.InitialSupply[:0], dAtA[iNdEx:postIndex]...)
 | 
				
			||||||
 | 
								if m.InitialSupply == nil {
 | 
				
			||||||
 | 
									m.InitialSupply = []byte{}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								iNdEx = postIndex
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			iNdEx = preIndex
 | 
								iNdEx = preIndex
 | 
				
			||||||
			skippy, err := skipTx(dAtA[iNdEx:])
 | 
								skippy, err := skipTx(dAtA[iNdEx:])
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										416
									
								
								x/wrapped-a0gi-base/types/wrappeda0gibase.pb.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										416
									
								
								x/wrapped-a0gi-base/types/wrappeda0gibase.pb.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,416 @@
 | 
				
			|||||||
 | 
					// Code generated by protoc-gen-gogo. DO NOT EDIT.
 | 
				
			||||||
 | 
					// source: zgc/wrappeda0gibase/v1/wrappeda0gibase.proto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						fmt "fmt"
 | 
				
			||||||
 | 
						_ "github.com/cosmos/cosmos-proto"
 | 
				
			||||||
 | 
						_ "github.com/cosmos/cosmos-sdk/codec/types"
 | 
				
			||||||
 | 
						_ "github.com/cosmos/gogoproto/gogoproto"
 | 
				
			||||||
 | 
						proto "github.com/cosmos/gogoproto/proto"
 | 
				
			||||||
 | 
						_ "google.golang.org/genproto/googleapis/api/annotations"
 | 
				
			||||||
 | 
						_ "google.golang.org/protobuf/types/known/timestamppb"
 | 
				
			||||||
 | 
						io "io"
 | 
				
			||||||
 | 
						math "math"
 | 
				
			||||||
 | 
						math_bits "math/bits"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Reference imports to suppress errors if they are not otherwise used.
 | 
				
			||||||
 | 
					var _ = proto.Marshal
 | 
				
			||||||
 | 
					var _ = fmt.Errorf
 | 
				
			||||||
 | 
					var _ = math.Inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// This is a compile-time assertion to ensure that this generated file
 | 
				
			||||||
 | 
					// is compatible with the proto package it is being compiled against.
 | 
				
			||||||
 | 
					// A compilation error at this line likely means your copy of the
 | 
				
			||||||
 | 
					// proto package needs to be updated.
 | 
				
			||||||
 | 
					const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Supply struct {
 | 
				
			||||||
 | 
						Cap           []byte `protobuf:"bytes,1,opt,name=cap,proto3" json:"cap,omitempty"`
 | 
				
			||||||
 | 
						InitialSupply []byte `protobuf:"bytes,2,opt,name=initialSupply,proto3" json:"initialSupply,omitempty"`
 | 
				
			||||||
 | 
						Supply        []byte `protobuf:"bytes,3,opt,name=supply,proto3" json:"supply,omitempty"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (m *Supply) Reset()         { *m = Supply{} }
 | 
				
			||||||
 | 
					func (m *Supply) String() string { return proto.CompactTextString(m) }
 | 
				
			||||||
 | 
					func (*Supply) ProtoMessage()    {}
 | 
				
			||||||
 | 
					func (*Supply) Descriptor() ([]byte, []int) {
 | 
				
			||||||
 | 
						return fileDescriptor_063c93b02245297e, []int{0}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) XXX_Unmarshal(b []byte) error {
 | 
				
			||||||
 | 
						return m.Unmarshal(b)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
				
			||||||
 | 
						if deterministic {
 | 
				
			||||||
 | 
							return xxx_messageInfo_Supply.Marshal(b, m, deterministic)
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							b = b[:cap(b)]
 | 
				
			||||||
 | 
							n, err := m.MarshalToSizedBuffer(b)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return nil, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return b[:n], nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) XXX_Merge(src proto.Message) {
 | 
				
			||||||
 | 
						xxx_messageInfo_Supply.Merge(m, src)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) XXX_Size() int {
 | 
				
			||||||
 | 
						return m.Size()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) XXX_DiscardUnknown() {
 | 
				
			||||||
 | 
						xxx_messageInfo_Supply.DiscardUnknown(m)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var xxx_messageInfo_Supply proto.InternalMessageInfo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						proto.RegisterType((*Supply)(nil), "zgc.wrappeda0gibase.v1.Supply")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						proto.RegisterFile("zgc/wrappeda0gibase/v1/wrappeda0gibase.proto", fileDescriptor_063c93b02245297e)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var fileDescriptor_063c93b02245297e = []byte{
 | 
				
			||||||
 | 
						// 275 bytes of a gzipped FileDescriptorProto
 | 
				
			||||||
 | 
						0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xc1, 0x4a, 0xf3, 0x40,
 | 
				
			||||||
 | 
						0x14, 0x85, 0x93, 0xbf, 0x90, 0x45, 0xf8, 0x05, 0x09, 0x52, 0xda, 0x22, 0xa3, 0x88, 0x0b, 0x17,
 | 
				
			||||||
 | 
						0x26, 0x93, 0xa2, 0x4f, 0xe0, 0x23, 0xd4, 0x8d, 0xb8, 0x91, 0x9b, 0x71, 0x9c, 0x0e, 0x24, 0x73,
 | 
				
			||||||
 | 
						0x87, 0xce, 0xa4, 0x9a, 0x3e, 0x85, 0x8f, 0xd5, 0x65, 0x97, 0x2e, 0x35, 0x79, 0x11, 0xc9, 0x4c,
 | 
				
			||||||
 | 
						0xba, 0x30, 0xbb, 0x7b, 0xce, 0x77, 0x0e, 0x5c, 0x4e, 0x7c, 0xbb, 0x13, 0x8c, 0xbe, 0x6f, 0x40,
 | 
				
			||||||
 | 
						0x6b, 0xfe, 0x0a, 0xb9, 0x90, 0x05, 0x18, 0x4e, 0xb7, 0xcb, 0xb1, 0x95, 0xe9, 0x0d, 0x5a, 0x4c,
 | 
				
			||||||
 | 
						0xa6, 0x3b, 0xc1, 0xb2, 0x31, 0xda, 0x2e, 0x17, 0x73, 0x86, 0xa6, 0x42, 0xf3, 0xe2, 0x52, 0xd4,
 | 
				
			||||||
 | 
						0x0b, 0x5f, 0x59, 0x9c, 0x09, 0x14, 0xe8, 0xfd, 0xfe, 0x1a, 0xdc, 0x73, 0x81, 0x28, 0x4a, 0x4e,
 | 
				
			||||||
 | 
						0x41, 0x4b, 0x0a, 0x4a, 0xa1, 0x05, 0x2b, 0x51, 0x1d, 0x3b, 0xf3, 0x81, 0x3a, 0x55, 0xd4, 0x6f,
 | 
				
			||||||
 | 
						0x14, 0x54, 0x33, 0xa0, 0x8b, 0x31, 0xb2, 0xb2, 0xe2, 0xc6, 0x42, 0xa5, 0x7d, 0xe0, 0xea, 0x29,
 | 
				
			||||||
 | 
						0x8e, 0x1e, 0x6b, 0xad, 0xcb, 0x26, 0x39, 0x8d, 0x27, 0x0c, 0xf4, 0x2c, 0xbc, 0x0c, 0x6f, 0xfe,
 | 
				
			||||||
 | 
						0xaf, 0xfa, 0x33, 0xb9, 0x8e, 0x4f, 0xa4, 0x92, 0x56, 0x42, 0xe9, 0x23, 0xb3, 0x7f, 0x8e, 0xfd,
 | 
				
			||||||
 | 
						0x35, 0x93, 0x69, 0x1c, 0x19, 0x8f, 0x27, 0x0e, 0x0f, 0xea, 0x61, 0xb5, 0xff, 0x21, 0xc1, 0xbe,
 | 
				
			||||||
 | 
						0x25, 0xe1, 0xa1, 0x25, 0xe1, 0x77, 0x4b, 0xc2, 0xcf, 0x8e, 0x04, 0x87, 0x8e, 0x04, 0x5f, 0x1d,
 | 
				
			||||||
 | 
						0x09, 0x9e, 0xef, 0x85, 0xb4, 0xeb, 0xba, 0xc8, 0x18, 0x56, 0x34, 0x17, 0x25, 0x14, 0x86, 0xe6,
 | 
				
			||||||
 | 
						0x22, 0x65, 0x6b, 0x90, 0x8a, 0x7e, 0x1c, 0xe7, 0x4c, 0xfb, 0xd1, 0x52, 0xb7, 0xb1, 0x6d, 0x34,
 | 
				
			||||||
 | 
						0x37, 0x45, 0xe4, 0x9e, 0xbe, 0xfb, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x50, 0x5b, 0x98, 0x87,
 | 
				
			||||||
 | 
						0x01, 0x00, 0x00,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (m *Supply) Marshal() (dAtA []byte, err error) {
 | 
				
			||||||
 | 
						size := m.Size()
 | 
				
			||||||
 | 
						dAtA = make([]byte, size)
 | 
				
			||||||
 | 
						n, err := m.MarshalToSizedBuffer(dAtA[:size])
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return dAtA[:n], nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (m *Supply) MarshalTo(dAtA []byte) (int, error) {
 | 
				
			||||||
 | 
						size := m.Size()
 | 
				
			||||||
 | 
						return m.MarshalToSizedBuffer(dAtA[:size])
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (m *Supply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 | 
				
			||||||
 | 
						i := len(dAtA)
 | 
				
			||||||
 | 
						_ = i
 | 
				
			||||||
 | 
						var l int
 | 
				
			||||||
 | 
						_ = l
 | 
				
			||||||
 | 
						if len(m.Supply) > 0 {
 | 
				
			||||||
 | 
							i -= len(m.Supply)
 | 
				
			||||||
 | 
							copy(dAtA[i:], m.Supply)
 | 
				
			||||||
 | 
							i = encodeVarintWrappeda0Gibase(dAtA, i, uint64(len(m.Supply)))
 | 
				
			||||||
 | 
							i--
 | 
				
			||||||
 | 
							dAtA[i] = 0x1a
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if len(m.InitialSupply) > 0 {
 | 
				
			||||||
 | 
							i -= len(m.InitialSupply)
 | 
				
			||||||
 | 
							copy(dAtA[i:], m.InitialSupply)
 | 
				
			||||||
 | 
							i = encodeVarintWrappeda0Gibase(dAtA, i, uint64(len(m.InitialSupply)))
 | 
				
			||||||
 | 
							i--
 | 
				
			||||||
 | 
							dAtA[i] = 0x12
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if len(m.Cap) > 0 {
 | 
				
			||||||
 | 
							i -= len(m.Cap)
 | 
				
			||||||
 | 
							copy(dAtA[i:], m.Cap)
 | 
				
			||||||
 | 
							i = encodeVarintWrappeda0Gibase(dAtA, i, uint64(len(m.Cap)))
 | 
				
			||||||
 | 
							i--
 | 
				
			||||||
 | 
							dAtA[i] = 0xa
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return len(dAtA) - i, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func encodeVarintWrappeda0Gibase(dAtA []byte, offset int, v uint64) int {
 | 
				
			||||||
 | 
						offset -= sovWrappeda0Gibase(v)
 | 
				
			||||||
 | 
						base := offset
 | 
				
			||||||
 | 
						for v >= 1<<7 {
 | 
				
			||||||
 | 
							dAtA[offset] = uint8(v&0x7f | 0x80)
 | 
				
			||||||
 | 
							v >>= 7
 | 
				
			||||||
 | 
							offset++
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						dAtA[offset] = uint8(v)
 | 
				
			||||||
 | 
						return base
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) Size() (n int) {
 | 
				
			||||||
 | 
						if m == nil {
 | 
				
			||||||
 | 
							return 0
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						var l int
 | 
				
			||||||
 | 
						_ = l
 | 
				
			||||||
 | 
						l = len(m.Cap)
 | 
				
			||||||
 | 
						if l > 0 {
 | 
				
			||||||
 | 
							n += 1 + l + sovWrappeda0Gibase(uint64(l))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						l = len(m.InitialSupply)
 | 
				
			||||||
 | 
						if l > 0 {
 | 
				
			||||||
 | 
							n += 1 + l + sovWrappeda0Gibase(uint64(l))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						l = len(m.Supply)
 | 
				
			||||||
 | 
						if l > 0 {
 | 
				
			||||||
 | 
							n += 1 + l + sovWrappeda0Gibase(uint64(l))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return n
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func sovWrappeda0Gibase(x uint64) (n int) {
 | 
				
			||||||
 | 
						return (math_bits.Len64(x|1) + 6) / 7
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func sozWrappeda0Gibase(x uint64) (n int) {
 | 
				
			||||||
 | 
						return sovWrappeda0Gibase(uint64((x << 1) ^ uint64((int64(x) >> 63))))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (m *Supply) Unmarshal(dAtA []byte) error {
 | 
				
			||||||
 | 
						l := len(dAtA)
 | 
				
			||||||
 | 
						iNdEx := 0
 | 
				
			||||||
 | 
						for iNdEx < l {
 | 
				
			||||||
 | 
							preIndex := iNdEx
 | 
				
			||||||
 | 
							var wire uint64
 | 
				
			||||||
 | 
							for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
								if shift >= 64 {
 | 
				
			||||||
 | 
									return ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if iNdEx >= l {
 | 
				
			||||||
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								b := dAtA[iNdEx]
 | 
				
			||||||
 | 
								iNdEx++
 | 
				
			||||||
 | 
								wire |= uint64(b&0x7F) << shift
 | 
				
			||||||
 | 
								if b < 0x80 {
 | 
				
			||||||
 | 
									break
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							fieldNum := int32(wire >> 3)
 | 
				
			||||||
 | 
							wireType := int(wire & 0x7)
 | 
				
			||||||
 | 
							if wireType == 4 {
 | 
				
			||||||
 | 
								return fmt.Errorf("proto: Supply: wiretype end group for non-group")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if fieldNum <= 0 {
 | 
				
			||||||
 | 
								return fmt.Errorf("proto: Supply: illegal tag %d (wire type %d)", fieldNum, wire)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							switch fieldNum {
 | 
				
			||||||
 | 
							case 1:
 | 
				
			||||||
 | 
								if wireType != 2 {
 | 
				
			||||||
 | 
									return fmt.Errorf("proto: wrong wireType = %d for field Cap", wireType)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								var byteLen int
 | 
				
			||||||
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
									if shift >= 64 {
 | 
				
			||||||
 | 
										return ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if iNdEx >= l {
 | 
				
			||||||
 | 
										return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									b := dAtA[iNdEx]
 | 
				
			||||||
 | 
									iNdEx++
 | 
				
			||||||
 | 
									byteLen |= int(b&0x7F) << shift
 | 
				
			||||||
 | 
									if b < 0x80 {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if byteLen < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								postIndex := iNdEx + byteLen
 | 
				
			||||||
 | 
								if postIndex < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if postIndex > l {
 | 
				
			||||||
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								m.Cap = append(m.Cap[:0], dAtA[iNdEx:postIndex]...)
 | 
				
			||||||
 | 
								if m.Cap == nil {
 | 
				
			||||||
 | 
									m.Cap = []byte{}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								iNdEx = postIndex
 | 
				
			||||||
 | 
							case 2:
 | 
				
			||||||
 | 
								if wireType != 2 {
 | 
				
			||||||
 | 
									return fmt.Errorf("proto: wrong wireType = %d for field InitialSupply", wireType)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								var byteLen int
 | 
				
			||||||
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
									if shift >= 64 {
 | 
				
			||||||
 | 
										return ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if iNdEx >= l {
 | 
				
			||||||
 | 
										return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									b := dAtA[iNdEx]
 | 
				
			||||||
 | 
									iNdEx++
 | 
				
			||||||
 | 
									byteLen |= int(b&0x7F) << shift
 | 
				
			||||||
 | 
									if b < 0x80 {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if byteLen < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								postIndex := iNdEx + byteLen
 | 
				
			||||||
 | 
								if postIndex < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if postIndex > l {
 | 
				
			||||||
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								m.InitialSupply = append(m.InitialSupply[:0], dAtA[iNdEx:postIndex]...)
 | 
				
			||||||
 | 
								if m.InitialSupply == nil {
 | 
				
			||||||
 | 
									m.InitialSupply = []byte{}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								iNdEx = postIndex
 | 
				
			||||||
 | 
							case 3:
 | 
				
			||||||
 | 
								if wireType != 2 {
 | 
				
			||||||
 | 
									return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								var byteLen int
 | 
				
			||||||
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
									if shift >= 64 {
 | 
				
			||||||
 | 
										return ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if iNdEx >= l {
 | 
				
			||||||
 | 
										return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									b := dAtA[iNdEx]
 | 
				
			||||||
 | 
									iNdEx++
 | 
				
			||||||
 | 
									byteLen |= int(b&0x7F) << shift
 | 
				
			||||||
 | 
									if b < 0x80 {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if byteLen < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								postIndex := iNdEx + byteLen
 | 
				
			||||||
 | 
								if postIndex < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if postIndex > l {
 | 
				
			||||||
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								m.Supply = append(m.Supply[:0], dAtA[iNdEx:postIndex]...)
 | 
				
			||||||
 | 
								if m.Supply == nil {
 | 
				
			||||||
 | 
									m.Supply = []byte{}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								iNdEx = postIndex
 | 
				
			||||||
 | 
							default:
 | 
				
			||||||
 | 
								iNdEx = preIndex
 | 
				
			||||||
 | 
								skippy, err := skipWrappeda0Gibase(dAtA[iNdEx:])
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (skippy < 0) || (iNdEx+skippy) < 0 {
 | 
				
			||||||
 | 
									return ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (iNdEx + skippy) > l {
 | 
				
			||||||
 | 
									return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								iNdEx += skippy
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if iNdEx > l {
 | 
				
			||||||
 | 
							return io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func skipWrappeda0Gibase(dAtA []byte) (n int, err error) {
 | 
				
			||||||
 | 
						l := len(dAtA)
 | 
				
			||||||
 | 
						iNdEx := 0
 | 
				
			||||||
 | 
						depth := 0
 | 
				
			||||||
 | 
						for iNdEx < l {
 | 
				
			||||||
 | 
							var wire uint64
 | 
				
			||||||
 | 
							for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
								if shift >= 64 {
 | 
				
			||||||
 | 
									return 0, ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if iNdEx >= l {
 | 
				
			||||||
 | 
									return 0, io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								b := dAtA[iNdEx]
 | 
				
			||||||
 | 
								iNdEx++
 | 
				
			||||||
 | 
								wire |= (uint64(b) & 0x7F) << shift
 | 
				
			||||||
 | 
								if b < 0x80 {
 | 
				
			||||||
 | 
									break
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							wireType := int(wire & 0x7)
 | 
				
			||||||
 | 
							switch wireType {
 | 
				
			||||||
 | 
							case 0:
 | 
				
			||||||
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
									if shift >= 64 {
 | 
				
			||||||
 | 
										return 0, ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if iNdEx >= l {
 | 
				
			||||||
 | 
										return 0, io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									iNdEx++
 | 
				
			||||||
 | 
									if dAtA[iNdEx-1] < 0x80 {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							case 1:
 | 
				
			||||||
 | 
								iNdEx += 8
 | 
				
			||||||
 | 
							case 2:
 | 
				
			||||||
 | 
								var length int
 | 
				
			||||||
 | 
								for shift := uint(0); ; shift += 7 {
 | 
				
			||||||
 | 
									if shift >= 64 {
 | 
				
			||||||
 | 
										return 0, ErrIntOverflowWrappeda0Gibase
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if iNdEx >= l {
 | 
				
			||||||
 | 
										return 0, io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									b := dAtA[iNdEx]
 | 
				
			||||||
 | 
									iNdEx++
 | 
				
			||||||
 | 
									length |= (int(b) & 0x7F) << shift
 | 
				
			||||||
 | 
									if b < 0x80 {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if length < 0 {
 | 
				
			||||||
 | 
									return 0, ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								iNdEx += length
 | 
				
			||||||
 | 
							case 3:
 | 
				
			||||||
 | 
								depth++
 | 
				
			||||||
 | 
							case 4:
 | 
				
			||||||
 | 
								if depth == 0 {
 | 
				
			||||||
 | 
									return 0, ErrUnexpectedEndOfGroupWrappeda0Gibase
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								depth--
 | 
				
			||||||
 | 
							case 5:
 | 
				
			||||||
 | 
								iNdEx += 4
 | 
				
			||||||
 | 
							default:
 | 
				
			||||||
 | 
								return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if iNdEx < 0 {
 | 
				
			||||||
 | 
								return 0, ErrInvalidLengthWrappeda0Gibase
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if depth == 0 {
 | 
				
			||||||
 | 
								return iNdEx, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return 0, io.ErrUnexpectedEOF
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var (
 | 
				
			||||||
 | 
						ErrInvalidLengthWrappeda0Gibase        = fmt.Errorf("proto: negative length found during unmarshaling")
 | 
				
			||||||
 | 
						ErrIntOverflowWrappeda0Gibase          = fmt.Errorf("proto: integer overflow")
 | 
				
			||||||
 | 
						ErrUnexpectedEndOfGroupWrappeda0Gibase = fmt.Errorf("proto: unexpected end of group")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user