Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: allow signerless account registration #18

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Allow accounts with a balance to be registered signerlessly. ([#18](https://github.com/noble-assets/forwarding/pull/18))
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ lint:
### Protobuf ###
###############################################################################

BUF_VERSION=1.31.0
BUILDER_VERSION=0.14.0
BUF_VERSION=1.42
BUILDER_VERSION=0.15.1

proto-all: proto-format proto-lint proto-gen

Expand Down Expand Up @@ -60,7 +60,7 @@ proto-lint:

local-image:
@echo "🤖 Building image..."
@heighliner build --chain noble-forwarding-simd --local 1> /dev/null
@heighliner build --chain noble-forwarding-simd --file ./chains.yaml --local 1> /dev/null
@echo "✅ Completed build!"

test: test-e2e
Expand Down
37 changes: 26 additions & 11 deletions api/noble/forwarding/v1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 24 additions & 10 deletions api/noble/forwarding/v1/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by buf. DO NOT EDIT.
version: v2
deps:
- name: buf.build/cosmos/cosmos-proto
commit: 1935555c206d4afb9e94615dfd0fad31
digest: b5:0a29584117fe6433fa593d03fbda6b3964ddc59b986cd2277833ee01d4ac215a14b0286241462cd0dee6b460a108823dff5c7c42c9c1f4f7df861fcfa4bbebdf
- name: buf.build/cosmos/cosmos-sdk
commit: 5a6ab7bc14314acaa912d5e53aef1c2f
digest: b5:8042fb175299da4ff2bbc9dc8051efbab9d997a2a797d1e7d7feb22c658990894199e1952b1f5965902ce765e3ef48b0c4dbdff423daf5fda5eb646f999c6c96
- name: buf.build/cosmos/gogo-proto
commit: 5e5b9fdd01804356895f8f79a6f1ddc1
digest: b5:fa99e286ee3012cd95902e9889a57392ae87f9def39e11c3f2db66c9ca39f16e513175c1aa40a9a47c18cceadb0ee37c326591eb1bc2c4de0e0ccb72c04929d4
- name: buf.build/googleapis/googleapis
commit: cc916c31859748a68fd229a3c8d7a2e8
digest: b5:3b4e241d18fbebc6b30ff28968527af2cdd618026930d2a9666bbad2868b1aa164d20229477464691bdfd053a77b5c727468039bd1d2b550cb4151ee4c1499fe
3 changes: 0 additions & 3 deletions buf.work.yaml

This file was deleted.

10 changes: 4 additions & 6 deletions proto/buf.yaml → buf.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
version: v1
# yaml-language-server: $schema=https://json.schemastore.org/buf.json
version: v2
modules:
- path: proto
johnletey marked this conversation as resolved.
Show resolved Hide resolved
deps:
- buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31
- buf.build/cosmos/cosmos-sdk:v0.50.0
- buf.build/cosmos/gogo-proto:5e5b9fdd01804356895f8f79a6f1ddc1
- buf.build/googleapis/googleapis:cc916c31859748a68fd229a3c8d7a2e8
breaking:
use:
- FILE
lint:
use:
- DEFAULT
except:
- SERVICE_SUFFIX
- RPC_REQUEST_STANDARD_NAME
Expand Down
28 changes: 28 additions & 0 deletions e2e/forwarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,34 @@ func TestRegisterOnNoble(t *testing.T) {
require.Equal(t, sdk.NewCoins(sdk.NewCoin("uusdc", math.NewInt(1_000_000))), stats.TotalForwarded)
}

func TestRegisterOnNobleSignerlessly(t *testing.T) {
t.Parallel()

ctx, noble, _, _, _, sender, _, receiver := ForwardingSuite(t, nil)
validator := noble.Validators[0]

address, exists := ForwardingAccount(t, ctx, validator, receiver, "")
require.False(t, exists)

require.NoError(t, validator.BankSend(ctx, sender.KeyName(), ibc.WalletAmount{
Address: address,
Denom: "uusdc",
Amount: math.NewInt(1_000_000),
}))

_, exists = ForwardingAccount(t, ctx, validator, receiver, "")
require.False(t, exists)

// NOTE: The keyName argument is intentionally left blank here. If
// everything is working correctly, this shouldn't error as we don't need
// to interact with the keyring.
_, err := validator.ExecTx(ctx, "", "forwarding", "register-account-signerlessly", "channel-0", receiver.FormattedAddress())
require.NoError(t, err)

_, exists = ForwardingAccount(t, ctx, validator, receiver, "")
require.True(t, exists)
}

func TestRegisterViaTransfer(t *testing.T) {
t.Parallel()

Expand Down
Loading