-
Notifications
You must be signed in to change notification settings - Fork 364
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(examples): Define Ownable and Transferrable Interfaces #2198
Draft
linhpn99
wants to merge
81
commits into
gnolang:master
Choose a base branch
from
linhpn99:OwnableInterface
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+102
−39
Draft
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
c307de3
define Ownable and Transferrable Interface for custom
linhpn99 0853491
Update the affected packages
linhpn99 a2e5c69
rename fields
linhpn99 b206494
embed interface instead of implement
linhpn99 fe82cab
update
linhpn99 e457231
update
linhpn99 d0c12d8
wrong name
linhpn99 10a767e
Merge branch 'master' into OwnableInterface
linhpn99 00f4ef0
unused error
linhpn99 1b835d2
Merge branch 'OwnableInterface' of https://github.com/linhpn99/gno in…
linhpn99 0163f8d
make tidy
linhpn99 22b8e27
make tidy again
linhpn99 deb9a29
Merge branch 'master' into OwnableInterface
linhpn99 9a34da6
Merge branch 'master' into OwnableInterface
linhpn99 3f2c0e1
Merge branch 'master' into OwnableInterface
linhpn99 c6ef120
remove helper pkg
linhpn99 cc9cf58
Merge branch 'master' into OwnableInterface
linhpn99 b04aadc
owner to transferrable
linhpn99 07ca903
Merge branch 'OwnableInterface' of https://github.com/linhpn99/gno in…
linhpn99 3b0a77c
tmp
linhpn99 8bd5ec9
tmp
linhpn99 2249f42
change to TestSetOrigCaller
linhpn99 8a8d39c
Merge branch 'master' into OwnableInterface
linhpn99 d51c88d
Merge branch 'master' into OwnableInterface
linhpn99 6764208
Merge branch 'master' into OwnableInterface
linhpn99 5d6dd97
Merge branch 'master' into OwnableInterface
linhpn99 5010520
Merge branch 'master' into OwnableInterface
linhpn99 f66a0f8
Merge branch 'master' into OwnableInterface
linhpn99 ce717f6
use TestSetRealm instead
linhpn99 c987e5e
Merge branch 'master' into OwnableInterface
linhpn99 2da9e4a
Merge branch 'master' into OwnableInterface
linhpn99 e162f4d
Merge branch 'master' into OwnableInterface
linhpn99 cceecb3
Merge branch 'master' into OwnableInterface
linhpn99 b71df38
Merge branch 'master' into OwnableInterface
linhpn99 0f36ba5
Merge branch 'master' into OwnableInterface
linhpn99 525449d
Merge branch 'master' into OwnableInterface
linhpn99 3c459fc
refactor code after manfred's review
linhpn99 4e51027
missing changes
linhpn99 6f97dfe
return interface
linhpn99 a6ca8bc
return interface
linhpn99 4765f37
update
linhpn99 3d19623
update
linhpn99 f5fe77e
rename
linhpn99 8bd3ac0
fixed all
linhpn99 a3dad4c
fixed all
linhpn99 0e7f9d5
fix pausable
linhpn99 e2aadeb
solve conflict
linhpn99 6fd4c2b
wrong delete
linhpn99 6f007f2
Merge branch 'master' into OwnableInterface
linhpn99 6173b88
Merge branch 'master' into OwnableInterface
linhpn99 0cc00c4
update from master
linhpn99 1dbe711
Merge branch 'master' into OwnableInterface
linhpn99 0fcb041
Merge branch 'master' into OwnableInterface
linhpn99 104140f
Merge branch 'master' into OwnableInterface
linhpn99 86beac8
Merge branch 'master' into OwnableInterface
linhpn99 97d4b8e
Merge branch 'master' into OwnableInterface
linhpn99 2bd3f5f
Merge branch 'master' into OwnableInterface
linhpn99 1fb8a5d
Merge branch 'master' into OwnableInterface
linhpn99 05c8f72
Merge branch 'master' into OwnableInterface
linhpn99 b6dec1e
Merge branch 'master' into OwnableInterface
linhpn99 0c2e674
Merge branch 'master' into OwnableInterface
linhpn99 bc3f796
Merge branch 'master' into OwnableInterface
linhpn99 88b7481
fix CI
linhpn99 daafb62
Merge branch 'master' into OwnableInterface
linhpn99 9fa9d29
Merge branch 'master' into OwnableInterface
linhpn99 15cd55e
Merge branch 'master' into OwnableInterface
linhpn99 9754165
Merge branch 'master' into OwnableInterface
linhpn99 f537530
Merge branch 'master' into OwnableInterface
linhpn99 d1bea90
Merge branch 'master' into OwnableInterface
linhpn99 efafea7
use interface instead
linhpn99 8ad4405
Merge branch 'master' into OwnableInterface
linhpn99 5326931
Merge branch 'master' into OwnableInterface
linhpn99 04d4b75
Merge branch 'master' into OwnableInterface
linhpn99 17b7b7e
Merge branch 'master' into OwnableInterface
linhpn99 05e9a7b
Merge branch 'master' into OwnableInterface
moul fd450a1
Merge branch 'master' into OwnableInterface
linhpn99 73f9ddb
Merge branch 'master' into OwnableInterface
linhpn99 9eb51d4
Merge branch 'master' into OwnableInterface
linhpn99 22c98f6
Merge branch 'master' into OwnableInterface
linhpn99 b987650
Merge branch 'master' into OwnableInterface
linhpn99 26d7f83
resolve conflict
linhpn99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,5 @@ | ||||||
package pausable | ||||||
|
||||||
import "errors" | ||||||
|
||||||
var ErrUnauthorized = errors.New("unauthorized; address is not owner") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not exposing any transferable helper, so using the Ownable interface is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the value returned from owner.New() is currently a
transferrable
, which implements theTransferrable
interface. Using theOwner
interface here is not appropriateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you read some documentation on how Golang interfaces work.
Ownable and Transferrable are both correct. However, since you're only using the Ownable methods, I suggest receiving an Ownable rather than a Transferrable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand Go interfaces, but it seems my explanation was not correct. However, I need to confirm with you that there is a call to
TransferOwnership
in /r/demo/memeland. That's why i useddTransferrable
instead ofOwnable